Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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.
  • Loading branch information...
commit 92e387abbc4f92e075c7527b7ad42002934d3865 1 parent 7bf643e
tjhunt authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 question/type/match/questiontype.php
View
10 question/type/match/questiontype.php
@@ -168,7 +168,7 @@ function restore_session_and_responses(&$question, &$state) {
// 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);
@@ -234,9 +234,9 @@ function print_question_formulation_and_controls(&$question, &$state, $cmoptions
$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.
@@ -244,7 +244,7 @@ function print_question_formulation_and_controls(&$question, &$state, $cmoptions
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;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.