Is there a limit to the maximum number of students enrolled in a course? (through all possible enrolment methods)

Re: Is there a limit to the maximum number of students enrolled in a course? (through all possible enrolment methods)

by sadaf sadafian -
Number of replies: 0
thank you @Renaat
->same pay: The probability of this happening in most moodels is very low
other problem such as cohort and complete courseA ... also can handled by error message to contact with admin.
core modifying: it is failed after update moodle and i need every time i want update change that code and it is not standard.
Why do you not remove the enrol permissions (for each method) for these teachers? -> i need prevent teacher to add more than specific number of student for some course in any way. each of my course category assign to one departmant and each of them has some student that must not more than defined user to defined course. in anyway manual ,payment, self enrolment or any other enolment method.Course A must have for example 40 user in the maximum.
do you understand is it possible use overwrite any moodle function to add "before user enrol event"?