From 1bcfa722af4546786ce756e52b92aad5deb12b8e Mon Sep 17 00:00:00 2001 From: Ross Date: Tue, 17 Aug 2021 18:13:25 +0100 Subject: [PATCH] . --- longs/templates/longs/exam_overview.html | 114 ++++++++++++----------- 1 file changed, 58 insertions(+), 56 deletions(-) diff --git a/longs/templates/longs/exam_overview.html b/longs/templates/longs/exam_overview.html index 4915abd3..977a8580 100644 --- a/longs/templates/longs/exam_overview.html +++ b/longs/templates/longs/exam_overview.html @@ -15,8 +15,8 @@ class="help-text">[When checked the exam will be available to take in the test system]
- Publish results: [When checked the exam results will + Publish results: [When checked the exam results will be available on this site]
{% endif %} @@ -26,11 +26,21 @@ {% for question in questions.all %}
  • - Description: {{ question.description}} -
    - History: {{ question.history}} -
    - {% for series in question.series.all %} + + Description: {{ question.description}} +
    + History: {{ question.history}} +
    + {% for series in question.series.all %} +
    + Author(s): {{question.get_authors}} +
    +
    + View / Edit +
    +
    Series {{forloop.counter }}:
    {{series.get_block}} @@ -38,14 +48,6 @@ {% empty %} No series {% endfor %} -
    - Author(s): {{question.get_authors}} -
    -
    - View / Edit -
  • {% endfor %} @@ -63,7 +65,7 @@ JSON Refresh JSON cache Refresh Question JSON cache - + @@ -73,14 +75,14 @@ // send request to change the is_private state on customSwitches toggle $("#exam-active-switch").on("change", function () { $.ajax({ - url: "{% url 'longs:exam_toggle_active' pk=exam.pk %}", - data: { - csrfmiddlewaretoken: "{{ csrf_token }}", - active: this.checked // true if checked else false - }, - type: "POST", - dataType: "json", - }) + url: "{% url 'longs:exam_toggle_active' pk=exam.pk %}", + data: { + csrfmiddlewaretoken: "{{ csrf_token }}", + active: this.checked // true if checked else false + }, + type: "POST", + dataType: "json", + }) // $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly .done(function (data) { console.log(data); @@ -97,14 +99,14 @@ }) $("#exam-publish-results-switch").on("change", function () { $.ajax({ - url: "{% url 'longs:exam_toggle_results_published' pk=exam.pk %}", - data: { - csrfmiddlewaretoken: "{{ csrf_token }}", - publish_results: this.checked // true if checked else false - }, - type: "POST", - dataType: "json", - }) + url: "{% url 'longs:exam_toggle_results_published' pk=exam.pk %}", + data: { + csrfmiddlewaretoken: "{{ csrf_token }}", + publish_results: this.checked // true if checked else false + }, + type: "POST", + dataType: "json", + }) // $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly .done(function (data) { console.log(data); @@ -121,14 +123,14 @@ }) $("#button-open-access").click(function () { $.ajax({ - url: "{% url 'longs:exam_json_edit' pk=exam.pk %}", - data: { - csrfmiddlewaretoken: "{{ csrf_token }}", - set_open_access: true, - }, - type: "POST", - dataType: "json", - }) + url: "{% url 'longs:exam_json_edit' pk=exam.pk %}", + data: { + csrfmiddlewaretoken: "{{ csrf_token }}", + set_open_access: true, + }, + type: "POST", + dataType: "json", + }) // $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly .done(function (data) { console.log(data); @@ -143,14 +145,14 @@ }) $("#button-closed-access").click(function () { $.ajax({ - url: "{% url 'longs:exam_json_edit' pk=exam.pk %}", - data: { - csrfmiddlewaretoken: "{{ csrf_token }}", - set_open_access: false, - }, - type: "POST", - dataType: "json", - }) + url: "{% url 'longs:exam_json_edit' pk=exam.pk %}", + data: { + csrfmiddlewaretoken: "{{ csrf_token }}", + set_open_access: false, + }, + type: "POST", + dataType: "json", + }) // $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly .done(function (data) { console.log(data); @@ -173,14 +175,14 @@ new_order.push(el.dataset.question_pk) }) $.ajax({ - url: "{% url 'longs:exam_json_edit' pk=exam.pk %}", - data: { - csrfmiddlewaretoken: "{{ csrf_token }}", - set_exam_order: JSON.stringify(new_order), - }, - type: "POST", - dataType: "json", - }) + url: "{% url 'longs:exam_json_edit' pk=exam.pk %}", + data: { + csrfmiddlewaretoken: "{{ csrf_token }}", + set_exam_order: JSON.stringify(new_order), + }, + type: "POST", + dataType: "json", + }) // $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly .done(function (data) { console.log(data);