diff --git a/anatomy/templates/anatomy/exam_scores.html b/anatomy/templates/anatomy/exam_scores.html index a4cf87d8..98b22c0b 100644 --- a/anatomy/templates/anatomy/exam_scores.html +++ b/anatomy/templates/anatomy/exam_scores.html @@ -47,8 +47,8 @@ {% for question in questions %} Question {{forloop.counter}} - {% for ans in by_question|get_item:question %} - {{ans}} + {% for ans, score in by_question|get_item:question %} + {{ans}} {{score}} {% endfor %} {% endfor %} diff --git a/anatomy/views.py b/anatomy/views.py index b6520924..7bc47e1a 100644 --- a/anatomy/views.py +++ b/anatomy/views.py @@ -674,7 +674,7 @@ def exam_scores_cid(request, pk): # skip if no answer user_answers_marks[cid].append(0) user_answers[cid].append("") - by_question[q].append("") + by_question[q].append(("", 0)) continue ans = s.answer @@ -686,7 +686,7 @@ def exam_scores_cid(request, pk): user_answers_marks[cid].append(answer_score) user_answers_and_marks[cid].append((ans, answer_score)) - by_question[q].append(ans) + by_question[q].append((ans, answer_score)) user_scores = {} for user in user_answers_marks: