Too many changes :(

This commit is contained in:
Ross
2025-07-29 09:20:58 +01:00
parent ad4be1e9a6
commit 4460545442
20 changed files with 361 additions and 81 deletions
@@ -96,22 +96,10 @@ Open access: {{ exam.open_access }}<br />
{% endif %}
<div class="parent-help" title="Click to enable / disable the exam">
Exam active: <input type="checkbox"
{% if not can_edit %}
disabled
{% endif %}
id="exam-active-switch" {% if exam.active %}checked{% endif %} data-posturl="{% url exam.get_app_name|add:':exam_toggle_active' pk=exam.pk %}"> <span class="help-text">[When checked the exam will be available to take in the test system]</span>
</div>
{% include "generic/partials/exams/exam_status.html#exam-active" %}
{% if exam.exam_mode %}
<div class="parent-help" title="Click to enable / disable the exam results">
Publish results: <input type="checkbox"
{% if not can_edit %}
disabled
{% endif %}
id="exam-publish-results-switch" data-posturl="{% url exam.get_app_name|add:':exam_toggle_results_published' pk=exam.pk %}"
{% if exam.publish_results %}checked{% endif %}> <span class="help-text">[When checked the exam results will be available to users on this site]</span>
</div>
{% 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 %}
@@ -1,15 +1,15 @@
{% load partials %}
{% partialdef publish-results %}
<div id="publish-results-status">
Publish results: <span>{{collection.publish_results}}</span>
<div id="publish-results-status" >
Publish results: <span>{{exam.publish_results}}</span>
<button
hx-post="{% url 'atlas:exam_toggle_results_published' collection.pk %}"
hx-post="{% url exam.get_app_name|add:':exam_toggle_results_published' exam.pk %}"
hx-swap="outerHTML"
hx-target="#publish-results-status"
class="btn btn-sm btn-outline-primary reduce-opacity"
>
{% if collection.publish_results %}Unpublish Results{% else %}Publish Results{% endif %}
{% if exam.publish_results %}Unpublish Results{% else %}Publish Results{% endif %}
</button>
</div>
{% endpartialdef publish-results %}
@@ -17,14 +17,14 @@
{% partialdef exam-active %}
<div id="exam-active-status">
Exam active: <span>{{collection.active}}</span>
Exam active: <span>{{exam.active}}</span>
<button
hx-post="{% url 'atlas:exam_toggle_active' collection.pk %}"
hx-post="{% url exam.get_app_name|add:':exam_toggle_active' exam.pk %}"
hx-swap="outerHTML"
hx-target="#exam-active-status"
class="btn btn-sm btn-outline-primary reduce-opacity"
>
{% if collection.active %}Deactivate Exam{% else %}Activate Exam{% endif %}
{% if exam.active %}Deactivate Exam{% else %}Activate Exam{% endif %}
</button>
</div>
{% endpartialdef exam-active %}