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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user