From 3163d203c3d712cd19fb3f139dd5f9c156653259 Mon Sep 17 00:00:00 2001 From: Mohammad Zubair Ali Date: Thu, 14 Dec 2023 13:04:34 +0530 Subject: [PATCH 1/5] merge with dev code --- js/qsm-admin.js | 7 ++-- mlw_quizmaster2.php | 1 + php/admin/admin-results-page.php | 2 +- php/classes/class-qmn-plugin-helper.php | 1 + php/classes/class-qsm-install.php | 12 +++++- php/question-types/qsm-question-title.php | 4 +- .../qsm-question-type-dropdown.php | 38 +++++++++++-------- .../qsm-tempvar-question-answers.php | 2 + readme.txt | 3 +- 9 files changed, 47 insertions(+), 23 deletions(-) diff --git a/js/qsm-admin.js b/js/qsm-admin.js index d9e849475..e7b6bba3f 100644 --- a/js/qsm-admin.js +++ b/js/qsm-admin.js @@ -2097,7 +2097,7 @@ var import_button; }); model.set('answers', answers); model.set('required', required); - + jQuery(document).trigger('qsm_save_question_before', [questionID, CurrentElement, model, advanced_option]); $('.questionElements .advanced-content > .qsm-row:not(.core-option)').each(function () { if ($(this).find('input[type="text"]').length > 0) { $($(this).find('input[type="text"]')).each(function () { @@ -2428,6 +2428,7 @@ var import_button; $('#match-answer').val(value); } }); + jQuery(document).trigger('qsm_all_question_setting_after', [all_setting]); } CurrentElement.parents('.question').next('.questionElements').slideDown('slow'); $('#modal-1-content').html(questionElements); @@ -2758,6 +2759,7 @@ var import_button; QSMQuestion.saveQuestion($(this).parents('.questionElements').children('#edit_question_id').val(), $(this)); $('.save-page-button').trigger('click'); $('#modal-1-content').html(model_html); + jQuery(document).trigger('qsm_save_popup_button_after', [questionElements]); }); $(document).on('click', '#new-answer-button', function (event) { event.preventDefault(); @@ -2996,10 +2998,9 @@ var import_button; if ('image' === answerType) { $('#image_size_area').show(); } + jQuery(document).trigger('qsm_question_type_change_after', [question_val]); }); - - //Add new category $(document).on('click', '#qsm-category-add-toggle', function () { if ($('#qsm-category-add').is(":visible")) { diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index 1d4e9d0d5..7309e7a1e 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -450,6 +450,7 @@ public function qsm_admin_scripts_style( $hook ) { 'add_more' => __("Add", 'quiz-master-next'), '_X_validation_fails' => __("Please enter an appropriate value for 'X'", 'quiz-master-next'), ); + $qsm_admin_messages = apply_filters( 'qsm_admin_messages_after', $qsm_admin_messages ); wp_localize_script( 'qsm_admin_js', 'qsm_admin_messages', $qsm_admin_messages ); } diff --git a/php/admin/admin-results-page.php b/php/admin/admin-results-page.php index 6feda6700..26ce2278e 100644 --- a/php/admin/admin-results-page.php +++ b/php/admin/admin-results-page.php @@ -570,7 +570,7 @@ function qsm_results_overview_tab_content() {