This commit is contained in:
Ross
2021-01-03 17:36:17 +00:00
parent 67996ad9a9
commit 69f5e6f6b5
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -47,8 +47,8 @@
{% for question in questions %}
<tr>
<td>Question {{forloop.counter}}</td>
{% for ans in by_question|get_item:question %}
<td>{{ans}}</td>
{% for ans, score in by_question|get_item:question %}
<td class="user-answer {{score}}">{{ans}} {{score}}</td>
{% endfor %}
</tr>
{% endfor %}
+2 -2
View File
@@ -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: