This commit is contained in:
Ross
2021-07-29 22:14:31 +01:00
parent 6ebb716f7b
commit c33b4cb25d
+3 -1
View File
@@ -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),
},
)