From 9c4eaceda0d577ddecde665afef022a5ab360f81 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 10 Nov 2025 10:44:39 +0000 Subject: [PATCH] Refactor exam review templates to enhance the display of marked answers and top submitted answers with collapsible sections and improved styling --- .../exam_review_question_fragment.html | 57 +++++++++++-------- ...exam_review_question_summary_fragment.html | 57 +++++++++++-------- 2 files changed, 66 insertions(+), 48 deletions(-) diff --git a/anatomy/templates/anatomy/partials/exam_review_question_fragment.html b/anatomy/templates/anatomy/partials/exam_review_question_fragment.html index cbeae2f1..4554b455 100644 --- a/anatomy/templates/anatomy/partials/exam_review_question_fragment.html +++ b/anatomy/templates/anatomy/partials/exam_review_question_fragment.html @@ -8,30 +8,39 @@

-
Marked answers
- +
+
Marked answers
+
+
{{ question.answers.all|length }}
+ +
+
+ +
+
    + {% for answer in question.answers.all|dictsortreversed:"status" %} +
  • +
    + {% if answer.proposed %} + (proposed) + {% endif %} + {{ answer.answer }} +
    +
    + {% if answer.status == '2' %} + Correct + {% elif answer.status == '1' %} + Half mark + {% elif answer.status == '0' %} + Incorrect + {% else %} + Unmarked + {% endif %} +
    +
  • + {% endfor %} +
+
{# Aggregated summary placeholder — auto-load via HTMX #} diff --git a/anatomy/templates/anatomy/partials/exam_review_question_summary_fragment.html b/anatomy/templates/anatomy/partials/exam_review_question_summary_fragment.html index 01fb830d..b754251d 100644 --- a/anatomy/templates/anatomy/partials/exam_review_question_summary_fragment.html +++ b/anatomy/templates/anatomy/partials/exam_review_question_summary_fragment.html @@ -63,30 +63,39 @@
-
Top submitted answers
- {% if top_answers %} - - {% else %} -
No submitted answers yet.
- {% endif %} + {# Collapsible Top submitted answers - closed by default. #} +
+
Top submitted answers
+ +
+ +
+ {% if top_answers %} +
    + {% for a in top_answers %} +
  • +
    {{ a.answer_compare }}
    +
    + {% if a.dominant_score == '2' %} + Correct + {% elif a.dominant_score == '1' %} + Half + {% elif a.dominant_score == '0' %} + Incorrect + {% else %} + Unmarked + {% endif %} +
    {{ a.count }}
    +
    +
  • + {% endfor %} +
+ {% else %} +
No submitted answers yet.
+ {% endif %} +
{% else %}
No responses recorded for this question in the exam yet.