.
This commit is contained in:
+7
-1
@@ -315,13 +315,19 @@ def exam_finish(request, pk, cid):
|
||||
)
|
||||
|
||||
|
||||
def exam_take(request, pk, sk, cid):
|
||||
def exam_take(request, pk, sk, cid, passcode=None):
|
||||
|
||||
exam = get_object_or_404(Exam, pk=pk)
|
||||
|
||||
if not exam.active:
|
||||
raise Http404("Exam not found")
|
||||
|
||||
if exam.valid_users is not None:
|
||||
user = exam.valid_users.filter(cid=cid)
|
||||
|
||||
if not user or user.passcode != passcode:
|
||||
raise Http404("Exam not found")
|
||||
|
||||
question = exam.exam_questions.all()[sk]
|
||||
|
||||
exam_length = len(exam.exam_questions.all())
|
||||
|
||||
Reference in New Issue
Block a user