From: tjhunt Date: Fri, 4 May 2007 10:04:20 +0000 (+0000) Subject: Matching qestion type was failing to correctly determine wheterh the student had... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2c89cfb533c1ab3cab99eecc751c11bd848595d2;p=moodle.git Matching qestion type was failing to correctly determine wheterh the student had changed their answer - further improvements. Merged from MOODLE_18_STABLE. --- diff --git a/question/type/match/questiontype.php b/question/type/match/questiontype.php index a94fd3a92a..352c3c5fad 100644 --- a/question/type/match/questiontype.php +++ b/question/type/match/questiontype.php @@ -369,8 +369,12 @@ class question_match_qtype extends default_questiontype { } function compare_responses($question, $state, $teststate) { - foreach ($state->responses as $i=>$sr){ - if(empty($teststate->responses[$i]) || $state->responses[$i] != $teststate->responses[$i]){ + foreach ($state->responses as $i=>$sr) { + if (empty($teststate->responses[$i])) { + if (!empty($state->responses[$i])) { + return false; + } + } else if ($state->responses[$i] != $teststate->responses[$i]) { return false; } }