An LDAP profile field feeds the user identifiers coded in their profile on Moodle.
Structure of a 7-digit student code (ID number):
Goal: automatically enrol users in course X according to programme code 40 to 45.
Example of the expression to use, written without spaces:
REGEXP:^[0-9]{3}(40|41|42|43[44|45)
or equivalent:
REGEXP:^[0-9][0-9][0-9](40|41|42|43[44|45)
Here we start after the 3rd character, i.e. after the digits that correspond to the year of enrolment at the school, and we enrol the students for whom 40 to 45 is found in the student code.
Careful: it is important to place the rule on a non-ambiguous element
Example: In case of different ID lengths, for example for different users, and by invoking two enrolment methods in the course with different regular expressions, you will have to check for non-collisions.
Back to the component index - Back to catalogue - Back to plugins index - Index of plugins on enrolment methods