From 21accf3a556a14429026f8918bc0e573c17279b7 Mon Sep 17 00:00:00 2001 From: etchirag Date: Tue, 26 Nov 2024 13:00:08 +0530 Subject: [PATCH] Fixed issue with shortcode in fill in the blank question type --- .../qsm-question-type-fill-in-the-blanks.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/php/question-types/qsm-question-type-fill-in-the-blanks.php b/php/question-types/qsm-question-type-fill-in-the-blanks.php index 9d2837733..370604a47 100644 --- a/php/question-types/qsm-question-type-fill-in-the-blanks.php +++ b/php/question-types/qsm-question-type-fill-in-the-blanks.php @@ -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 ); }