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 anatomy my-3">
@@ -52,6 +53,15 @@
{% if request.user.is_staff %}
<button type="button" class="btn btn-sm btn-outline-secondary ms-2 admin-edit-button" data-qn="{{ forloop.counter0 }}">Edit</button>
{% endif %}
{% if request.user.is_staff or view_all_results or request.user in exam.author.all %}
{% with q=questions|get_item:forloop.counter0 %}
{% with ua=user_answers_map|get_item:q.pk %}
{% if ua %}
<a href="{% url 'generic:view_answer_history' app_name='anatomy' model_name='UserAnswer' pk=ua.pk %}" class="btn btn-sm btn-outline-info ms-2">History</a>
{% endif %}
{% endwith %}
{% endwith %}
{% endif %}
</div>
</li>
{% endfor %}