From 13d741688169b4ffe045b8f5884889d03e8746f7 Mon Sep 17 00:00:00 2001 From: Mohammad Zubair Ali Date: Wed, 8 Nov 2023 17:15:37 +0530 Subject: [PATCH 1/2] release 8.1.9 --- assets/calendar.png | Bin 0 -> 3677 bytes css/admin-dashboard-rtl.css | 107 +------------------- css/admin-dashboard.css | 107 +------------------- css/common-rtl.css | 10 ++ css/common.css | 10 ++ css/qsm-admin.css | 30 +++--- js/qsm-admin.js | 99 ++++-------------- js/qsm-quiz.js | 19 +++- mlw_quizmaster2.php | 5 +- php/admin/admin-dashboard.php | 49 --------- php/admin/admin-results-page.php | 58 +++++++---- php/admin/options-page-contact-tab.php | 6 +- php/admin/options-page-email-tab.php | 3 +- php/admin/options-page-questions-tab.php | 26 ++--- php/admin/options-page-results-page-tab.php | 3 +- php/classes/class-qmn-quiz-manager.php | 22 ++-- php/classes/class-qsm-install.php | 6 +- php/classes/class-qsm-migrate.php | 20 ++-- php/classes/class-qsm-settings.php | 4 +- readme.txt | 10 +- 20 files changed, 163 insertions(+), 431 deletions(-) create mode 100644 assets/calendar.png diff --git a/assets/calendar.png b/assets/calendar.png new file mode 100644 index 0000000000000000000000000000000000000000..1c1baf7c39209929069e0d67a64722bf1c7e5d1e GIT binary patch literal 3677 zcmV-j4x;giP)X+uL$Nkc;* zP;zf(X>4Tx07!|IR|i;A$rhell8`_M5I{gm=uHr*0i=Y`0!S}{jgSNgCB%fFVn-Jh zT)SAnhOUYzc0lZiokg)>Uo5C7>teyKyh#CF_m%I>_syOE{&VI(XU?6u_YMHG6I`)4 z57h!7UsNcG4+~<9PEBKwo&o|e1T9|E#l}VfSO(g^mv=V+B5$uc$+iC3|6hwX zUm)cHfW$(a!I$##AwB>AUd0nj3IQO>dCN(KVmXEt=t^LK5YLz6EG4dz;|wL;VmoLfhFGr8%=kek z>u;JFgPL4!)*x2SMN!m(g;H@Icgp{nj{jZq^JD`)Y+%*MmW0R4=M3|9Gq)g8jx`|e z5oJWjK&%7t2O(c!4>3x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#)_P8`}>>9BOXzZ8~_^`S7+Q=0_@z>K$EtjB;%5vHs)5 z$NNr*PxPG3I{B!1Li3$dqfcFHiEC*)9eMiPnb0$*&a%!PKj(Mu$a$ahhb}NLG+gw& zSl{Z=dhmCT-w(EVw$)$qy3}~t`*KtJ$o6Ab0ZRSw1Ahhn)!I9{x9gSU zRsZXSZw%jTd+YwTxi7Zw{=58lpWl~#F#NFnBlF|gPbr_CexCG&^kwx|`>##kBEQ}3 z&+qRSb0u8GuK)%snwbf}>umr~QvsmE^BHA~^8BYLi1N&;K;S=NOU~I9JLG5uO7!hJ4M)&jA0XD9@Zf#Qk#% z8DTbsv`==~hpkjbyboz^@;}f` zY8l0D8&d6~#6G^|s=1ZH(sA)sfc3v>85aIA; v@I?1~yp.qsm-time-up-text { footer.qsm-popup__footer { text-align: center; + padding: 10px; } footer.qsm-popup__footer button.qsm-popup-secondary-button { @@ -403,4 +405,12 @@ div .qsm-results-page .qmn_image_option { -webkit-transition: background .25s ease-out; -moz-transition: background .25s ease-out; transition: background .25s ease-out; +} +.qsm-result-page-warning { + color: #842029; + background-color: #f8d7da; + border-color: #f5c2c7; + padding: 1rem; + border-radius: 0.25rem; + margin-bottom: 1rem; } \ No newline at end of file diff --git a/css/common.css b/css/common.css index 0cbe075d3..73f0ba971 100644 --- a/css/common.css +++ b/css/common.css @@ -214,6 +214,7 @@ body .qsm-popup .qsm-popup__btn { padding-top: 10px; padding-bottom: 10px; } +body #modal-3.qsm-popup .qsm-popup__content, body .qsm-popup__content { text-align: center; } @@ -229,6 +230,7 @@ body .qsm-popup__content > p.qsm-time-up-text { } footer.qsm-popup__footer { text-align: center; + padding: 10px; } footer.qsm-popup__footer button.qsm-popup-secondary-button { background-color: #808080 !important; @@ -626,4 +628,12 @@ body .ui-tooltip.ui-widget-content { -webkit-transition: background .25s ease-out; -moz-transition: background .25s ease-out; transition: background .25s ease-out; +} +.qsm-result-page-warning { + color: #842029; + background-color: #f8d7da; + border-color: #f5c2c7; + padding: 1rem; + border-radius: 0.25rem; + margin-bottom: 1rem; } \ No newline at end of file diff --git a/css/qsm-admin.css b/css/qsm-admin.css index 45fcead14..e6c4e3258 100644 --- a/css/qsm-admin.css +++ b/css/qsm-admin.css @@ -799,6 +799,7 @@ ul.changelog li.update div.two:before { flex-direction: row; flex-wrap: wrap; align-items: stretch; + border-bottom: 1px solid #cecece; } .qsm-sub-text-tab-menu { display: inline-block; @@ -852,7 +853,8 @@ ul.changelog li.update div.two:before { box-sizing: border-box; border-left: 1px solid #dfd4d4; } -.quiz_text_tab_content .right-bar .quiz_style_tab_content .form-table th { +.quiz_text_tab_content .right-bar .quiz_style_tab_content .form-table th, +.quiz_style_tab_content .form-table th { width: 250px; } .quiz_text_tab_content .left-bar ul { @@ -891,10 +893,6 @@ ul.changelog li.update div.two:before { display: inline-block; box-sizing: border-box; } -.qsm_tab_content .subsubsub li { - border-left: 2px solid #aaa; - padding: 0 5px; -} .qsm_tab_content .subsubsub li:first-child { border-left: 0; padding-left: 0; @@ -902,7 +900,7 @@ ul.changelog li.update div.two:before { .qsm_tab_content .subsubsub li a { font-size: 14px; line-height: 1.2; - padding: 0; + padding: 10px; } .qsm_tab_content a:hover, .qsm_tab_content a:focus { @@ -910,6 +908,9 @@ ul.changelog li.update div.two:before { text-decoration: none; box-shadow: none; } +.qsm_tab_content .subsubsub li a.current{ + border-bottom: 3px solid #00BEE9; +} /* Popup */ .qsm-popup { font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif; @@ -1183,11 +1184,11 @@ h3.addon_category_name { .qsm_tab_content input[name="question_limit_key[]"] { max-width: 150px; min-width: 150px; -} +} .qsm_tab_content .question_limit_category { max-width: 200px; min-width: 200px; -} +} .qsm_tab_content textarea { background: #ffffff none repeat scroll 0 0; border: 1px solid #dddddd; @@ -1320,11 +1321,10 @@ span.qsm-ph_text { display: inline-block; } tr .qsm-opt-desc { - color: #666; - font-style: italic; - font-size: 14px; - margin-top: 5px; - display: block; + color: #646970; + margin-top: 5px; + display: block; + font-size: 14px; } .form-table .send_email .qsm-opt-tr, .form-table .send_email td { padding-top: 0; @@ -2994,7 +2994,7 @@ input#duplicate_questions { display: flex; flex-direction: row; justify-content: space-between; - flex-wrap: wrap; + flex-wrap: wrap; align-items: center; background: #ffffff; border-top: 1px solid #DADADA; @@ -3004,7 +3004,7 @@ input#duplicate_questions { } .option-page-result-page-tab-footer .result-tab-footer-buttons { display: flex; - flex-direction: row; + flex-direction: row; } .option-page-result-page-tab-footer .footer-bar-notice { display: flex; diff --git a/js/qsm-admin.js b/js/qsm-admin.js index b1459ba50..3e0578e9f 100644 --- a/js/qsm-admin.js +++ b/js/qsm-admin.js @@ -192,13 +192,13 @@ var QSMAdmin; if (confirm(qsm_admin_messages.confirm_message)) { var action = 'qsm_dashboard_delete_result'; var result_id = jQuery(this).data('result_id'); - $.post(ajaxurl, { result_id: result_id, action: action }, - function (data) { - if (data == 'failed') { - alert(qsm_admin_messages.error_delete_result); - } else { + $.post(ajaxurl, { result_id: result_id, action: action, nonce: wpApiSettings.nonce }, + function (response) { + if (response.success) { $this.parents('li').slideUp(); $this.parents('li').remove(); + } else { + alert(qsm_admin_messages.error_delete_result); } } ); @@ -220,37 +220,8 @@ var QSMAdmin; heightStyle: "content" }); jQuery('#accordion h3.ui-accordion-header').next().slideDown(); - jQuery('.template-list .template-list-inner:first-child').trigger('click'); } }); - //Get quiz options - jQuery('.template-list-inner').click(function () { - var action = 'qsm_wizard_template_quiz_options'; - var settings = jQuery(this).data('settings'); - var addons = jQuery(this).data('addons'); - jQuery('.template-list .template-list-inner').removeClass('selected-quiz-template'); - jQuery(this).addClass('selected-quiz-template'); - jQuery('#quiz_settings_wrapper').html('').html('
'); - jQuery('#recomm_addons_wrapper').html('').html('
'); - $.post(ajaxurl, { settings: settings, addons: addons, action: action }, - function (data) { - var diff_html = data.split('====='); - jQuery('#quiz_settings_wrapper').html(''); - jQuery('#quiz_settings_wrapper').html(diff_html[0]); - jQuery('#recomm_addons_wrapper').html(''); - jQuery('#recomm_addons_wrapper').html(diff_html[1]); - jQuery("#accordion").accordion(); - jQuery('#accordion h3.ui-accordion-header').next().slideDown(); - $('#quiz_settings_wrapper select').each(function () { - var name = $(this).attr('name'); - var value = $(this).val(); - if ($('.' + name + '_' + value).length > 0) { - $('.' + name + '_' + value).show(); - } - }); - } - ); - }); //Dismiss the welcome panel jQuery('.qsm-welcome-panel-dismiss').click(function (e) { @@ -875,38 +846,7 @@ if(current_id == 'qsm_variable_text'){ jQuery(".current_variable")[0].click();} jQuery('.template-list .template-list-inner:first-child').trigger('click'); } }); - //Get quiz options - $('.template-list-inner').click(function () { - var action = 'qsm_wizard_template_quiz_options'; - var settings = $(this).data('settings'); - var addons = $(this).data('addons'); - $('.template-list .template-list-inner').removeClass('selected-quiz-template'); - $(this).addClass('selected-quiz-template'); - $('#quiz_settings_wrapper').html('').html('
'); - $('#recomm_addons_wrapper').html('').html('
'); - $.post(ajaxurl, { - settings: settings, - addons: addons, - action: action - }, - function (data) { - var diff_html = data.split('====='); - $('#quiz_settings_wrapper').html(''); - $('#quiz_settings_wrapper').html(diff_html[0]); - $('#recomm_addons_wrapper').html(''); - $('#recomm_addons_wrapper').html(diff_html[1]); - $("#accordion").accordion(); - $('#accordion h3.ui-accordion-header').next().slideDown(); - $('#quiz_settings_wrapper select').each(function () { - var name = $(this).attr('name'); - var value = $(this).val(); - if ($('.' + name + '_' + value).length > 0) { - $('.' + name + '_' + value).show(); - } - }); - } - ); - }); + $('#show_import_export_popup').on('click', function (event) { event.preventDefault(); MicroModal.show('modal-export-import'); @@ -1137,14 +1077,6 @@ if(current_id == 'qsm_variable_text'){ jQuery(".current_variable")[0].click();} $(document).find('#select_themes .theme-actions').remove(); - $(document).on('click', '#new_quiz_button', function () { - $('#quiz_settings').find('.qsm-opt-desc').each(function () { - if ($(this)) { - desc = $(this); - desc.parents('.input-group').find('label:first-child').append(desc); - } - }) - }); } }(jQuery)); @@ -1170,12 +1102,12 @@ if(current_id == 'qsm_variable_text'){ jQuery(".current_variable")[0].click();} url: ajaxurl, data: { action: 'enable_multiple_categories', - value: 'enable' + value: 'enable', + nonce: wpApiSettings.nonce }, - success: function (r) { - response = JSON.parse(r); + success: function (response) { clearInterval(category_interval); - if (response.status) { + if (response.success) { $('.category-action').parents('.multiple-category-notice').removeClass('notice-info').addClass('notice-success').html('

