General developer forum

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

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

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: -
Picture of Bernard Raja
Re: how moodle checks the course duration of a manually enrolled user.
 

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

but unable to crack the requirement. 

 
Average of ratings: -
Picture of Darko Miletić
Re: how moodle checks the course duration of a manually enrolled user.
Core developersParticularly helpful Moodlers


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

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


 
Average of ratings: -