I have a specific class that has an enrollment duration for x number of days. The problem is after that day comes, the student remains enrolled in the course, and can still log in. It even shows on their profiles that their enrollment expires on a certain date.
Yes, the student is only enrolled in one particular course, and are assigned as a student in that course. My global settings have the default role for all users as "authenticated user," and default role for users in a course as "student."
So far, this is when I manually enroll a student and assign the enrollment duration there, they do not get automatically removed. I have tried to use this for "trial" access to a course.
I don't know about the other/regular students, though, because our courses by default have a 1 year enrollment, and none of them have run out yet. But, I wonder about that...
Oddly, the one I had enrolled for a given period was removed when I just checked. But it wasn't after the number of days I thought. Perhaps it adds a grace period? Or maybe I did something wrong.
If I figure this out definitively, I will post back.
Can you tell me if I can apply that to site users in any way ? Because when Students get "kicked out" of a course, they still figure in the users' list.
Or do we have to delete them manually, finding out who is who (I cannot see directly if the user is enrolled in any course) ?
Thanks for the help,
PS I know this is not the discussion, but if anybody knows how to avoid that people register for the site without enrolling any course....
Enrolment duration seems to be working correctly for me at the course level. However, I have set an enrolment duration for an 'examinee' role for access to a quiz, but the student is not removed even after running cron.
Most discussions and documentation seem to be concerning enrolment duration at the course level. Can anyone help with getting this feature to work when setting enrolment duration within an activity such as a quiz?
I am facing a similar problem to yours and it is very frustrating. I set the enrollment duration to 2 days and created a student account to test it. At the end of the enrollment duration, I can still log in and see the lesson. I am only using the internal enrollment plugin with moodle . I am a new user and I hope you can share with me what you did to solve it or anyone with a clue as to what the cause of the problem is. The default role of users are student. Thanks.
Try run the cron job. Login as an admin and go to the notifications. Here is the direct link.
This the sql that checks who to unenrol:
SELECT ra.roleid, ra.userid, ra.contextid
FROM m_course c
INNER JOIN m_context cx ON cx.instanceid = c.id
INNER JOIN m_role_assignments ra ON ra.contextid = cx.id
WHERE cx.contextlevel = '50'
AND ra.timeend > 0
AND ra.timeend < '1305815055'
AND c.enrolperiod > 0
If the course setting for enrolment duration is 'unlimited' then the value is 0 and nobody will ever be unenroled.