Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cu 86cur13k8 advance polar question #2584

Merged
merged 7 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading