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!
This commit is contained in:
Tim Hunt
2010-02-23 12:47:07 +00:00
parent 74964e989e
commit 0f6a49da32
+12 -12
View File
@@ -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