This commit is contained in:
Ross
2022-01-03 16:51:23 +00:00
parent cacb834e45
commit bd88294861
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -8,7 +8,10 @@
{% for exam in exams %}
{% if exam.active %}
<li>
<a href="{% url 'physics:exam_overview' pk=exam.pk %}" class="flex-col">{{exam.name}}</a> <a href="{% url 'physics:exam_scores_cid' pk=exam.pk %}" class="flex-col">Scores</a> <span class="flex-col icon-container"><span class="published-icon {% if exam.publish_results %}published{% endif %}">Results Published</span></span>
<a href="{% url 'physics:exam_overview' pk=exam.pk %}" class="flex-col">{{exam.name}}</a> <a href="{% url 'physics:exam_scores_cid' pk=exam.pk %}" class="flex-col">Scores</a> <span class="flex-col icon-container"><span class="published-icon {% if exam.publish_results %}published{% endif %}">Results Published</span>
Publish results: <input type="checkbox" class="exam-publish-results-switch" data-posturl="{% url 'physics:exam_toggle_results_published' pk=exam.pk %}"
{% if exam.publish_results %}checked{% endif %}>
</span>
</li>
{% endif %}
{% endfor %}
+1 -1
View File
@@ -25,7 +25,7 @@
console.log('[Done]');
})
})
$("#exam-publish-results-switch").on("change", function (evt) {
$("#exam-publish-results-switch, .exam-publish-results-switch").on("change", function (evt) {
$.ajax({
url: evt.currentTarget.dataset.posturl,
data: {