Too many changes :(
This commit is contained in:
@@ -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 %}
|
||||
+2
-2
@@ -388,12 +388,12 @@ def generic_exam_urls(generic_exam_view: GenericExamViews):
|
||||
),
|
||||
path(
|
||||
"exam/<int:pk>/toggle_active",
|
||||
generic_exam_view.exam_toggle_active,
|
||||
generic_exam_view.exam_toggle_active_htmx,
|
||||
name="exam_toggle_active",
|
||||
),
|
||||
path(
|
||||
"exam/<int:pk>/toggle_results_published",
|
||||
generic_exam_view.exam_toggle_results_published,
|
||||
generic_exam_view.exam_toggle_results_published_htmx,
|
||||
name="exam_toggle_results_published",
|
||||
),
|
||||
path(
|
||||
|
||||
Reference in New Issue
Block a user