start adding exam dates

This commit is contained in:
Ross
2024-05-18 08:39:45 +01:00
parent f37b3312e5
commit 4367b88057
14 changed files with 322 additions and 32 deletions
@@ -0,0 +1,28 @@
# Generated by Django 5.0.2 on 2024-05-13 10:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('anatomy', '0016_alter_exam_authors_only'),
]
operations = [
migrations.AddField(
model_name='exam',
name='end_date',
field=models.DateTimeField(help_text='Date (and time) the exam/collection ends', null=True),
),
migrations.AddField(
model_name='exam',
name='restrict_to_dates',
field=models.BooleanField(default=False, help_text='If the exam/collection should only be taken between the start and end date times'),
),
migrations.AddField(
model_name='exam',
name='start_date',
field=models.DateTimeField(help_text='Date (and time) the exam/collection starts', null=True),
),
]
+1 -1
View File
@@ -413,7 +413,7 @@ def exam_scores_cid_user(request, pk, cid, passcode):
if not exam.exam_mode:
raise Http404("Packet not in exam mode")
if not exam.check_cid_user(cid, passcode, request):
if not exam.check_cid_user(cid, passcode, request.user):
raise Http404("Error accessing exam")
questions = exam.exam_questions.all()