Skip to content

Commit

Permalink
Merge pull request #2584 from QuizandSurveyMaster/CU-86cur13k8-advanc…
Browse files Browse the repository at this point in the history
…e-polar-question

Cu 86cur13k8 advance polar question
  • Loading branch information
zubairraeen authored Jun 14, 2024
2 parents 47c807d + 9edbbcf commit 85d8247
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion js/qsm-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 5 additions & 1 deletion php/question-types/qsm-question-type-polar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
?>
<span class="mlw_qmn_question question-type-polar-s">
<div class='left-polar-title'> <?php
Expand Down Expand Up @@ -100,6 +103,7 @@ function qmn_polar_display( $id, $question, $answers ) {
?></div>
</span>
<?php
}
echo apply_filters( 'qmn_polar_display_front', '', $id, $question, $answers );
}

Expand Down
3 changes: 2 additions & 1 deletion php/template-variables.php
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,8 @@ function qmn_polar_display_on_resultspage( $id, $question, $answers, $answer ) {
$input_text .= "</div>";
$question = $input_text;
$question_display .= "<span class='mlw_qmn_question mlw-qmn-question-result-$id question-type-polar-s'>" . do_shortcode( htmlspecialchars_decode( $question, ENT_QUOTES ) ) . '</span>';
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 );
}

/**
Expand Down

0 comments on commit 85d8247

Please sign in to comment.