how moodle checks the course duration of a manually enrolled user.

how moodle checks the course duration of a manually enrolled user.

by Dinesh Durai -
Number of replies: 2
Picture of Core developers

I have a user who is enrolled in course X and course Y. Using manual enrollment option I am setting the time limit for the Course X. If the user login now he can see only course Y in his dashboard page(Since the duration of course X for the user is over it is not visible to him). How moodle identifies that course X duration over and it should not be accessed by that user. What method is used find that course duration limit of that user is expired?   how  Moodle displays only courses enrolled by him in dashboard and avoid courses which he is enrolled but course duration is over. 

Average of ratings: -
In reply to Dinesh Durai

Re: how moodle checks the course duration of a manually enrolled user.

by Bernard Raja -

Hello , I too require the solution. I tried different options of Manual enrollment settings.

but unable to crack the requirement. 

In reply to Dinesh Durai

Re: how moodle checks the course duration of a manually enrolled user.

by Darko Miletić -


require_once($CFG->libdir.'/enrollib.php');

$end = enrol_get_enrolment_end($courseid, $userid);