From 0f6a49da32380a92712be6486e88239d8652acb4 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Tue, 23 Feb 2010 12:47:07 +0000 Subject: [PATCH] match qtype: MDL-21701 / OU bug 9551 Fix display of response history. The displays were being displayed in an order that depended on what the student had selected, not the order in which the subquestions were displayed. Great attention to detail by the OU testing team to notice this! --- question/type/match/questiontype.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/question/type/match/questiontype.php b/question/type/match/questiontype.php index f7444051460..8d454252bf0 100644 --- a/question/type/match/questiontype.php +++ b/question/type/match/questiontype.php @@ -400,18 +400,18 @@ class question_match_qtype extends default_questiontype { // ULPGC ecastro function get_actual_response($question, $state) { - $subquestions = &$state->options->subquestions; - $responses = &$state->responses; - $results=array(); - foreach ($subquestions as $key => $sub) { - foreach ($responses as $ind => $code) { - if (isset($sub->options->answers[$code])) { - $results[$ind] = $subquestions[$ind]->questiontext . ": " . $sub->options->answers[$code]->answer; - } - } - } - return $results; - } + $subquestions = &$state->options->subquestions; + $responses = &$state->responses; + $results=array(); + foreach ($responses as $ind => $code) { + foreach ($subquestions as $key => $sub) { + if (isset($sub->options->answers[$code])) { + $results[$ind] = $subquestions[$ind]->questiontext . ": " . $sub->options->answers[$code]->answer; + } + } + } + return $results; + } function response_summary($question, $state, $length=80) { // This should almost certainly be overridden