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

Course reset features for local plugins

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Do
    • 2.7.1
    • BACKEND
    • Course
    • 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

              Unassigned Unassigned
              nixo Nikita Kalinin
              Amaia Anabitarte, Bas Brands, Carlos Escobedo, Laurent David, Sabina Abellan, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: