Add user answer viewing and compaction

This commit is contained in:
Ross
2026-07-06 09:07:48 +01:00
parent 5ce4a67b31
commit 5a2baaeab8
16 changed files with 370 additions and 4 deletions
@@ -1,4 +1,5 @@
{% extends 'base.html' %}
{% load help_tags %}
{% block content %}
<div class="container physics my-3">
@@ -28,6 +29,13 @@
{% else %}
<a href="{% url 'physics:exam_take' exam.pk forloop.counter0 cid passcode %}" class="text-decoration-none text-body">{{ question.stem|safe }}</a>
{% endif %}
{% if request.user.is_staff or view_all_results or request.user in exam.author.all %}
{% with ua=user_answers_map|get_item:question.pk %}
{% if ua %}
<a href="{% url 'generic:view_answer_history' app_name='physics' model_name='UserAnswer' pk=ua.pk %}" class="btn btn-sm btn-outline-info ms-2" style="font-size: 11px; padding: 2px 6px; vertical-align: middle;">History</a>
{% endif %}
{% endwith %}
{% endif %}
</div>
<div class="mb-2">