Hopeless Opus is an online event organised by Acumen, ISTE Manipal in the national level technical festival TechTatva. Hopeless Opus is a choice-based story based game, where people are supposed to answer aptitude questions to advance further in the story. The choice a person makes in the story based question decides the number of aptitude questions the player answers after that, and also decides the path on which the user goes on.
Step 1: Initialize the virtual environment and activate it
python -m venv env source env/bin/activate (for windows replace bin by Scripts)
Step 2: Install the dependencies
pip install -r requirments.txt
(Make sure that the working directory is the same as requirements.txt file)
Step3 : Start the development server
python manage.py runserver
Note that if you are using a different database than the SQLite database, you need to change the database setting in settings.py and run the migrations
| Name | Type | Description |
|---|---|---|
| level | Integer Field | Represents the maximum aptitude questions one has to answer on choosing this. This should be unique. |
| description | Character field | One word description such as good, medium, bad |
| points | Integer field | Maximum points one gets for choosing this path |
| Name | Type | Description |
|---|---|---|
| question_number | Integer Field | Self-explanatory |
| question | TextFied | The text of the question |
| Name | Type | Description |
|---|---|---|
| question | Foreign key to Story question | Self-explanatory |
| level | Foreign key to level | Self-explanatory |
| option | Text Field | The text of the option |
| on_chosen | Integer Field | The question number to which a user goes to when he chooses this option |
- utils.py within game app : This has helper functions to check for end of day and also to get rank of a user. The DAYS Dictionary is designed in such a way that it is self-explanatory. Also, BRANCHES is a list of all branched questions. The DAYS dictionary has a key called branches, which can be used for keeping a record. It is not used anywhere in evaluating anything.
- send_userid_mail.py within user app: This is a Django management command, which is used for sending mails to all participants who haven't updated their UserIds yet. To use this, we need to run the command
python manage.py send_userid_mail. To know more about custom management commands, click here or here