Git Product home page Git Product logo

sciencebowl's Introduction

sciencebowl

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.


Setting up your enviornment

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

Running Locally

Once you've set things up, you can run locally:

$ heroku local

Your app should now be running on localhost:5000.

Populating the db

Run the parser found in /scripts/ParseByFolder to generate some question data. Paste question data in /addquestions.html when running app.

Deploying to Heroku

$ 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.

Admin Functionality

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.

Changing Schema

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

Documentation

For more information about using Python on Heroku, see these Dev Center articles:


Scripts

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).

Question template

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.

sciencebowl's People

Contributors

andimus avatar dependabot[bot] avatar evanzhong avatar frankdai320 avatar silentctrl avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

shanhaiying

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.