From 2c89cfb533c1ab3cab99eecc751c11bd848595d2 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Fri, 4 May 2007 10:04:20 +0000 Subject: [PATCH] Matching qestion type was failing to correctly determine wheterh the student had changed their answer - further improvements. Merged from MOODLE_18_STABLE. --- question/type/match/questiontype.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; } } -- 2.39.5