Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Course Reset Proposal

From MoodleDocs


Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable.


Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.


Currently it is not possible to reset a course so a user can retake it, since each individual module manages it's own data. Below is a proposal for how we could implement course reset functionality.

Since each module stores and manages user data, it would be necessary for the modules to add support for resetting the data for a particular user.

One way to implement this would be to add a new FEATURE_RESET constant to the module plugin_supports() function. If supported a module would implement a modname_reset_user($userid) function which removes (or archives) the data for that user.

A new course function reset_course($userid) would then be possible which would loop through the activities used in the course, and calls the modname_reset_user() function on any that support it.

This would allow support for course resetting to be gradually rolled out - with modules adding support as required. Organisations that wanted course resetting to catch all user data would only be able to use plugins that support resetting, and there would be some incentive to add support to commonly used modules.

Some modules (e.g. scorm) already have the concept of attempts. Perhaps a standardised way of handling multiple attempts could be implemented, which would allow attempt data to be managed more centrally?

Reset vs Archive

Many organisations require historic records of activity to be kept so would not want a course reset to delete previous attempts. Data on previous attempts would need to be kept, although exactly how fine-grained that data needs to be is unclear.

Archiving data would create the need to report on historical records.

Potential issues

  • Course and activity completion criteria would also need to support FEATURE_RESET so that completion criteria could be reset at the same time. Allowing complete courses to become incomplete may have implications as currently completion is "forever" once achieved
  • Some activities that depend on user interaction would not be able to delete all user data - for example a forum post which may have many responses should not be deleted.

Links