diff --git a/question/type/match/questiontype.php b/question/type/match/questiontype.php index da17d1c07e3..acf8e50acac 100644 --- a/question/type/match/questiontype.php +++ b/question/type/match/questiontype.php @@ -166,7 +166,7 @@ class question_match_qtype extends default_questiontype { // answers per question, each with different marks and feedback. $answer = new stdClass(); $answer->id = $subquestion->code; - $answer->answer = format_string($subquestion->answertext); + $answer->answer = $subquestion->answertext; $answer->fraction = 1.0; $state->options->subquestions[$key]->options ->answers[$subquestion->code] = clone($answer); @@ -232,9 +232,9 @@ class question_match_qtype extends default_questiontype { $subquestions = $state->options->subquestions; $correctanswers = $this->get_correct_responses($question, $state); $nameprefix = $question->name_prefix; - $answers = array(); - $allanswers = array(); - $answerids = array(); + $answers = array(); // Answer choices formatted ready for output. + $allanswers = array(); // This and the next used to detect identical answers + $answerids = array(); // and adjust ids. $responses = &$state->responses; // Prepare a list of answers, removing duplicates. @@ -242,7 +242,7 @@ class question_match_qtype extends default_questiontype { foreach ($subquestion->options->answers as $ans) { $allanswers[$ans->id] = $ans->answer; if (!in_array($ans->answer, $answers)) { - $answers[$ans->id] = $ans->answer; + $answers[$ans->id] = strip_tags(format_string($ans->answer, false)); $answerids[$ans->answer] = $ans->id; } }