- 21 Jun 2022
- 1 minute to read
Manually deleting course completion records
- Updated on 21 Jun 2022
- 1 minute to read
When enrolled learners are unenrolled from a course there will still be a course completion record that remains as a record of their previous enrolment. This is not always desirable, for example when the enrolment happens by accident. There are two ways of safely removing the course completion record, depending on the circumstance.
Removing individual completion records
The completion editor can be used to remove the course completion records of individuals who are no longer enrolled. Upon editing course completion for such a user, an information box will appear at the top of the screen with a link to delete the current course completion record.
This operation will permanently remove all completion history and information for the user on the course, and cannot be undone.
Removing completion records in bulk
If many users were accidentally enrolled and then immediately unenrolled from a course (as could happen when selecting the wrong audience for audience sync enrolment, for example), individually editing and deleting the course completion records for each learner would be time consuming.
For this case, there is a command line script, to be run by a System Administrator, that will delete all (or a time-based subset of) unstarted course completion records of users who are no longer enrolled on a given course. This script can be found at admin/cli/delete_unused_course_completions.php and can be run with a --help flag to output usage instructions.
When run, this script will log that it has executed, and include the parameters used as well as how many unstarted completion records were deleted.