diff --git a/quiz/migrations/0009_auto_20201006_1556.py b/quiz/migrations/0009_auto_20201006_1556.py new file mode 100644 index 00000000..b0ddc984 --- /dev/null +++ b/quiz/migrations/0009_auto_20201006_1556.py @@ -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), + ), + ] diff --git a/quiz/models.py b/quiz/models.py index 7d7c2572..a570b684 100644 --- a/quiz/models.py +++ b/quiz/models.py @@ -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 @@ -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):