start adding exam dates
This commit is contained in:
@@ -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 = [
|
||||
('sbas', '0009_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),
|
||||
),
|
||||
]
|
||||
+2
-2
@@ -119,7 +119,7 @@ def exam_take_overview(request, pk, cid=None, passcode=None):
|
||||
if not exam.active:
|
||||
return exam_inactive(request, context={"exam": exam})
|
||||
|
||||
exam.check_user_can_take(cid, passcode, request)
|
||||
exam.check_user_can_take(cid, passcode, request.user)
|
||||
|
||||
questions = exam.exam_questions.all()
|
||||
|
||||
@@ -164,7 +164,7 @@ def exam_take(request, pk: int, sk: int, cid: int = None, passcode: str = None):
|
||||
if not exam.active:
|
||||
return exam_inactive(request, context={"exam": exam})
|
||||
|
||||
exam.check_user_can_take(cid, passcode, request)
|
||||
exam.check_user_can_take(cid, passcode, request.user)
|
||||
|
||||
cid_user_exam = exam.get_or_create_cid_user_exam(cid = cid, user_user=request.user)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user