From f1bcc29e0278f328f199917ec256bbb4986cf0cf Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Mon, 5 Feb 2024 12:11:08 +0530 Subject: [PATCH] Fixed wpml issue with fill in the blank type question --- php/question-types/qsm-question-title.php | 45 ++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/php/question-types/qsm-question-title.php b/php/question-types/qsm-question-title.php index bc730e070..fc361490a 100644 --- a/php/question-types/qsm-question-title.php +++ b/php/question-types/qsm-question-title.php @@ -63,4 +63,47 @@ function qsm_question_title_func( $question, $question_type = '', $new_question_ true, + 'class' => true, + 'id' => true, + 'height' => true, + 'min' => true, + 'max' => true, + 'minlength' => true, + 'maxlength' => true, + 'name' => true, + 'pattern' => true, + 'placeholder' => true, + 'readonly' => true, + 'required' => true, + 'size' => true, + 'step' => true, + 'type' => true, + 'value' => true, + 'width' => true, + ); + $required = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'required' ); + $autofill = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'autofill' ); + $limit_text = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'limit_text' ); + $min_fill_text = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'min_text_length' ); + $autofill_att = $autofill ? "autocomplete='off' " : ''; + $limit_text_att = $limit_text ? "maxlength='" . $limit_text . "' " : ''; + $min_fill_text_att = $min_fill_text ? "minlength='" . $min_fill_text . "' " : ''; + if ( 0 == $required ) { + $mlw_require_class = 'mlwRequiredText'; + } else { + $mlw_require_class = ''; + } + $input_text = '"; + $input_text = apply_filters( 'qsm_wpml_text_replace_after', $input_text, $id, $question, $mlw_require_class ); + $question = str_replace( '%BLANK%', $input_text, do_shortcode( htmlspecialchars_decode( $question, ENT_QUOTES ) ) ); + } + return $question; +} +add_filter( 'qsm_question_description_before', 'qsm_wpml_support_for_question_desc', 20, 3 ); \ No newline at end of file