Add option to reveal respondent identities in exam review responses

This commit is contained in:
Ross
2025-11-10 10:26:38 +00:00
parent 0d4d4f1dc0
commit f4878a58ac
2 changed files with 23 additions and 3 deletions
@@ -1,13 +1,28 @@
{# Responses partial for anatomy question within an exam. HTMX-loadable. #}
<div id="anatomy-responses-container">
<h6>Responses in this exam</h6>
<div class="small text-muted mb-2">List of candidate answers recorded for this question in the current exam.</div>
<div class="d-flex justify-content-between align-items-center mb-2">
<div>
<h6 class="mb-0">Responses in this exam</h6>
<div class="small text-muted">List of candidate answers recorded for this question in the current exam.</div>
</div>
<div>
{% if not reveal_respondents %}
<button class="btn btn-sm btn-outline-primary" hx-get="?reveal=1" hx-target="#anatomy-responses-container" hx-swap="outerHTML">Show respondents</button>
{% else %}
<button class="btn btn-sm btn-outline-secondary" hx-get="?" hx-target="#anatomy-responses-container" hx-swap="outerHTML">Hide respondents</button>
{% endif %}
</div>
</div>
<ul class="list-group">
{% for ua in exam_user_answers %}
<li class="list-group-item d-flex justify-content-between align-items-start">
<div>
{% if ua.user %}
<strong>{{ ua.user.get_full_name|default:ua.user.username }}</strong>
{% if reveal_respondents %}
<strong>{{ ua.user.get_full_name|default:ua.user.username }}</strong>
{% else %}
<strong>Respondent {{ forloop.counter }}</strong>
{% endif %}
{% else %}
<strong>Anonymous</strong>
{% endif %}