{# Aggregated response summary partial for anatomy questions (HTMX-loadable) #}
{% if exam_response_total %}
Total responses: {{ exam_response_total }}
Correct:
{% if exam_response_correct_count is not None %} {{ exam_response_correct_count }} {% if exam_response_correct_pct is not None %} ({{ exam_response_correct_pct }}%) {% endif %} {% else %} N/A {% endif %}
{# Correct (2) #}
Correct
{{ exam_response_score_counts|get_item:'2'|default:0 }} {{ exam_response_score_pcts|get_item:'2'|default:0 }}%
{# Half mark (1) #}
Half mark
{{ exam_response_score_counts|get_item:'1'|default:0 }} {{ exam_response_score_pcts|get_item:'1'|default:0 }}%
{# Incorrect (0) #}
Incorrect
{{ exam_response_score_counts|get_item:'0'|default:0 }} {{ exam_response_score_pcts|get_item:'0'|default:0 }}%
{# Unmarked (empty) #}
Unmarked
{{ exam_response_score_counts|get_item:'empty'|default:0 }} {{ exam_response_score_pcts|get_item:'empty'|default:0 }}%
{# Collapsible Top submitted answers - closed by default. #}
Top submitted answers
{% if top_answers %}
    {% for a in top_answers %}
  • {{ a.answer_compare }}
    {% if a.dominant_score == '2' %} Correct {% elif a.dominant_score == '1' %} Half {% elif a.dominant_score == '0' %} Incorrect {% else %} Unmarked {% endif %}
    {{ a.count }}
  • {% endfor %}
{% else %}
No submitted answers yet.
{% endif %}
{% else %}
No responses recorded for this question in the exam yet.
{% endif %}