Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-46611

Course reset features for local plugins

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 2.7.1
    • Course
    • MOODLE_27_STABLE

      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).

            Unassigned Unassigned
            nixo Nikita Kalinin
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.