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), }, )