Hello,
As the new Grader in M3.1 is lacking in navigation bar obscure course link I want to improve it by overriding grading_app.php in /mod/assign/classes/output - I've managed to have the template overridden in the theme, but for the life of me cannot get the autoloading to pick up and use my replacement 'grading_app' class:
namespace theme_essential\output;
use renderer_base;
class grading_app extends \mod_assign\output\grading_app {
/**
* Export this class data as a flat list for rendering in a template.
*
* @param renderer_base $output The current page renderer.
* @return stdClass - Flat list of exported data.
*/
public function export_for_template(renderer_base $output) {
error_log('Overridden');
$export = parent::export_for_template($output);
return $export;
}
}
Which is in /theme/essential/classes/output/grading_app.php. The 'error_log' statement is just there as proof that its being used before I spend time writing code.
I've already read:
- https://docs.moodle.org/dev/Automatic_class_loading
- https://docs.moodle.org/dev/Overriding_a_renderer
- https://docs.moodle.org/dev/Templates
And https://docs.moodle.org/dev/Templates#How_to_I_override_a_template_in_my_theme.3F says nothing about the 'data' side of the template overriding process.
Does anybody have any idea what I'm doing wrong please?
Thanks,
Gareth