From 299d9fb8349e7abbf21fb8f8f93b4b3885396f37 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Fri, 12 Dec 2008 04:39:38 +0000 Subject: [PATCH] matching qtype: MDL-17496 With filterall and multilang, the contents of the dropdowns was not being properly filtered This was caused becuse the solution to MDL-9005 was not quite right. --- question/type/match/questiontype.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/question/type/match/questiontype.php b/question/type/match/questiontype.php index 012b9c4998..7169f6b8db 100644 --- a/question/type/match/questiontype.php +++ b/question/type/match/questiontype.php @@ -177,7 +177,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); } @@ -243,9 +243,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. @@ -253,7 +253,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; } } -- 2.39.5