.
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% render_table table %}
|
{% render_table table %}
|
||||||
|
|
||||||
<button id="button-select-add-exam" data-exam_list_url="{% url 'generic:rapid-exams-list' %}">Add selected questions to
|
<button id="button-select-add-exam" data-exam_json_edit_url="{% url 'generic:generic_exam_json_edit' %}" data-exam_list_url="{% url 'generic:rapid-exams-list' %}" data-type="rapid">Add selected questions to
|
||||||
exam</button>
|
exam</button>
|
||||||
<div id="exam-options"></div>
|
<div id="exam-options"></div>
|
||||||
|
|
||||||
@@ -56,12 +56,14 @@
|
|||||||
$("table input:checked").each((n, el) => {
|
$("table input:checked").each((n, el) => {
|
||||||
ids.push(el.value)
|
ids.push(el.value)
|
||||||
})
|
})
|
||||||
|
post_url = document.getElementById("button-select-add-exam").dataset.exam_json_edit_url;
|
||||||
|
type = document.getElementById("button-select-add-exam").dataset.type;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "{% url 'generic:generic_exam_json_edit' %}",
|
url: post_url,
|
||||||
data: {
|
data: {
|
||||||
csrfmiddlewaretoken: "{{ csrf_token }}",
|
csrfmiddlewaretoken: "{{ csrf_token }}",
|
||||||
add_exam_questions: JSON.stringify(ids),
|
add_exam_questions: JSON.stringify(ids),
|
||||||
type: "rapid",
|
type: type,
|
||||||
exam_id: $(evt.target).data("exam-id"),
|
exam_id: $(evt.target).data("exam-id"),
|
||||||
},
|
},
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
|||||||
Reference in New Issue
Block a user