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

This commit is contained in:
tjhunt 2007-05-04 10:04:20 +00:00
parent 2b4f19a9ce
commit 2c89cfb533

View 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;
}
}