General developer forum

Appropriate ID to use in plugin

Picture of Mark Johnson
Re: Appropriate ID to use in plugin
Core developersParticularly helpful MoodlersPlugin developers

Ok, I don't think you can do something like this with the existing settings.  There's 2 main issues here; I dont think you can make enrolments end automatically when a course is completed, and completion is linked to a user and course or course module, rather than an enrolment.

One possibility would be to create a plugin with an event listener, which listens for the core\event\course_completed event. When this event is received for the course in question, it could reset the completion data for that user on that course, and remove their enrolment.  Next time the visit the course, they would need to re-enrol.  This wouldn't remove any other data that they've submitted to course modules on the course, though.

Average of ratings: -