Matching qestion type was failing to correctly determine wheterh the student had changed their answer - further improvements.

This commit is contained in:
tjhunt
2007-05-04 10:03:56 +00:00
parent 7a543c5cfb
commit fc56e73e49
+6 -2
View File
@@ -365,8 +365,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;
}
}