Skip to content

Commit

Permalink
matching qtype: MDL-17496 With filterall and multilang, the contents …
Browse files Browse the repository at this point in the history
…of the dropdowns was not being properly filtered

This was caused becuse the solution to MDL-9005 was not quite right.
  • Loading branch information
tjhunt committed Dec 12, 2008
1 parent 7bf643e commit 92e387a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions question/type/match/questiontype.php
Expand Up @@ -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);
Expand Down Expand Up @@ -234,17 +234,17 @@ 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.
foreach ($subquestions as $subquestion) {
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;
}
}
Expand Down

0 comments on commit 92e387a

Please sign in to comment.