This commit is contained in:
Ross
2021-07-10 10:36:49 +01:00
parent bf9dc2bb15
commit 807f60abca
2 changed files with 84 additions and 4 deletions
+7
View File
@@ -78,6 +78,7 @@ $(document).ready(function () {
var jqxhr = $.get(evt.target.dataset.exam_list_url, function (data) {
console.log(data);
$("#exam-options").empty();
data.forEach((obj, n) => {
$("#exam-options").append($(document.createElement('button')).prop({
type: 'button',
@@ -106,6 +107,12 @@ $(document).ready(function () {
$("table input:checked").each((n, el) => {
ids.push(el.value)
})
// if no question selected
if (ids.length < 1) {
toastr.info('No question selected.');
return
}
let post_url = document.getElementById("button-select-add-exam").dataset.exam_json_edit_url;
let type = document.getElementById("button-select-add-exam").dataset.type;
let csrf = document.getElementById("button-select-add-exam").dataset.csrf;