From ef03a97e9e1890a71cc3544eb7b72a2ea9705afa Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 19 Jan 2026 12:18:28 +0000 Subject: [PATCH] Refactor exam scores user template for improved layout and clarity --- .../templates/physics/exam_scores_user.html | 109 +++++++++++------- 1 file changed, 65 insertions(+), 44 deletions(-) diff --git a/physics/templates/physics/exam_scores_user.html b/physics/templates/physics/exam_scores_user.html index a042e770..e99df202 100644 --- a/physics/templates/physics/exam_scores_user.html +++ b/physics/templates/physics/exam_scores_user.html @@ -1,52 +1,73 @@ {% extends 'base.html' %} {% block content %} -
+
{% include 'user_score_header.html' %} -
    - {% for question, ans in answers_and_marks %} -
  • - {% if request.user.is_authenticated %} - - Question {{forloop.counter}} - - {% else %} - - Question {{forloop.counter}} - - {% endif %} - - {{ question.stem|safe }} -
      - {% for q, a, score, correct_answer in ans %} -
    1. - {{q|safe}}: {% if exam.publish_results %}Correct answer: {{correct_answer|safe}}{% endif %} -
      - - {% if exam.publish_results or view_all_results%} - - (Score: {{score}}) - - {% endif %} - {% if exam.publish_results %} - {% if forloop.counter0 == 0 and question.a_feedback %} -
      Feedback: {{ question.a_feedback|safe }}
      - {% elif forloop.counter0 == 1 and question.b_feedback %} -
      Feedback: {{ question.b_feedback|safe }}
      - {% elif forloop.counter0 == 2 and question.c_feedback %} -
      Feedback: {{ question.c_feedback|safe }}
      - {% elif forloop.counter0 == 3 and question.d_feedback %} -
      Feedback: {{ question.d_feedback|safe }}
      - {% elif forloop.counter0 == 4 and question.e_feedback %} -
      Feedback: {{ question.e_feedback|safe }}
      - {% endif %} - {% endif %} -
    2. - {% endfor %} -
    -
  • - {% endfor %} -
+
+
+
    + {% for question, ans in answers_and_marks %} +
  • +
    +
    + {{ forloop.counter }} +
    +
    +
    + {% if request.user.is_authenticated %} + Question {{forloop.counter}} + {% else %} + Question {{forloop.counter}} + {% endif %} + - {{ question.stem|safe }} +
    + +
    +
      + {% for q, a, score, correct_answer in ans %} +
    1. +
      {{ q|safe }}
      +
      + {% if exam.publish_results %} +
      Correct answer: {{ correct_answer|safe }}
      + {% endif %} + + {% if exam.publish_results or view_all_results %} +
      (Score: {{score}})
      + {% endif %} + {% if exam.publish_results %} + {% if forloop.counter0 == 0 and question.a_feedback %} +
      Feedback: {{ question.a_feedback|safe }}
      + {% elif forloop.counter0 == 1 and question.b_feedback %} +
      Feedback: {{ question.b_feedback|safe }}
      + {% elif forloop.counter0 == 2 and question.c_feedback %} +
      Feedback: {{ question.c_feedback|safe }}
      + {% elif forloop.counter0 == 3 and question.d_feedback %} +
      Feedback: {{ question.d_feedback|safe }}
      + {% elif forloop.counter0 == 4 and question.e_feedback %} +
      Feedback: {{ question.e_feedback|safe }}
      + {% endif %} + {% endif %} +
      +
    2. + {% endfor %} +
    +
    + +
    + Category: {{ question.category }} + — View + Edit +
    +
    +
    +
  • + {% endfor %} +
+
+
+ {% include 'user_scores_footer.html' %}
{% endblock %} \ No newline at end of file