{# Partial: list of exams used by HTMX bulk actions #}
<div id="exam-list-container">
  <h4 class="exam-number-title">{{ filter.qs|length }} exams found.</h4>

  {% for exam in filter.qs %}
    <div class="mb-2" id="exam-{{ exam.pk }}">
      <div class="d-flex align-items-start">
        <div class="form-check me-2">
          <input class="form-check-input exam-select-checkbox" type="checkbox" name="exam_ids" value="{{ exam.pk }}" id="select-exam-{{ exam.pk }}">
        </div>
        <div>
          <h5 class="mb-0 d-flex align-items-center">
            <a href="{% url app_name|add:':exam_overview' pk=exam.pk %}">
              {% if exam.exam_mode %}Exam:{% else %}Packet:{% endif %} {{ exam }}
            </a>
            {% if exam.archive %}
              <span class="badge bg-warning text-dark ms-2" title="This exam is archived">Archived</span>
            {% endif %}
            <small class="ms-2 text-muted">
              <span class="badge bg-secondary">Questions: {{ exam.get_questions|length }}</span>
              <span class="badge bg-secondary ms-1">Candidates: {{ exam.get_candidate_count }}</span>
            </small>
          </h5>
          <small class="text-muted">Authors: {{ exam.get_authors }}</small>
          {% if exam.exam_mode %}
            {% if app_name in "rapids longs anatomy" %}
              {% if request.user.is_staff %}
                <a href="{% url app_name|add:':mark_overview' pk=exam.pk %}">Mark answers</a>
                {% if app_name == 'anatomy' %} / <a href="{% url 'anatomy:mark2_overview' pk=exam.pk %}">Mark (mark2)</a>{% endif %}
              {% endif %}
            {% endif %}
            {% if request.user.is_staff %}<a href="{% url app_name|add:':exam_scores_all' pk=exam.pk %}">Scores</a>{% endif %}
          {% endif %}
        </div>
      </div>
    </div>
  {% endfor %}
</div>
