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: