diff --git a/js/qsm-admin.js b/js/qsm-admin.js index b7b22636..264c1e75 100644 --- a/js/qsm-admin.js +++ b/js/qsm-admin.js @@ -2249,7 +2249,6 @@ var import_button; import_button.attr("onclick", "return confirm('" + qsm_admin_messages.confirm_message + " " + qsm_admin_messages.import_question_again + "');"); } QSMQuestion.openEditPopup(model.id, $('.question[data-question-id=' + model.id + ']').find('.edit-question-button')); - // $('#save-popup-button').trigger('click'); }, addNewQuestion: function (model) { var default_answers = parseInt(qsmQuestionSettings.default_answers); @@ -2770,7 +2769,6 @@ var import_button; } CurrentElement.parents('.question').next('.questionElements').slideDown('slow'); $('#modal-1-content').html(questionElements); - //MicroModal.show( 'modal-1' ); $('.questions').sortable('disable'); $('.page').sortable('disable'); @@ -3786,7 +3784,6 @@ var import_button; .fail(QSMAdmin.displayjQueryError); }, loadResults: function () { - //QSMAdmin.displayAlert( 'Loading results pages...', 'info' ); $.ajax({ url: wpApiSettings.root + 'quiz-survey-master/v1/quizzes/' + qsmResultsObject.quizID + '/results', headers: { 'X-WP-Nonce': qsmResultsObject.nonce }, diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index 3d7c05f9..cb8ba0f2 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -1864,15 +1864,15 @@ jQuery(document).ready(function () { let captchaElement = jQuery('#mlw_code_captcha'); if (captchaElement.length !== 0) { mlw_code = ''; - var mlw_chars = '0123456789ABCDEFGHIJKL!@#$%^&*()MNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'; - var mlw_code_length = 5; - for (var i = 0; i < mlw_code_length; i++) { - var rnum = Math.floor(Math.random() * mlw_chars.length); + let mlw_chars = '0123456789ABCDEFGHIJKL!@#$%^&*()MNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'; + let mlw_code_length = 5; + for (let i = 0; i < mlw_code_length; i++) { + let rnum = Math.floor(Math.random() * mlw_chars.length); mlw_code += mlw_chars.substring(rnum, rnum + 1); } - var captchaCanvas = document.getElementById('mlw_captcha'); - var mlw_captchaCTX = captchaCanvas.getContext('2d'); - var containerDirection = window.getComputedStyle(captchaCanvas).direction || 'ltr'; + let captchaCanvas = document.getElementById('mlw_captcha'); + let mlw_captchaCTX = captchaCanvas.getContext('2d'); + let containerDirection = window.getComputedStyle(captchaCanvas).direction || 'ltr'; mlw_captchaCTX.font = 'normal 24px Verdana'; mlw_captchaCTX.strokeStyle = '#000000'; mlw_captchaCTX.clearRect(0, 0, captchaCanvas.width, captchaCanvas.height);