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 %} {% for question in questions %}
<tr> <tr>
<td>Question {{forloop.counter}}</td> <td>Question {{forloop.counter}}</td>
{% for ans in by_question|get_item:question %} {% for ans, score in by_question|get_item:question %}
<td>{{ans}}</td> <td class="user-answer {{score}}">{{ans}} {{score}}</td>
{% endfor %} {% endfor %}
</tr> </tr>
{% endfor %} {% endfor %}
+2 -2
View File
@@ -674,7 +674,7 @@ def exam_scores_cid(request, pk):
# skip if no answer # skip if no answer
user_answers_marks[cid].append(0) user_answers_marks[cid].append(0)
user_answers[cid].append("") user_answers[cid].append("")
by_question[q].append("") by_question[q].append(("", 0))
continue continue
ans = s.answer ans = s.answer
@@ -686,7 +686,7 @@ def exam_scores_cid(request, pk):
user_answers_marks[cid].append(answer_score) user_answers_marks[cid].append(answer_score)
user_answers_and_marks[cid].append((ans, 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 = {} user_scores = {}
for user in user_answers_marks: for user in user_answers_marks: