diff --git a/php/classes/question-types/class-question-review-fill-in-blanks.php b/php/classes/question-types/class-question-review-fill-in-blanks.php index 46fca8a61..9fe37f119 100644 --- a/php/classes/question-types/class-question-review-fill-in-blanks.php +++ b/php/classes/question-types/class-question-review-fill-in-blanks.php @@ -28,8 +28,9 @@ public function set_user_answer() { } public function set_correct_answer() { + global $mlwQuizMasterNext; foreach ( $this->answer_array as $answer_key => $answer_value ) { - $this->correct_answer[ $answer_key ] = $this->sanitize_answer_from_db( $answer_value[0] ); + $this->correct_answer[ $answer_key ] = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $this->sanitize_answer_from_db( $answer_value[0] ), "answer-{$this->question_id}-{$answer_key}", "QSM Answers" ); } } 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 2dc8b68a2..7a4fd1f1b 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 @@ -70,6 +70,9 @@ function qmn_fill_blank_display( $id, $question, $answers ) { */ function qmn_fill_blank_review( $id, $question, $answers ) { global $mlwQuizMasterNext; + if ( ! empty( $question ) ) { + $question = $mlwQuizMasterNext->pluginHelper->qsm_language_support( htmlspecialchars_decode( html_entity_decode( $question, ENT_HTML5 ), ENT_QUOTES ), "question-description-{$id}", "QSM Questions" ); + } $case_sensitive = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'case_sensitive' ); $current_question = new QSM_Question_Review_Fill_In_Blanks( $id, $question, $answers ); $user_text_array = $current_question->get_user_answer(); diff --git a/php/template-variables.php b/php/template-variables.php index b8a4ad320..385a4eadf 100644 --- a/php/template-variables.php +++ b/php/template-variables.php @@ -1011,7 +1011,9 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question $question_settings = isset( $questions[ $answer['id'] ]['settings'] ) ? $questions[ $answer['id'] ]['settings'] : array(); $question_title = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $answer['question_title'], "Question-{$answer['id']}", 'QSM Questions' ); $question_description = ''; - if ( ! empty( $answer[0] ) ) { + if ( 14 == $answer['question_type'] ) { + $question_description = ! empty($answer[0]) ? $answer[0] : ''; + } elseif ( ! empty( $answer[0] ) ) { $question_description = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $answer[0], "question-description-{$answer['id']}", 'QSM Questions' ); } $question_description = ! empty( $question_description ) ? '' . $question_description . '' : $question_description; @@ -1129,10 +1131,10 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question $is_answer_correct = 0; if ( isset($answer['case_sensitive']) && 1 === intval( $answer['case_sensitive'] ) ) { $decode_show_user_answer = htmlspecialchars_decode( $show_user_answer, ENT_QUOTES ); - $decode_single_user_answer = htmlspecialchars_decode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $single_answer[0], 'QSM Answers' ), ENT_QUOTES ); + $decode_single_user_answer = htmlspecialchars_decode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $answer['id'] . '-' . $key, 'QSM Answers' ), ENT_QUOTES ); } else { $decode_show_user_answer = htmlspecialchars_decode( mb_strtoupper( $show_user_answer ), ENT_QUOTES ); - $decode_single_user_answer = mb_strtoupper( htmlspecialchars_decode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $single_answer[0], 'QSM Answers' ), ENT_QUOTES ) ); + $decode_single_user_answer = mb_strtoupper( htmlspecialchars_decode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $answer['id'] . '-' . $key, 'QSM Answers' ), ENT_QUOTES ) ); } if ( $decode_show_user_answer == $decode_single_user_answer ) { @@ -1147,16 +1149,16 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question } $question_with_answer_text .= '(' . $index . ') ' . $show_user_answer . ''; - $question_with_answer_text .= '(' . $index . ') ' . strval( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $single_answer[0], 'QSM Answers' ) ) . ''; + $question_with_answer_text .= '(' . $index . ') ' . strval( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $answer['id'] . '-' . $key, 'QSM Answers' ) ) . ''; } } } else { $options = array(); foreach ( $total_answers as $key => $single_answer ) { if ( isset($answer['case_sensitive']) && 1 === intval( $answer['case_sensitive'] ) ) { - $options[] = htmlspecialchars_decode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $single_answer[0], 'QSM Answers' ), ENT_QUOTES ); + $options[] = htmlspecialchars_decode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $answer['id'] . '-' . $key, 'QSM Answers' ), ENT_QUOTES ); } else { - $options[] = mb_strtoupper( htmlspecialchars_decode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $single_answer[0], 'QSM Answers' ), ENT_QUOTES ) ); + $options[] = mb_strtoupper( htmlspecialchars_decode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $answer['id'] . '-' . $key, 'QSM Answers' ), ENT_QUOTES ) ); } }