Manually deleting course completion records
    • 01 Nov 2022
    • 1 minute to read

    Manually deleting course completion records


    Article Summary

    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.

    Completion records for a learner.

    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.

    It is important to back up the database before you run the script.

    © Copyright 2024 Totara Learning Solutions. All rights reserved. Some content originally obtained via GPLv3 license and continues to be available under GPLv3. All other content is the sole copyright of Totara Learning Solutions. 


    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.