This commit is contained in:
Ross
2021-02-25 18:02:02 +00:00
parent 67163e85ee
commit f5b61f4488
9 changed files with 68 additions and 7 deletions
+28
View File
@@ -15,4 +15,32 @@
</div>
{% render_table table %}
<script type="text/javascript">
$(document).ready(function () {
$("#button-select-add-exam").click(function () {
$.ajax({
url: "{% url 'rapids:exam_json_edit' pk=exam.pk %}",
data: {
csrfmiddlewaretoken: "{{ csrf_token }}",
add_exam_questions: true,
},
type: "POST",
dataType: "json",
})
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
.done(function (data) {
console.log(data);
if (data.status == "success") {
toastr.info('Questions added to exams.')
}
})
.always(function () {
console.log('[Done]');
})
})
});
</script>
{% endblock %}