diff --git a/rapids/migrations/0041_ciduseranswer_score.py b/rapids/migrations/0041_ciduseranswer_score.py new file mode 100644 index 00000000..e9f12e19 --- /dev/null +++ b/rapids/migrations/0041_ciduseranswer_score.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.8 on 2021-12-15 20:04 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('rapids', '0040_alter_exam_valid_users'), + ] + + operations = [ + migrations.AddField( + model_name='ciduseranswer', + name='score', + field=models.CharField(blank=True, choices=[('', 'Unmarked'), ('0', 'Incorrect'), ('1', 'Half mark'), ('2', 'Correct')], default='', max_length=1), + ), + ] diff --git a/rapids/models.py b/rapids/models.py index bd800d38..848a7859 100644 --- a/rapids/models.py +++ b/rapids/models.py @@ -654,6 +654,13 @@ class CidUserAnswer(models.Model): created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) + score = models.CharField( + max_length=1, + choices=Answer.MarkOptions.choices, + default=Answer.MarkOptions.UNMARKED, + blank=True + ) + def __str__(self): try: exam = self.exam