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

Scheduled course reset



    • Type: New Feature
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.5
    • Fix Version/s: None
    • Component/s: Course
    • Labels:
    • Affected Branches:


      It would be very useful to be able to schedule a course reset to happen at some specified time in the future.

      The two main use cases I can see for this are:

      • end users often reset their course at the end in preparation for a new cohort. They may want, for example, to remove all users as soon as a course ends and not have to schedule a reminder to do this manually.
      • for developers / system admins: many institutions have "rollover" scripts which prepare a large number of courses for use in the next academic year / term. Rather than have to maintain custom scripts to reset courses in bulk it would be preferable to simply set up a scheduled reset with the correct parameters and let Moodle run the reset properly

      A basic implementation of this would involve something like this:

      1. Add database table(s) to hold the parameters from the reset form
      2. Add an extra option to the reset form to decide whether to "run now" or "schedule".
      3. Create a scheduled task to find scheduled resets that are due to be run and call reset_course_userdata() with the stored data

      Some complications:

      • Most (?) plugins only give the option to reset all instances, but some (e.g. feedback) allow users to select individual instances. What would happen to instances added after the reset was scheduled, but before it was run?
      • Could more than one reset be scheduled at any given time? Where / how would the list be displayed to the user?




            Unassigned Unassigned
            maherne Michael Aherne
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            3 Vote for this issue
            3 Start watching this issue