Skip to documentation
    Back to Documentation
    Local Plugin
    Requirements in plugin archive
    v1.0.5
    No AI credits

    Completion Auto-Suspend

    Automatically switch a student's enrolment from active to suspended the moment they complete a course — with a premium dashboard to control exactly which courses and categories it applies to. See the plugin archive for release-specific requirements and feature availability.

    ⭐ Why this plugin is unlike anything else available

    Automatically manages enrolment lifecycle on course completion

    ▸ No native Moodle enrolment plugin responds to course completion events. When a learner finishes a course, their enrolment stays active indefinitely — they keep full access, seat licenses remain consumed, and rosters become cluttered with past completions. Completion Auto-Suspend bridges 'finished learning' to 'end of enrolment' automatically, no manual action required.

    ▸ Event-driven suspension: a course-completion event triggers suspension immediately, and a scheduled reconciliation task catches any completions the event missed.

    ▸ Generates a completion suspension log accessible to admins. Every suspension is recorded with the learner, course, completion date, and suspension date — audit trail without manual tracking.

    Installation
    1. Moodle → Site administration → Plugins → Install plugins → upload the ZIP.
    2. Validate and upgrade the database.
    3. Open Site administration → Plugins → Local plugins → Completion Auto-Suspend.

    Requires course completion enabled and Moodle cron running (for backfill and re-activation).

    Features
    Suspend on completion. Reacts to the course_completed event and suspends the student instantly across every enrolment method.
    Course & category scope. Enable per course or per whole category, with an optional cascade into sub-categories.
    All enrolment methods. Manual, self, cohort sync, LTI, LDAP — whichever method the student is enrolled through.
    Protects staff. Never suspends teachers, managers or admins by default — anyone who can edit the course is skipped.
    Retroactive backfill. A scheduled task suspends students who already completed before you enabled the course.
    Auto re-activation. If a completion is reset, the enrolments the plugin suspended switch back to active.
    Simulation mode. Dry-run logs every action without changing enrolments — a safe first roll-out.
    Full audit log. Every change is recorded: user, course, method, event vs. task, real vs. simulated.
    Privacy (GDPR). A complete privacy provider supports data export and deletion.
    How scope works

    A course is in scope if either:

    • it is selected directly on the Courses tab, or
    • it belongs to a selected category. With Include sub-categories on, a course also qualifies when any ancestor category is selected.

    Category scope is evaluated live, so new courses created later inside an enabled category are covered automatically.

    The dashboard

    Master switch — nothing runs until it is on.

    Courses / Categories tabs — live search and per-item toggles, with enrolment and completion counts.

    Activity tab — a live audit log, plus Run reconciliation now.

    Settings tab — the behaviour switches below.

    Settings reference
    SettingDefaultWhat it does
    Enable Completion Auto-Suspend (master)
    Off
    Master switch. While off, no enrolments are ever changed.
    Never suspend teachers, managers or admins
    On
    Skips anyone who can edit the course (moodle/course:update) — completing a course never suspends staff.
    Re-activate on completion reset
    On
    If completion is reset/removed, switch the plugin-suspended enrolments back to active.
    Include sub-categories
    On
    When a category is selected, also apply to courses in all of its sub-categories.
    Retroactively suspend already-completed
    On
    The scheduled task suspends students who completed before the course was enabled.
    Simulation mode (dry run)
    Off
    Log what would happen without changing any enrolment.
    How it works

    Immediate: an observer on \core\event\course_completed suspends via each method's update_user_enrol().

    Reconcile task (every 30 min): retroactive backfill and auto re-activation on completion reset.

    Data: local_completionsuspend_target (selections) and local_completionsuspend_log (audit trail).

    Privacy, capability & ecosystem

    Access is controlled by local/completionsuspend:manage (Managers by default). A full privacy provider covers GDPR export and deletion of the audit log.

    This is a utility plugin — it consumes no AI credits and makes no portal API calls. It appears in the Quick Links block under the Manage dropdown.