From 64110684d8b99428b3095f895920df8566fca270 Mon Sep 17 00:00:00 2001 From: Ross Date: Thu, 29 Jul 2021 19:33:01 +0100 Subject: [PATCH] . --- sbas/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbas/views.py b/sbas/views.py index 182caca1..71ccb940 100644 --- a/sbas/views.py +++ b/sbas/views.py @@ -253,7 +253,7 @@ def exam_take(request, pk, sk, cid): pos = exam.get_question_index(question) + 1 answer = question.cid_user_answers.filter( - cid=cid).first() + cid=cid, exam=exam).first() if request.method == "POST": if answer: @@ -264,6 +264,7 @@ def exam_take(request, pk, sk, cid): answer = form.save(commit=False) answer.cid = cid answer.question = question + answer.exam = exam # answer.published_date = timezone.now() answer.save() if "next" in request.POST: