A question bank application for National Science Bowl / National Ocean Sciences Bowl. Created for and by Albany High School Science Bowl team members and alums.
Upload questions written by the team, and use the db to generate custom question sets (randomly picking from the questions previously uploaded), so you never run out of question sets to practice on.
New students? Please contact @andimus or @evazhog about usage or maintenance.
Make sure you have Python installed properly and Postgres
Then:
$ git clone https://github.com/evazhog/sciencebowl
$ cd sciencebowl
$ pip install -r requirements.txt
$ createdb sciencebowl
$ python manage.py migrate
$ python manage.py collectstatic
If you want to be able to deploy to heroku, you'll need to install the Heroku Toolbelt, get access from an admin.
Then:
$ heroku git:remote -a sciencebowl
Once you've set things up, you can run locally:
$ heroku local
Your app should now be running on localhost:5000.
Run the parser found in /scripts/ParseByFolder
to generate some question data.
Paste question data in /addquestions.html
when running app.
$ git push heroku master
The app is now live at: https://sciencebowl.herokuapp.com. You will need the club's login credentials to access the app.
Python has some nice built in admin functionality we can use to edit the DB.
Create a superuser
$ python manage.py createsuperuser
You should be able to use the admin page at: http://localhost:5000/admin
Note: don't forget to add new tables to admin.py
to be able to edit them.
After a schema change, you'll need to migrate your database locally to work. To do this run:
$ python manage.py makemigrations
$ python manage.py migrate
Also, make sure to include your migration files (the hello/migrations/####_auto...py
files generated by the makemigrations script) when you check in. After you deploy, run the migrate function on heroku:
$ heroku run python manage.py migrate
For more information about using Python on Heroku, see these Dev Center articles:
In /scripts, you can find two python text parsers that will parse through and convert your self written questions into Tab-separated values (.tsv) that you can upload to the database.
The parser found in /ParseByFolder
is the best and fastest parser to use. Please note the .txt files must be in the format:
AUTHOR_NAME QUESTION_SET_CODE_ SUBTOPIC [NUM_QUESTIONS].txt
i.e.
Evan Zhong J8_ Acid-Base Equilibria [35].txt
This formatting is optimized for downloading question sets from our team Google Drive ([email protected]), as all downloads from the drive should automatically be in the above format (assuming you guys are still following the question template and naming nomenclature outlined in the club handbook).
If you're looking to parse a single question set use the parser found in /ParseByFolder
. This, however, is significantly slower because you have to manually input all the header fields (Subject, Subtopic, Question code, etc.), as the parser isn't smart enough to extract them from the file.