]> git.mjollnir.org Git - moodle.git/commitdiff
Matching qestion type was failing to correctly determine wheterh the student had...
authortjhunt <tjhunt>
Fri, 4 May 2007 10:04:20 +0000 (10:04 +0000)
committertjhunt <tjhunt>
Fri, 4 May 2007 10:04:20 +0000 (10:04 +0000)
question/type/match/questiontype.php

index a94fd3a92a0e123892cfc89f926db013bab0687c..352c3c5fada0811167caf2c690dfc3b7e5d1011e 100644 (file)
@@ -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;
             }
         }