Prehistory.
I'm working on local plugin that automatically transfers grades to an external system. The association between instance of course module and the assignment of an external system should be set up by the instructor in order to activate grade transferring. I used the ***_extends_settings_navigation() hook to add "manage associations" page for some activity modules (e. g. quiz, assign, lesson...). So, it would be useful to have ability to remove all associations when resetting the course.
The issue.
I have defined ***_reset_course_form_definition(), ***_reset_course_form_defaults(), ***_reset_userdata() hooks but it was useless.
From course/reset_form.php |
...
|
if ($allmods = $DB->get_records('modules') ) {
|
foreach ($allmods as $mod) {
|
$modname = $mod->name;
|
$modfile = $CFG->dirroot."/mod/$modname/lib.php";
|
...
|
It is clear that only "mod" directory looked for reset hooks. In reset_course_userdata() (in lib/moodlelib.php) the same.
Proposal: look for local plugins hooks too or make it completely versatile (if that makes sense).
core_component methods may help (e. g. get_plugin_types, get_plugin_list).