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

Course reset features for local plugins

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.7.1
    • Fix Version/s: BACKEND
    • Component/s: Course
    • Labels:
    • Affected Branches:
      MOODLE_27_STABLE

      Description

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                nixo Nikita Kalinin
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: