markward / local_autogroup

A local plugin for Moodle 2.7 onwards which handles the dynamic creation, population and cleanup of groups on courses.
3 stars 25 forks source link

Course restore cleanup groups #3

Closed markward closed 9 years ago

markward commented 9 years ago

When a course backup is taken from a course with an autogroup_set it may include groups for that group set. If the course backup is later restored onto a course without that group set the groups will be created in an orphaned state.

We either need to:

  1. As we add a new autogroup set to a course, we should also remove any groups with an idnumber starting with "autogroup|" that are not linked to an autogroup set on the course.
  2. Whenever a group is created, check whether it's idnumber matches the autogroup pattern and ensure it is valid. If not valid, delete.