Best way to auto-unenroll student and not allow them to re-enroll

Best way to auto-unenroll student and not allow them to re-enroll

by Alex Parsy -
Number of replies: 0

Hi everyone,

I am programming a module where if some event happens for a student e.g event X , then the system should unenroll that student and take away their ability to Re-enroll again.

The best way I know currently is everywhere there is a "enroll in this course" link, I check to see if event X for the student is true, then don't print the "enroll in this course".

But I am thinking there should be a better way.

would using has_capability be better ? E.g. if event X occurs, I take away their ability to enroll in a course and that automatically not show the "enroll in this course" link anywhere.

I suspect this would work but I don't know which function to call to take away their enrollment capability for that particular course.

any hints or info is greatly appreciated.

John
Average of ratings: -