From a404a335c0ffa4ac66951fde4d981279b75f4e15 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 27 Oct 2025 10:28:40 +0000 Subject: [PATCH] Refactor question review template for improved readability and structure; enhance question title display and answer rendering --- .../sbas/question_review_question.html | 63 ++++++++++++------- 1 file changed, 41 insertions(+), 22 deletions(-) diff --git a/sbas/templates/sbas/question_review_question.html b/sbas/templates/sbas/question_review_question.html index a51050a3..c2556bbf 100644 --- a/sbas/templates/sbas/question_review_question.html +++ b/sbas/templates/sbas/question_review_question.html @@ -1,7 +1,9 @@ -{# Generic question display used in review UI. Tries to be resilient across apps. #} +{% extends 'sbas/base.html' %} + +{% block content %}
{% if question.title %} -
{{ question.title }}
+
Reviewing question: {{ question.title }}
{% endif %}
@@ -12,29 +14,46 @@ {% endif %}
- {# Multiple-choice answers (SBA style) #} - {% if question.get_answers is defined or question.a_answer is defined %} -
- {% for code,label in (('a','A'),('b','B'),('c','C'),('d','D'),('e','E')) %} - {% with ans=getattr(question, code|add:'_answer', None) %} - {% if ans %} -
-
- {{ label }}. - {{ ans|safe }} -
- {% if question.best_answer and question.best_answer == code %} - Correct - {% endif %} -
- {% endif %} - {% endwith %} - {% endfor %} -
- {% endif %} + {# Multiple-choice answers (SBA specific) #} +
+ {% if question.a_answer %} +
+
A. {{ question.a_answer|safe }}
+ {% if question.best_answer == 'a' %}Correct{% endif %} +
+ {% endif %} + {% if question.b_answer %} +
+
B. {{ question.b_answer|safe }}
+ {% if question.best_answer == 'b' %}Correct{% endif %} +
+ {% endif %} + {% if question.c_answer %} +
+
C. {{ question.c_answer|safe }}
+ {% if question.best_answer == 'c' %}Correct{% endif %} +
+ {% endif %} + {% if question.d_answer %} +
+
D. {{ question.d_answer|safe }}
+ {% if question.best_answer == 'd' %}Correct{% endif %} +
+ {% endif %} + {% if question.e_answer %} +
+
E. {{ question.e_answer|safe }}
+ {% if question.best_answer == 'e' %}Correct{% endif %} +
+ {% endif %} +
{# Generic feedback text if present #} {% if question.feedback %}
Feedback: {{ question.feedback|safe }}
{% endif %}
+ + + +{% endblock %} \ No newline at end of file