This commit is contained in:
Ross
2021-07-29 20:11:57 +01:00
parent 277466fa44
commit adcdd4782b
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -8,11 +8,9 @@
<ul>
{% for question, ans in answers_and_marks %}
<li class="user-answer-li">Question {{forloop.counter}} - {{ question.stem }}</li>
<ol type="a">
{% for q, a, score, correct_answer in ans %}
<li>{{q}}: Correct answer: {{correct_answer}} <br />{{a}} <span class="answer-{{score}}">(Score: {{score}})</span></li>
{% for a, score, correct_answer in ans %}
<span>Correct answer: {{correct_answer}} <br />{{a}} <span class="answer-{{score}}">(Score: {{score}})</span></span>
{% endfor %}
</ol>
{% endfor %}
</ul>
<br /> Total mark: {{ total_score }} / {{max_score}}
+1 -1
View File
@@ -200,7 +200,7 @@ def exam_scores_cid_user(request, pk, sk):
answers_marks.append(answer_score)
merged_ans = (ans, answer_score, correct_answer)
answers_and_marks.append((q, *merged_ans))
answers_and_marks.append((q, merged_ans))
total_score = sum(answers_marks)