Enhance question feedback in exam review by adding answers and feedback details for each part

This commit is contained in:
Ross
2025-11-10 13:17:19 +00:00
parent d176288607
commit eebbe8b759
2 changed files with 13 additions and 10 deletions
@@ -7,21 +7,15 @@
<h6>Parts</h6>
<ul class="list-group">
{% if question.get_questions %}
{% for part in question.get_questions %}
{% for question, answer, feedback in question.get_questions_and_answers_and_feedback %}
<li class="list-group-item d-flex justify-content-between align-items-start">
<div>
<strong>Part {{ forloop.counter }}.</strong>
<span class="ms-2">{{ part }}</span>
<span class="ms-2">{{ question }}</span>
</div>
<div>
{# If we can determine the correct answer for this part show a badge - best-effort #}
{% if question.get_answers %}
{% with ans=question.get_answers|get_item:forloop.counter0 %}
{% if ans %}
<span class="badge bg-primary">Answer: {{ ans }}</span>
{% endif %}
{% endwith %}
{% endif %}
<span class="badge bg-primary">Answer: {{ answer }}</span>
<span class="ms-2">{{ feedback }}</span>
</div>
</li>
{% endfor %}