diff --git a/css/common.css b/css/common.css index a2d935570..79357c6fa 100644 --- a/css/common.css +++ b/css/common.css @@ -175,7 +175,7 @@ body .qsm-popup__btn-primary { border-radius: 0; height: 20px; } -.question-type-polar-s .ui-widget-content .ui-slider-handle { +.question-type-polar-s .ui-widget-content .ui-slider-handle { background: rgb(119, 113, 113); height: 32px; border-color: rgb(119, 113, 113); @@ -194,9 +194,6 @@ body .qsm-popup__btn-primary { .qsm-deselect-answer { float: right; } -.qsm-popup__close { - text-decoration: none !important; -} .qsm-popup__btn-primary { margin-right: 30px; } @@ -273,6 +270,9 @@ footer.qsm-popup__footer button.qsm-popup-secondary-button:hover { display: block; margin-bottom: 10px; } +.qsm-quiz-container .quiz_section .qsm-align-fill-in-blanks:not(.qsm_remove_bold) { + display: inline-block; +} .quiz_section iframe { width: 100% !important; min-height: 315px !important; @@ -428,6 +428,10 @@ body .qsm-results-page .mlw_qmn_question .qmn_image_option:before { display: inline-block; cursor: pointer; } +.qsm-quiz-form .mlw_answer_open_text, +.qsm-quiz-form .mlw_answer_number{ + margin-bottom: 10px; +} @media screen and (max-width: 767px) { .question-type-polar-s .left-polar-title, .question-type-polar-s .slider-main-wrapper, @@ -547,8 +551,8 @@ body .ui-tooltip.ui-widget-content { border-bottom: 1px solid #808080; padding-bottom: 25px; } -.qmn_btn, -.qsm-quiz-container.qmn_quiz_container .qmn_btn, +.qmn_btn, +.qsm-quiz-container.qmn_quiz_container .qmn_btn, .qsm-quiz-container.qmn_quiz_container .btn { position: relative; display: inline-block; diff --git a/css/qsm-admin-question.css b/css/qsm-admin-question.css index 094e08df0..1a079b0c1 100644 --- a/css/qsm-admin-question.css +++ b/css/qsm-admin-question.css @@ -119,7 +119,7 @@ min-width: 45%; padding: 8px 15px; } -.page-footer a.button .dashicons, +.page-footer a.button .dashicons, .new-answer-button a#new-answer-button .dashicons { line-height: 32px; } @@ -134,13 +134,7 @@ text-decoration: none; } .page-header-buttons { - display: flex; - width: 100%; - justify-content: space-around; - align-content: center; - align-items: center; - flex-wrap: wrap; - flex-direction: row; + text-align: right; } .question, .question-bank-question { box-sizing: border-box; diff --git a/css/qsm-admin.css b/css/qsm-admin.css index 58ecf83d8..e9532d3e9 100644 --- a/css/qsm-admin.css +++ b/css/qsm-admin.css @@ -2293,6 +2293,7 @@ input#question_search::-webkit-search-cancel-button { align-items: center; flex-wrap: nowrap; flex-direction: row; + max-width: calc(100% - 275px); } .qsm-quiz-nav-bar .qsm-quiz-heading .qsm_quiz_title { padding: 0; @@ -3007,3 +3008,17 @@ input#duplicate_questions { font-size: 10px; } } +@media screen and (max-width: 767px) { + .qsm-quiz-nav-bar .qsm-quiz-heading{ + max-width: 100%; + } + .qsm-quiz-nav-bar .qsm-quiz-top-nav-links{ + justify-content: flex-end; + width: 100%; + } + .mlw_quiz_options .button-primary{ + padding: 0px 5px; + font-size: 12px; + min-height: 35px; + } +} \ No newline at end of file diff --git a/js/qsm-admin.js b/js/qsm-admin.js index 4766a4cdf..501405802 100644 --- a/js/qsm-admin.js +++ b/js/qsm-admin.js @@ -1454,6 +1454,7 @@ var QSMContact; 'operator': operator, 'value': value })); + jQuery(document).trigger('qsm_after_add_email_condition', [$email, category, criteria, operator, value]); }, newCondition: function ($email) { QSMAdminEmails.addCondition($email, '', 'score', 'equal', 0); @@ -1758,7 +1759,7 @@ var import_button; //Create Default pages and one question. if (qsmQuestionSettings.pages.length == 0 && QSMQuestion.questions.length == 0) { $('.new-page-button').trigger('click'); - $('.questions .new-question-button').trigger('click'); + $('.questions .new-question-button:eq("1")').trigger('click'); } QSMQuestion.countTotal(); }, @@ -3264,6 +3265,7 @@ var import_button; 'operator': operator, 'value': value })); + jQuery(document).trigger('qsm_after_add_result_condition', [$page, category, criteria, operator, value]); }, newCondition: function ($page) { QSMAdminResults.addCondition($page, '', 'score', 'equal', 0); diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index e289a955d..af44f9784 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -787,7 +787,7 @@ function qmnValidation(element, quiz_form_id) { var error_messages = qmn_quiz_data[quiz_id].error_messages; qmnResetError(quiz_form_id); jQuery(element).each(function () { - if ( jQuery(this).attr('class') && jQuery(this).is(':visible') ) { + if ( jQuery(this).attr('class') && ( jQuery(this).is(':visible') || ( jQuery(this).attr('class').indexOf('mlwRequiredPolar') > -1 && jQuery(this).parent().is(':visible') ) ) ) { if (jQuery(this).attr('class').indexOf('mlwEmail') !== -1 && this.value !== "") { // Remove any trailing and preceeding space. var x = jQuery.trim(this.value); @@ -1453,42 +1453,62 @@ jQuery(function () { }); }); - jQuery(document).on('change', '.qmn_radio_answers input', function (e) { + jQuery(document).on('change', '.qmn_radio_answers input' , function (e) { var quizID = jQuery(this).parents('.qsm-quiz-container').find('.qmn_quiz_id').val(); if (qmn_quiz_data[quizID].enable_quick_result_mc == 1) { - var question_id = jQuery(this).attr('name').split('question')[1], - value = jQuery(this).val(), - $this = jQuery(this).parents('.quiz_section'); - jQuery.ajax({ - type: 'POST', - url: qmn_ajax_object.ajaxurl, - data: { - action: "qsm_get_question_quick_result", - question_id: question_id, - answer: value, - show_correct_info: qmn_quiz_data[quizID].enable_quick_correct_answer_info - }, - success: function (response) { - var data = jQuery.parseJSON(response); - $this.find('.quick-question-res-p').remove(); - $this.find('.qsm-inline-correct-info').remove(); - if (data.success == 'correct') { - $this.append('
' + qmn_quiz_data[quizID].quick_result_correct_answer_text + '
') - $this.append('
' + data.message + '
'); - } else if (data.success == 'incorrect') { - $this.append('
' + qmn_quiz_data[quizID].quick_result_wrong_answer_text + '
') - $this.append('
' + data.message + '
'); - } - if (1 != qmn_quiz_data[quizID].disable_mathjax) { - MathJax.typesetPromise(); - } - }, - error: function (errorThrown) { - alert(errorThrown); - } - }); + let question_id = jQuery(this).attr('name').split('question')[1], + value = jQuery(this).val(), + $this = jQuery(this).parents('.quiz_section'); + qsm_show_inline_result(quizID, question_id, value, $this, 'radio') } }); + let qsm_inline_result_timer; + jQuery(document).on('keyup', '.mlw_answer_open_text, .mlw_answer_number', function (e) { + let $i_this = jQuery(this); + let quizID = jQuery(this).parents('.qsm-quiz-container').find('.qmn_quiz_id').val(); + if (qmn_quiz_data[quizID].enable_quick_result_mc == 1) { + clearTimeout(qsm_inline_result_timer); + qsm_inline_result_timer = setTimeout(() => { + let question_id = $i_this.attr('name').split('question')[1], + value = $i_this.val(), + $this = $i_this.parents('.quiz_section'); + qsm_show_inline_result(quizID, question_id, value, $this, 'input'); + }, 2000); + } + }); + + //inline result status function + function qsm_show_inline_result(quizID, question_id, value, $this, answer_type) { + jQuery.ajax({ + type: 'POST', + url: qmn_ajax_object.ajaxurl, + data: { + action: "qsm_get_question_quick_result", + question_id: question_id, + answer: value, + answer_type: answer_type, + show_correct_info: qmn_quiz_data[quizID].enable_quick_correct_answer_info + }, + success: function (response) { + var data = jQuery.parseJSON(response); + $this.find('.quick-question-res-p').remove(); + $this.find('.qsm-inline-correct-info').remove(); + if (data.success == 'correct') { + $this.append('
' + qmn_quiz_data[quizID].quick_result_correct_answer_text + '
') + $this.append('
' + data.message + '
'); + } else if (data.success == 'incorrect') { + $this.append('
' + qmn_quiz_data[quizID].quick_result_wrong_answer_text + '
') + $this.append('
' + data.message + '
'); + } + if (1 != qmn_quiz_data[quizID].disable_mathjax) { + MathJax.typesetPromise(); + } + }, + error: function (errorThrown) { + alert(errorThrown); + } + }); + } // Autocomplete off jQuery('.qsm-quiz-container').find('.qmn_quiz_id').each(function () { diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index 3d29224be..ff4fb2cfd 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.0.10 + * Version: 8.1.0 * 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.0.10'; + public $version = '8.1.0'; /** * QSM Alert Manager Object @@ -277,7 +277,7 @@ public function qsm_admin_scripts_style( $hook ) { wp_enqueue_style( 'qsm_admin_style_rtl', plugins_url( 'css/qsm-admin-rtl.css', __FILE__ ), array(), $this->version ); } // dashboard and quiz list pages - if ( 'toplevel_page_qsm_dashboard' === $hook || ('edit.php' == $hook && isset( $_REQUEST['post_type'] ) && 'qsm_quiz' == $_REQUEST['post_type']) ) { + if ( 'toplevel_page_qsm_dashboard' === $hook || 'qsm_page_qmn_addons' === $hook || ('edit.php' == $hook && isset( $_REQUEST['post_type'] ) && 'qsm_quiz' == $_REQUEST['post_type']) ) { wp_enqueue_script( 'micromodal_script', plugins_url( 'js/micromodal.min.js', __FILE__ ), array( 'jquery', 'qsm_admin_js' ), $this->version, true ); wp_enqueue_media(); wp_enqueue_style( 'qsm_admin_dashboard_css', QSM_PLUGIN_CSS_URL . '/admin-dashboard.css', array(), $this->version ); diff --git a/php/admin/admin-dashboard.php b/php/admin/admin-dashboard.php index 9d81bf495..0713479d1 100644 --- a/php/admin/admin-dashboard.php +++ b/php/admin/admin-dashboard.php @@ -336,7 +336,7 @@ function qsm_dashboard_popular_addon( $widget_id ) { ?>
diff --git a/php/admin/functions.php b/php/admin/functions.php index 95d7ee7ee..04c0c8e31 100644 --- a/php/admin/functions.php +++ b/php/admin/functions.php @@ -222,7 +222,8 @@ function qsm_add_author_column_in_db() { * Transfer all quiz post to new cpt 'qsm_quiz' */ function qsm_change_the_post_type() { - if ( 1 !== intval( get_option( 'qsm_change_the_post_type', '' ) ) ) { + $all_plugins = get_plugins(); + if ( empty( $all_plugins['sensei-lms/sensei-lms.php'] ) && 1 !== intval( get_option( 'qsm_change_the_post_type', '' ) ) ) { $post_arr = array( 'post_type' => 'quiz', 'posts_per_page' => -1, @@ -796,7 +797,7 @@ class="qsm-opt-desc"> - +
+ + + + + + + + + + + +
+ +
+ + Hide correct answer on result page if user selected wrong answer from quiz.'; + } + /** * Generates Quiz Global Field For End quiz if there is wrong answer * diff --git a/php/admin/tools-page.php b/php/admin/tools-page.php index 96c71cc2f..1ad37ae24 100644 --- a/php/admin/tools-page.php +++ b/php/admin/tools-page.php @@ -46,7 +46,7 @@ function qsm_restore_function() { global $wpdb; // Checks if form was submitted. - if ( isset( $_POST['restore_quiz'] ) ) { + if ( isset( $_POST['restore_quiz_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['restore_quiz_nonce'] ) ), 'restore_quiz_nonce' ) && isset( $_POST['restore_quiz'] ) ) { $restore = $wpdb->update( $wpdb->prefix . 'mlw_quizzes', array( @@ -88,7 +88,7 @@ function qsm_restore_function() { } wp_reset_postdata(); ?> - +

+