Files
penracourses/generic/templates/generic/exam_overview_headers.html
T
2025-07-29 09:20:58 +01:00

136 lines
4.7 KiB
HTML

{% include "generic/exam_link_headers.html" %}
<h1>Exam: {{ exam }}</h1>
{% include 'exam_notes.html' %}
{% if exam.examcollection %}
<div>This exam is part of the collection: <a href="{{ exam.examcollection.get_absolute_url }}">{{ exam.examcollection }}</a></div>
{% endif %}
{% if exam.recreate_json %}
<div class="alert alert-warning" role="alert">
Exam JSON may be out of date.
<a href="{% url exam.get_app_name|add:':exam_json_recreate' pk=exam.pk %}">Click here to force refresh</a>
</div>
{% endif %}
{% if exam.exam_mode %}
{% if exam.exam_open_access %}
{% else %}
{% if not exam.cid_user_groups.count and not exam.user_user_groups.count %}
<div class="alert alert-danger" role="alert">
This exam does not have any user / cid groups added.
</div>
{% if not candidate_count.0 and not candidate_count.1 %}
<div class="alert alert-danger" role="alert">
This exam does not have any candidates.
</div>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% if exam.archive %}
<div class="alert alert-info" role="alert">
This exam is archived. Results and submitted answers will not be available to candidates. They can still be viewed by supervisors.
</div>
{% endif %}
This exam has {{question_number}} questions.
<span title="Time per question: {% widthratio exam.time_limit question_number 1 %} seconds">Time limit: {{exam.time_limit}} seconds [{{exam.get_time_limit}}]
<i class="bi bi-info-circle"></i>
</span>.
Exam mode: {{ exam.exam_mode }}<br />
{% if exam.exam_mode %}
{% if exam.exam_open_access %}
This exam is available to all registered users.<br />
{% else %}
Cid candidates: <a href="{{exam.get_cid_edit_url}}">{{candidate_count.0}}</a>, User candidates: <a href="{{exam.get_user_edit_url}}">{{candidate_count.1}}</a><br />
{% endif %}
{% endif %}
Markers:
{% for marker in exam.markers.all %}
{{marker}}{% if not forloop.last %},{% endif %}
{% empty %}
<span title="Only exam authors will be able to mark.">No additional markers.</span>
{% endfor %}
<br/>
{% if can_edit and exam.exam_mode %}
<details class="answer-management">
<summary>Answer management</summary>
<div>
<div class="alert alert-danger">
<i class="bi bi-exclamation-diamond"></i> Manage answers for this collection. Please note these are <b>permanant</b> and cannot be undone.
</div>
<details>
<summary>Click here to show management options</summary>
<button title="This will clear all user answers and attempts"
hx-post="{% url exam.get_app_name|add:':exam_reset_answers' exam.pk %}"
hx-swap="outerHTML"
hx-confirm="Are you sure you want to reset all answers? This action cannot be undone."
>Reset all answers</button>
</details>
</div>
</details>
{% endif %}
Open access: {{ exam.open_access }}<br />
{% if exam.start_date %}
Start date: {{ exam.start_date }}
{% endif %}
{% if exam.end_date %}
/ End date: {{ exam.end_date }}
{% endif %}
{% include "generic/partials/exams/exam_status.html#exam-active" %}
{% if exam.exam_mode %}
{% include "generic/partials/exams/exam_status.html#publish-results" %}
{% if exam.get_app_name == "anatomy" or exam.get_app_name == "longs" %}
<p><a href="{% url exam.get_app_name|add:':mark_overview' pk=exam.pk %}"><button>Mark exam</button></a></p>
{% endif %}
{% endif %}
{% if exam.examcollection %}
Exam Collection: <a href="{{ exam.examcollection.get_absolute_url }}">{{ exam.examcollection }}</a> <br/>
{% endif %}
Author(s): {% for author in exam.author.all %}
{{ author }}{% if not forloop.last %}, {% endif %}
{% endfor %}<br/>
<span title="If true the results from this exam will be visible to supervisors automatically. If false the trainee will have to manually approve access.">Supervisor visible: {{exam.results_supervisor_visible}}</span><br/>
<details>
<summary>Extra</summary>
Occasionally the order of questions can get out of sync. If you are exeriancing issues with the order of questions you can reset the order here.
<button title="This will clear all user answers and attempts"
hx-post="{% url exam.get_app_name|add:':order_questions' exam.pk %}"
hx-swap="outerHTML"
>Order questions</button>
</details>
{% block css %}
<style>
.answer-management[open] {
border: 1px dashed lightgrey;
border-top: 1px dotted lightgrey;
}
</style>
{% endblock css %}