Skip to content

Commit

Permalink
Merge pull request #2456 from QuizandSurveyMaster/CU-86cuhj0h3-wpml-i…
Browse files Browse the repository at this point in the history
…ssue-fill-in-the-blank

Fixed wpml issue with fill in the blank type question
  • Loading branch information
zubairraeen authored Feb 5, 2024
2 parents 8b1a3be + a45f489 commit 0229824
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion php/question-types/qsm-question-title.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function qsm_question_title_func( $question, $question_type = '', $new_question_
<?php
}
}
if ( ! empty( $question_title ) ) {
if ( ! empty( $question_title ) && 'fill_in_blank' !== $question_type ) {
$question_title = $mlwQuizMasterNext->pluginHelper->qsm_language_support( htmlspecialchars_decode( html_entity_decode( $question_title, ENT_HTML5 ), ENT_QUOTES ), "question-description-{$question_id}", "QSM Questions" );
}
?>
Expand Down
3 changes: 3 additions & 0 deletions php/question-types/qsm-question-type-fill-in-the-blanks.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ function qmn_fill_blank_display( $id, $question, $answers ) {
}
$input_text = '<input ' . $min_fill_text_att . $autofill_att . $limit_text_att . " type='text' class='qmn_fill_blank $mlw_require_class' name='question" . $id . "[]' />";
$input_text = apply_filters( 'qsm_fill_in_blanks_input_after', $input_text, $id, $question, $answers, $mlw_require_class );
if ( ! empty( $question ) ) {
$question = $mlwQuizMasterNext->pluginHelper->qsm_language_support( htmlspecialchars_decode( html_entity_decode( $question, ENT_HTML5 ), ENT_QUOTES ), "question-description-{$id}", "QSM Questions" );
}
if ( strpos( $question, '%BLANK%' ) !== false ) {
$question = str_replace( '%BLANK%', $input_text, do_shortcode( htmlspecialchars_decode( $question, ENT_QUOTES ) ) );
}
Expand Down

0 comments on commit 0229824

Please sign in to comment.