diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index d46b7ec4b..d81bf1ced 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -962,8 +962,10 @@ function qmnInit() { jQuery('.qmn-multiple-choice-input, .qsm_dropdown, .qsm-multiple-response-input').change(function () { let $this = jQuery(this); let value = $this.val(); + let quiz_form_id = $this.parents('.qsm-quiz-form').attr('id'); + let quiz_id = quiz_form_id.replace('quizForm', ''); let question_id = $this.attr('name').replace(/question/i, ''); - let data = qsm_question_quick_result_js(question_id, value, '', qmn_quiz_data[key].enable_quick_correct_answer_info,key); + let data = qsm_question_quick_result_js(question_id, value, '', qmn_quiz_data[quiz_id].enable_quick_correct_answer_info,quiz_id); if (data.success == 'correct') { $this.parent().addClass("qmn_correct_answer"); } else if (data.success == 'incorrect') { @@ -1333,7 +1335,7 @@ function qmnInitPagination(quiz_id) { jQuery(document).on('qsm_next_button_click_after qsm_previous_button_click_after', function(event, quiz_id) { let video_sections = jQuery(`.qsm-quiz-container-${quiz_id}.qmn_quiz_container`).find('video'); let iframeVideos = jQuery(`.qsm-quiz-container-${quiz_id}.qmn_quiz_container`).find('iframe'); - + iframeVideos.each(function() { let src = this.src; jQuery(this).attr('src', src);