From Carleton Moodle Docs
Why use an enrolment key?
A course enrolment (or enrollment) key is one method of restricting Self enrolment to a smaller group. The default setting is not to set a key and allow anyone to enrol themselves into the course.
An enrolment key is often used as a simple method of having someone else beside the teacher determine if a particular student can self enrol in the course. The idea is that one or more people will supply the course key to authorized people. Sometimes this distribution is private email, snail mail, on the phone or even verbally in a face to face meetings such as a class or counselor's office. Alternatively, a Keyholder role may be created and assigned, then the text 'You should have received this enrolment key from...' will be displayed when a student attempts to enrol.
Setting an enrolment key within a course
- In the course administration block, click Users > Enrolment methods
- Make sure self enrolment is enabled (has its eye open) and then click the edit icon on the right.
- Add your enrolment key in the box provided. (Click Unmask to see what you are typing.)
- Click the 'Save changes' button.
Setting a group enrolment key
- It is possible also to enrol students into the course and also directly into groups by use of a group enrolment key.
- To do this, you first need to add the course enrolment key as in the section above.
- If you do not set a master course enrolment key for the course, then anyone can enrol without a key and users will not be put into groups.
- Users in groups do not need to know the master course enrolment key, only their own group enrolment key.
- Users not in a group can use the master course enrolment key as usual
- Change the setting Use group enrolment keys to Yes
- Save the changes and then in the Course administration settings, click Groups>Create groups
- Add an enrolment key to the group. This will be the key they type in to access the course. (The course enrolment key is simply there to keep others out)
Note: Be careful not to use the same enrolment key for more than one group! A warning message will appear 'This enrolment key is already used for another group.'
Tips and Tricks
- If the enrolment key for a course "gets out" and unwanted people self enrol:
- Changing or placing a key does not impact currently enrolled students, nor does it impact students who may also be enrolled by an enrolment plugin.
- Guests may (optionally) be required to supply the enrolment key (as specified on the Course Settings page). They will be required to supply the code every time they enter the course.
- The "No" or "Date range" options in the "Course available" setting effectively disables the enrolment key feature, even if it is set.