This commit is contained in:
Ross
2021-12-31 10:06:48 +00:00
parent 6718195d57
commit 6efe4dc74b
+6 -3
View File
@@ -111,9 +111,12 @@ def exam_scores_cid_user(request, pk, cid, passcode):
# Get user answer
user_answer = q.cid_user_answers.filter(cid=cid, exam__id=pk).first()
ans = user_answer.get_answers()
answer_scores = user_answer.get_answer_score()
if user_answer is None:
answer_scores = (0, 0, 0, 0, 0)
ans = ("", "", "", "", "")
else:
ans = user_answer.get_answers()
answer_scores = user_answer.get_answer_score()
correct_answers = q.get_answers()