From c33b4cb25d1f93df649e40a179bf28126b837801 Mon Sep 17 00:00:00 2001 From: Ross Date: Thu, 29 Jul 2021 22:14:31 +0100 Subject: [PATCH] . --- sbas/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbas/views.py b/sbas/views.py index 72dbac74..444d6505 100644 --- a/sbas/views.py +++ b/sbas/views.py @@ -249,9 +249,11 @@ def exam_finish(request, pk, cid): answer_question_map[ans.question] = ans question_answer_tuples = [] + answer_count = 0 for q in questions: if q in answer_question_map and answer_question_map[q].answer: question_answer_tuples.append((q, answer_question_map[q])) + ++answer_count else: question_answer_tuples.append((q, None)) @@ -265,7 +267,7 @@ def exam_finish(request, pk, cid): "exam": exam, "cid": cid, "question_answer_tuples": question_answer_tuples, - "answer_count": len(answers), + "answer_count": answer_count, "exam_length": len(questions), }, )