Skip to content

Commit

Permalink
Merge pull request #6 from Kaustuv942/beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaustuv942 authored Oct 6, 2020
2 parents 8fe6c31 + 9c1963a commit e75b0b0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
27 changes: 27 additions & 0 deletions quiz/migrations/0009_auto_20201006_1556.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 3.0.5 on 2020-10-06 15:56

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('quiz', '0008_auto_20200927_1536'),
]

operations = [
migrations.AlterModelOptions(
name='config',
options={'ordering': ['-current_day', 'quiz_endtime']},
),
migrations.AddField(
model_name='config',
name='points',
field=models.IntegerField(default=10),
),
migrations.AlterField(
model_name='question',
name='hint',
field=models.CharField(default='N/A', max_length=555),
),
]
3 changes: 2 additions & 1 deletion quiz/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def leaderboard(self):

def new_score(self,player):

player.score+=10 # 10 added
curr_config = config.current_config(config)
player.score+=curr_config.points # points from config added
curr_question=player.current_question
if curr_config.q_no == curr_question:
player.current_question = 1 #if the max no. of questions are reached for the day, then ptr is moved
Expand All @@ -96,6 +96,7 @@ class config(models.Model):
quiz_active=models.BooleanField(default=True)
quiz_start=models.DateTimeField()
quiz_endtime=models.DateTimeField()
points=models.IntegerField(default=10)
class Meta:
ordering =['-current_day','quiz_endtime']
def __str__(self):
Expand Down

0 comments on commit e75b0b0

Please sign in to comment.