diff --git a/mod/quiz/report/statistics/tests/fixtures/responsecounts00.csv b/mod/quiz/report/statistics/tests/fixtures/responsecounts00.csv index 50ba9cae4c9..60de822eb35 100644 --- a/mod/quiz/report/statistics/tests/fixtures/responsecounts00.csv +++ b/mod/quiz/report/statistics/tests/fixtures/responsecounts00.csv @@ -10,7 +10,7 @@ slot,randq,variant,subpart,modelresponse,actualresponse,totalcount 2,,1,1,[NO MATCH],-0.2,1 2,,1,1,[NO MATCH],-1,1 2,,4,1,{a} + {b} (±0.01 Relative),19.4,2 -2,,4,1,"[NO RESPONSE]",,1 +2,,4,1,[NO MATCH],0,1 2,,4,1,[NO MATCH],-0.4,1 3,,1,1,frog: amphibian,amphibian,25 3,,1,2,cat: mammal,mammal,24 diff --git a/question/classes/statistics/responses/analysis_for_class.php b/question/classes/statistics/responses/analysis_for_class.php index 42c4aff5249..872f020e603 100644 --- a/question/classes/statistics/responses/analysis_for_class.php +++ b/question/classes/statistics/responses/analysis_for_class.php @@ -145,7 +145,7 @@ class analysis_for_class { return true; } else if (count($actualresponses) === 1) { $singleactualresponse = reset($actualresponses); - return $singleactualresponse != $this->modelresponse; + return (string)$singleactualresponse != $this->modelresponse; } return false; } diff --git a/question/type/numerical/question.php b/question/type/numerical/question.php index 8df2ce93486..c86f2fffc54 100644 --- a/question/type/numerical/question.php +++ b/question/type/numerical/question.php @@ -249,7 +249,7 @@ class qtype_numerical_question extends question_graded_automatically { } public function classify_response(array $response) { - if (empty($response['answer'])) { + if (!$this->is_gradable_response($response)) { return array($this->id => question_classified_response::no_response()); }