Moodle plugins directory: AutoEnrol | Moodle.org

AutoEnrol
When added to a course this enrolment plugin can enrol users onto a course automatically, either as they log in to your Moodle site or as they access to the course.
It was at first intended for use on site-wide courses such as "Moodle Help" or "Learner Voice".
In addition the plugin has advanced functionality to support automatically grouping and filtering users based upon their profile fields. Depending on how your user accounts are setup this may help you to give access to certain user groups.
Configuration of the plugin is managed by two capabilities which allow administrators to easily control who has access to the plugin.
New advanced user filtering (available from 2.3)
A complete rewrite of Autoenrol filter that use moodle standard availability interface adds great flexibility in user filtering.
The Moodle availability plugin for user profile fields unfortunately does not include language and authentication.
If you need them, you can install additional availability plugins like Restriction by language and Restriction by authentication.
the AutoEnrol filter use Moodle availability plugins, the same you can use to limit access to activities so your answer is: yes, you can do.
1. If you want, you can add one by one rules for all the usernames;
2. more easely you can add a filter rule that check profile field username that start with "20" to match 20smithj and any other student that has joined in 2020).
1bis. You can also add availability plugins that match your needs.
I developed an availability plugin that get an excel file with the list of users that could be allowed or denied (https://github.com/bobopinna/moodle-availability_esse3enrols).
HTH,
Roberto
Thanks so much.
The esse3enrols availability plugin looks interesting.
1. When combined with 'AutoEnrol' can it auto-enrol users to every course that uses it as soon as they login to Moodle? Or do they need to click on each course to enrol?
2. Could you provide an example of the Excel format? I have seen the instruction 'a custom Excel file with a column header that match with the Moodle admin selected field name.' but I'm not sure what that means.
Thanks,
Nick
you can set AutoEnrol to enrol users on login or when they click on each course, availability plugins are used to check if they can be enrolled .
Please be aware if you set autoenrol on login in several courses and your site has a lot of logins each day. This could slowdown your site performances.
If you use username as profile field in Esse3enrols and your user language is english, you can write something like this in your Excel file:
username
20woodr
20rushh
20soong
20smithj
The column header is the translation in the uploader user language of the field name.
HTH,
Roberto
I have 5 different Courses. and after completing all of them "Course Complete" should get a check.
And it was working fine but since last few days its not working.
Earlier it was set that students will get access to 3-4-5 only when they complete 1 and 2. Auto access to 3-4-5 was not allowed. But then recently that was changed and set to all courses will be given to student at once.
Now the issue I am facing is, student have completed 1-2-3-4 yet there are no check box checked in front of their names in Course 5, being more specific, sometimes, some of them are checked and sometimes none of them. Check box are checked in each Courses (Lets say, a student enrolled for all, and have completed 1 to 4 and in each course report it is showing that they have completed this course and shows checked box but in 5th course it doesn't show check box checked.) Because of this no student is able to get a certificate. Can you help?
The Auto Enrol plugin must be enabled after installation.
Go to
Site administration -> Plugins -> Plugins overview
The plugins are grouped under various headings/types.
Find the Enrolment methods heading.
Next to that heading will be a gear icon.
Click the gear icon.
You will see a list of Available course enrolment plugins.
The Auto Enrol row will be greyed out.
Click the "eye" icon to Enable the plugin.
Now, go to your Course.
Click the gear icon dropdown. (In 3.9 it is above the "Turn editing on" button.
Choose "More ..."
Choose the "Users" tab.
Click "Enrolment methods" (the heading in the left column).
In the dropdown next to "Add" select Auto Enrol.
Thanks for such a cool plugin.
Tell me, please, how can I add the "position" field in the application, because when choosing fields, it is not there and is most likely not available on the platform either.
It turns out that you first need to add this field through the administration panel so that timing data is recorded there? And then it is already expected in the course auto-assignment add-on?
I'm sorry but I didn't find any reference to a "position" field in Moodle.
The user database table does not include it, and if you don't have a user profile custom field called position I don't think you can manage it without an additional availability plugin.
I suggest to you to search for an availability plugin that check the "position" field in order to use it with autoenrol.
HTH,
Roberto
Can you tell me more about the accessibility plugin.
I have LDAP connected on Moodle, and all employees have a position field. I created a custom field "position", but I don't know how to automatically pull it into this field, maybe you know how to do it?
if you have created a custom field for "position", you just need to map it from your LDAP connection.
You can look at https://docs.moodle.org/402/en/LDAP_authentication#Custom_User_profile_fields for details.
If users position change time by time I suggest to update local on login so each time the user login Moodle gets data from LDAP.
After that you can add a user filter with the custom filed to Autoenrol with without any other availability plugin.
HTH,
Roberto
I try to enrol today but I will enrolled from tomorrow.
You can't do that with autoenrol, you need an other enrolment plugin to do that.
I don't know if someone has already developed something like that but it could be done so if not you can develop it by yourself.
HTH,
Roberto
you can use custom field with auto enrol but profile field availability plugin does not support date custom fields.
I submitted an issue in Moodle Tracker (MDL-72083) a couple of years ago but it still opened.
You can vote for it in order to promote the development.
Cheers,
Roberto
User Filtering --> Group By (User Filter) --> Group Name (some value)
It should not try to make an entry to the group every time the user logs in.
Error Message:
[Sun Nov 12 03:32:37.028814 2023] [php:notice] [pid 3214911] [client 76.66.101.94:53101] Default exception handler: Error writing to database Debug: Duplicate entry '3-618' for key 'm_groumemb_usegro_uix'\nINSERT INTO m_groups_members (groupid,userid,timeadded,component,itemid) VALUES(?,?,?,?,?)\n[array (\n 0 => '618',\n 1 => '3',\n 2 => 1699759957,\n 3 => '',\n 4 => 0,\n)]\nError code: dmlwriteexception\n* line 497 of /lib/dml/moodle_database.php: dml_write_exception th