diff --git a/js/qsm-admin.js b/js/qsm-admin.js index 3298265c5..62b2d07c4 100644 --- a/js/qsm-admin.js +++ b/js/qsm-admin.js @@ -3209,7 +3209,11 @@ var import_button; var questionType = $('#question_type').val(); var answer_length = $('#answers').find('.answers-single').length; var answerType = $('#change-answer-editor').val(); - if (answer_length > 1 && $('#question_type').val() == 13) { + let isMultiPolar = { + isActive: false, + } + jQuery(document).trigger('qsm_new_answer_button_before', [isMultiPolar, question_id]); + if (answer_length > 1 && $('#question_type').val() == 13 && !isMultiPolar.isActive) { alert(qsm_admin_messages.polar_options_validation); return; } diff --git a/php/question-types/qsm-question-type-polar.php b/php/question-types/qsm-question-type-polar.php index 6464eff20..d471991dc 100644 --- a/php/question-types/qsm-question-type-polar.php +++ b/php/question-types/qsm-question-type-polar.php @@ -41,7 +41,10 @@ function qmn_polar_display( $id, $question, $answers ) { } $new_question_title = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'question_title' ); qsm_question_title_func( $question, '', $new_question_title, $id ); - + $show = true; + $show = apply_filters( 'qsm_check_advance_polar_show_status', $show, $id ); + echo apply_filters( 'qmn_polar_display_front_before', '', $id, $question, $answers ); + if ( $show ) { ?>
"; $question = $input_text; $question_display .= "" . do_shortcode( htmlspecialchars_decode( $question, ENT_QUOTES ) ) . ''; - return apply_filters( 'qmn_polar_display_front', $question_display, $id, $question, $answers ); + $question_display = apply_filters( 'qmn_polar_display_front', $question_display, $id, $question, $answers ); + return apply_filters( 'qmn_polar_display_result_page', $question_display, $id, $question, $answers, $answer ); } /**