MDL-31065 question stats: fix analysis of responses not matching a given answer

When shortanswer, numerical, calculated and calculatedsimple questions
did not have a '*' match-anything answer, then any student response that
did not match any of the teacher-given answers were classified as
'[No response]', which was not right.

This patch fixes that. Such responses are now classified as
[Did not match any answer].

While I was doing this, I noticed that the display of tolerance
intervals for numerical questions in the response analysis was horrible,
so I improved it.
This commit is contained in:
Tim Hunt
2012-01-20 17:46:01 +00:00
parent 2b18b65f9a
commit 4eac963a41
15 changed files with 300 additions and 16 deletions
+3 -1
View File
@@ -709,8 +709,10 @@ abstract class question_graded_by_strategy extends question_graded_automatically
$ans = $this->get_matching_answer($response);
if (!$ans) {
return array($this->id => question_classified_response::no_response());
return array($this->id => new question_classified_response(
0, $response['answer'], 0));
}
return array($this->id => new question_classified_response(
$ans->id, $response['answer'], $ans->fraction));
}