diff --git a/classes/teststrategy/feedbackgenerator/customscalefeedback.php b/classes/teststrategy/feedbackgenerator/customscalefeedback.php index 510dd5ba4..401dbc8e3 100644 --- a/classes/teststrategy/feedbackgenerator/customscalefeedback.php +++ b/classes/teststrategy/feedbackgenerator/customscalefeedback.php @@ -91,39 +91,15 @@ public function get_studentfeedback(array $data): array { (array) $progress->get_quiz_settings(), $data['catscales'] ); - $firstelement = $data['customscalefeedback_abilities'][array_key_first($data['customscalefeedback_abilities'])]; - if (!empty($firstelement['estimated'])) { - if (!isset($firstelement['fraction'])) { - $comment = get_string('estimatedbecause:default', 'local_catquiz'); - } else { - switch ((int) $firstelement['fraction']) { - case 1 : - $comment = get_string('estimatedbecause:allanswerscorrect', 'local_catquiz'); - break; - case 0 : - if (count($this->get_progress()->get_playedquestions()) === 0) { - $comment = get_string('error:nminscale', 'local_catquiz'); - } else { - $comment = get_string('estimatedbecause:allanswersincorrect', 'local_catquiz'); - } - break; - default : - $comment = get_string('estimatedbecause:default', 'local_catquiz'); - break; - - } - } - } if (empty($customscalefeedback)) { return []; - } else { - return [ - 'heading' => $this->get_heading(), - 'comment' => $comment ?? "", - 'content' => $customscalefeedback, - ]; } + + return [ + 'heading' => $this->get_heading(), + 'content' => $customscalefeedback, + ]; } /** diff --git a/tests/teststrategy/feedbackgenerator/customscalefeedback_test.php b/tests/teststrategy/feedbackgenerator/customscalefeedback_test.php index 2ab653c3c..09ad4ae53 100644 --- a/tests/teststrategy/feedbackgenerator/customscalefeedback_test.php +++ b/tests/teststrategy/feedbackgenerator/customscalefeedback_test.php @@ -131,7 +131,6 @@ public static function get_studentfeedback_provider(): array { 'expected' => [ 'heading' => 'Feedback', 'content' => '

adsfafs<\/p>
', - 'comment' => '', ], ], 'noscalestoreport' => [ @@ -171,10 +170,8 @@ public static function get_studentfeedback_provider(): array { 'expected' => [ 'heading' => 'Feedback', 'content' => 'No valid feedback could be generated.', - 'comment' => '', ], ], ]; } - }