Skip to content

Commit

Permalink
Fixed issue with shortcode in fill in the blank question type
Browse files Browse the repository at this point in the history
  • Loading branch information
etchirag committed Nov 26, 2024
1 parent 7455275 commit 21accf3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions php/question-types/qsm-question-type-fill-in-the-blanks.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ function qmn_fill_blank_display( $id, $question, $answers ) {
if ( ! empty( $question ) ) {
$question = $mlwQuizMasterNext->pluginHelper->qsm_language_support( htmlspecialchars_decode( html_entity_decode( $question, ENT_HTML5 ), ENT_QUOTES ), "question-description-{$id}", "QSM Questions" );
}
$new_question_title = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'question_title' );
if ( strpos( $question, '%BLANK%' ) !== false ) {
$question = str_replace( '%BLANK%', $input_text, do_shortcode( htmlspecialchars_decode( $question, ENT_QUOTES ) ) );
$question = str_replace( '%BLANK%', $input_text, htmlspecialchars_decode( $question, ENT_QUOTES ) );
qsm_question_title_func( $question, 'fill_in_blank', $new_question_title, $id );
$question = do_shortcode( $question );
} else {
qsm_question_title_func( $question, 'fill_in_blank', $new_question_title, $id );
}
// $question_title = apply_filters('the_content', $question);
$new_question_title = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'question_title' );
qsm_question_title_func( $question, 'fill_in_blank', $new_question_title, $id );
echo apply_filters( 'qmn_fill_blank_display_front', '', $id, $question, $answers );
}

Expand Down

0 comments on commit 21accf3

Please sign in to comment.