' + qsm_admin_messages.update_db_success + '

'); } else { $('.category-action').parents('.multiple-category-notice').removeClass('notice-info').addClass('notice-error').html(qsm_admin_messages.error + '! ' + qsm_admin_messages.try_again); @@ -1193,10 +1125,11 @@ if(current_id == 'qsm_variable_text'){ jQuery(".current_variable")[0].click();} url: ajaxurl, data: { action: 'enable_multiple_categories', - value: 'cancel' + value: 'cancel', + nonce: wpApiSettings.nonce }, - success: function (status) { - if (status) { + success: function (response) { + if (response.success) { $('.multiple-category-notice').hide(); } } @@ -1446,7 +1379,7 @@ var QSMContact; $(document).on('change', '.show-disabled-fields', function (event) { event.preventDefault(); var is_show = $(this).prop('checked'); - jQuery.post(ajaxurl, { action: 'qsm_show_disabled_contact_fields', show: is_show }); + jQuery.post(ajaxurl, { action: 'qsm_show_disabled_contact_fields', show: is_show, 'nonce': qsmContactObject.saveNonce, 'quiz_id': qsmContactObject.quizID }); if (is_show) { $('.contact-form-field').removeClass('hidden-field'); } else { @@ -1524,6 +1457,7 @@ var QSMContact; }) .done(function (results) { if (results.status) { + jQuery(document).trigger('qsm_after_save_email'); QSMAdmin.displayAlert(qsm_admin_messages.emails_saved, 'success'); } else { QSMAdmin.displayAlert(qsm_admin_messages.emails_save_error + ' ' + qsm_admin_messages.try_again, 'error'); @@ -3257,6 +3191,7 @@ var import_button; var new_category_data = { action: 'save_new_category', name: new_category, + nonce: qsmQuestionSettings.saveNonce, parent: parent_category }; $('#modal-9-content .info').html(''); diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index 591a54aee..e5bfae2fc 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -25,6 +25,7 @@ var qsmTimerInterval = []; let quizID = parseInt(quiz.quiz_id); if ( null == localStorage.getItem('mlw_quiz_start_date' + quizID) ) { localStorage.setItem('mlw_quiz_start_date' + quizID, qmn_ajax_object.start_date); + localStorage.setItem('mlw_time_consumed_quiz' + quizID, 1); } jQuery.ajax({ url: qmn_ajax_object.ajaxurl, @@ -129,14 +130,17 @@ var qsmTimerInterval = []; var seconds = 0; // Calculates starting time. + var timerTotal = parseFloat(qmn_quiz_data[quizID].timer_limit) * 60; var timerStarted = localStorage.getItem('mlw_started_quiz' + quizID); - var timerRemaning = localStorage.getItem('mlw_time_quiz' + quizID); + var timerConsumed = parseInt(localStorage.getItem('mlw_time_consumed_quiz' + quizID)); + var timerRemaning = timerTotal - timerConsumed; if ('yes' == timerStarted && 0 < timerRemaning) { seconds = parseInt(timerRemaning); } else { seconds = parseFloat(qmn_quiz_data[quizID].timer_limit) * 60; } qmn_quiz_data[quizID].timerRemaning = seconds; + qmn_quiz_data[quizID].timerConsumed = timerConsumed; //hidden timer jQuery(".hiddentimer").html(seconds); @@ -159,10 +163,12 @@ var qsmTimerInterval = []; */ timer: function (quizID) { qmn_quiz_data[quizID].timerRemaning -= 1; + qmn_quiz_data[quizID].timerConsumed += 1; if (0 > qmn_quiz_data[quizID].timerRemaning) { qmn_quiz_data[quizID].timerRemaning = 0; } var secondsRemaining = qmn_quiz_data[quizID].timerRemaning; + var secondsConsumed = qmn_quiz_data[quizID].timerConsumed; var display = QSM.secondsToTimer(secondsRemaining); var systemTime = new Date().getTime() / 1000; systemTime = Math.round(systemTime); @@ -171,6 +177,7 @@ var qsmTimerInterval = []; return false; } // Sets our local storage values for the timer being started and current timer value. + localStorage.setItem('mlw_time_consumed_quiz' + quizID, secondsConsumed ); localStorage.setItem('mlw_time_quiz' + quizID, secondsRemaining); localStorage.setItem('mlw_started_quiz' + quizID, "yes"); @@ -231,6 +238,7 @@ var qsmTimerInterval = []; endTimer: function (quizID) { localStorage.setItem('mlw_time_quiz' + quizID, 'completed'); localStorage.setItem('mlw_started_quiz' + quizID, 'no'); + localStorage.removeItem('mlw_time_consumed_quiz' + quizID); document.title = qsmTitleText; if (typeof qmn_quiz_data[quizID].timerInterval != 'undefined') { clearInterval(qmn_quiz_data[quizID].timerInterval); @@ -382,8 +390,9 @@ var qsmTimerInterval = []; // Calculates starting time. let timerStarted = localStorage.getItem('mlw_started_quiz' + quizID); - let timerRemaning = localStorage.getItem('mlw_time_quiz' + quizID); + let timerConsumed = parseInt(localStorage.getItem('mlw_time_consumed_quiz' + quizID)); let seconds = parseFloat(qmn_quiz_data[quizID].timer_limit) * 60; + let timerRemaning = seconds - timerConsumed; if ('yes' == timerStarted && 0 < timerRemaning) { seconds = parseInt(timerRemaning); } @@ -1234,7 +1243,7 @@ function qmnNextSlide(pagination, go_to_top, quiz_form_id) { if (qmn_quiz_data[quiz_id].contact_info_location == 1) { $container.find(".qsm-submit-btn").hide(); $container.find(".mlw_next").show(); - } + } } $container.find('.qsm-auto-page-row.qsm-apc-' + page_number).show(); $container.find('.slide_number_hidden').val(parseInt(slide_number) + 1); @@ -1838,9 +1847,9 @@ function qsm_submit_quiz_if_answer_wrong(question_id, value, $this, $quizForm, a } function qsm_question_quick_result_js(question_id, answer, answer_type = '', show_correct_info = '',quiz_id='') { - + if (typeof encryptedData[quiz_id] !== 'undefined') { - + let decryptedBytes = CryptoJS.AES.decrypt(encryptedData[quiz_id], encryptionKey[quiz_id]); let decryptedData = decryptedBytes.toString(CryptoJS.enc.Utf8); let decrypt = JSON.parse(decryptedData); diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index f0b958e11..e67e1c8c0 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -2,7 +2,7 @@ /** * Plugin Name: Quiz And Survey Master * Description: Easily and quickly add quizzes and surveys to your website. - * Version: 8.1.18 + * Version: 8.1.19 * Author: ExpressTech * Author URI: https://quizandsurveymaster.com/ * Plugin URI: https://expresstech.io/ @@ -43,7 +43,7 @@ class MLWQuizMasterNext { * @var string * @since 4.0.0 */ - public $version = '8.1.18'; + public $version = '8.1.19'; /** * QSM Alert Manager Object @@ -361,6 +361,7 @@ public function qsm_admin_scripts_style( $hook ) { wp_enqueue_script( 'jquery-ui-tabs' ); wp_enqueue_script( 'jquery-effects-blind' ); wp_enqueue_script( 'jquery-effects-explode' ); + wp_enqueue_media(); break; default: wp_enqueue_editor(); diff --git a/php/admin/admin-dashboard.php b/php/admin/admin-dashboard.php index c8b52e634..53dd064c3 100644 --- a/php/admin/admin-dashboard.php +++ b/php/admin/admin-dashboard.php @@ -277,55 +277,6 @@ function qsm_generate_dashboard_page() { qsm_create_new_quiz_wizard(); } -/** - * @since 7.0 - * @global Obj $mlwQuizMasterNext - * Generate the post settings and required plugin in popup - */ -function qsm_wizard_template_quiz_options() { - global $mlwQuizMasterNext; - $settings = isset( $_POST['settings'] ) ? qsm_sanitize_rec_array( wp_unslash( $_POST['settings'] ) ) : array(); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized - $addons = isset( $_POST['addons'] ) ? qsm_sanitize_rec_array( wp_unslash( $_POST['addons'] ) ) : array(); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized - $all_settings = $mlwQuizMasterNext->quiz_settings->load_setting_fields( 'quiz_options' ); - $recommended_addon_str = ''; - if ( $settings ) { - foreach ( $settings as $key => $single_setting ) { - $key = array_search( $key, array_column( $all_settings, 'id' ), true ); - $field = $all_settings[ $key ]; - $field['label'] = $single_setting['option_name']; - $field['default'] = $single_setting['value']; - QSM_Fields::generate_field( $field, $single_setting['value'] ); - } - } else { - esc_html_e( 'No settings are found!', 'quiz-master-next' ); - } - echo '====='; - if ( $addons ) { - $recommended_addon_str .= ''; - } else { - $recommended_addon_str .= __( 'No addons are found!', 'quiz-master-next' ); - } - echo wp_kses_post( $recommended_addon_str ); - exit; -} -add_action( 'wp_ajax_qsm_wizard_template_quiz_options', 'qsm_wizard_template_quiz_options' ); - /** * @since 7.0 * @param str $widget_id diff --git a/php/admin/admin-results-page.php b/php/admin/admin-results-page.php index 3fda0d296..79056ad39 100644 --- a/php/admin/admin-results-page.php +++ b/php/admin/admin-results-page.php @@ -297,6 +297,7 @@ function qsm_results_overview_tab_content() { if ( isset( $_POST["results-screen_option_nonce"] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST["results-screen_option_nonce"] ) ), 'results_screen_option' ) ) { $results_screen_option['page_url'] = isset( $_POST['page_url'] ) ? sanitize_text_field( wp_unslash( $_POST['page_url'] ) ) : "0"; $results_screen_option['page_name'] = isset( $_POST['page_name'] ) ? sanitize_text_field( wp_unslash( $_POST['page_name'] ) ) : "0"; + $results_screen_option['view_result_page'] = isset( $_POST['view_result_page'] ) ? sanitize_text_field( wp_unslash( $_POST['view_result_page'] ) ) : "0"; $results_screen_option['business'] = isset( $_POST['business'] ) ? sanitize_text_field( wp_unslash( $_POST['business'] ) ) : "0"; $results_screen_option['phone'] = isset( $_POST['phone'] ) ? sanitize_text_field( wp_unslash( $_POST['phone'] ) ) : "0"; $results_screen_option['ip_address'] = isset( $_POST['ip_address'] ) ? sanitize_text_field( wp_unslash( $_POST['ip_address'] ) ) : "0"; @@ -307,15 +308,15 @@ function qsm_results_overview_tab_content() { } else { $results_screen_option = get_user_meta( $user_id, 'results_screen_option', true ); $results_screen_option = ! empty( $results_screen_option ) ? $results_screen_option : ''; - if ( empty( $results_screen_option ) ) { - $results_screen_option = array( - 'page_url' => '0', - 'page_name' => '0', - 'business' => '1', - 'phone' => '1', - 'ip_address' => '1', - ); - } + $default_results_screen_option = array( + 'page_url' => '0', + 'view_result_page' => '0', + 'page_name' => '0', + 'business' => '1', + 'phone' => '1', + 'ip_address' => '1', + ); + $results_screen_option = wp_parse_args( $results_screen_option, $default_results_screen_option ); if ( ! isset( $results_screen_option['start_date'] ) ) { $results_screen_option['start_date'] = "0"; } @@ -332,18 +333,19 @@ function qsm_results_overview_tab_content() { wp_nonce_field( 'bulk_delete', 'bulk_delete_nonce' ); $th_elements = apply_filters( 'mlw_qmn_admin_results_page_headings', array( - 'score' => __( 'Score', 'quiz-master-next' ), - 'time_complete' => __( 'Time To Complete', 'quiz-master-next' ), - 'name' => __( 'Name', 'quiz-master-next' ), - 'business' => __( 'Business', 'quiz-master-next' ), - 'email' => __( 'Email', 'quiz-master-next' ), - 'phone' => __( 'Phone', 'quiz-master-next' ), - 'user' => __( 'User', 'quiz-master-next' ), - 'start_date' => __( 'Start Date', 'quiz-master-next' ), - 'time_taken' => __( 'End Date', 'quiz-master-next' ), - 'ip' => __( 'IP Address', 'quiz-master-next' ), - 'page_name' => __( 'Page Name', 'quiz-master-next' ), - 'page_url' => __( 'Page URL', 'quiz-master-next' ), + 'score' => __( 'Score', 'quiz-master-next' ), + 'time_complete' => __( 'Time To Complete', 'quiz-master-next' ), + 'name' => __( 'Name', 'quiz-master-next' ), + 'business' => __( 'Business', 'quiz-master-next' ), + 'email' => __( 'Email', 'quiz-master-next' ), + 'phone' => __( 'Phone', 'quiz-master-next' ), + 'user' => __( 'User', 'quiz-master-next' ), + 'start_date' => __( 'Start Date', 'quiz-master-next' ), + 'time_taken' => __( 'End Date', 'quiz-master-next' ), + 'ip' => __( 'IP Address', 'quiz-master-next' ), + 'page_name' => __( 'Page Name', 'quiz-master-next' ), + 'page_url' => __( 'Page URL', 'quiz-master-next' ), + 'view_result_page' => __( 'Result Page', 'quiz-master-next'), ) ); $values = $quiz_infos = []; @@ -374,6 +376,9 @@ function qsm_results_overview_tab_content() { if ( "0" === $results_screen_option['time_taken'] ) { $values['time_taken']['style'] = $display_none; } + if ( "0" === $results_screen_option['view_result_page'] ) { + $values['view_result_page']['style'] = $display_none; + } if ( ! class_exists( 'QSM_Proctoring_Quiz' ) ) { $proctor_class = "qsm-quiz-proctor-addon"; }else { @@ -480,8 +485,13 @@ function qsm_results_overview_tab_content() { } $values['page_url']['content'][] = '' . esc_html( $quiz_page_url ) . ''; } + if ( isset( $values['view_result_page']) ) { + $quiz_page_url = $mlw_quiz_info->page_url; + $unique_id = $mlw_quiz_info->unique_id; + $values['view_result_page']['content'][] = '' . esc_html__( 'View', 'quiz-master-next' ) . ''; + } foreach ( $values as $k => $v ) { - if ( ! in_array( $k, [ 'score', 'time_complete', 'name', 'business', 'email', 'phone', 'user', 'time_taken', 'ip', 'page_name', 'page_url' ], true ) ) { + if ( ! in_array( $k, [ 'score', 'time_complete', 'name', 'business', 'email', 'phone', 'user', 'time_taken', 'ip', 'page_name', 'page_url', 'view_result_page' ], true ) ) { $content = apply_filters( 'mlw_qmn_admin_results_page_column_content', '', $mlw_quiz_info, $k ); if ( isset( $values[ $k ] ) && ! empty( $content ) ) { $values[ $k ]['content'][] = $content; @@ -558,6 +568,10 @@ function qsm_results_overview_tab_content() { /> +