My students can't enrol on a course.
When the teacher can set up their enrolment key within their course. While in course: go to settings; under course administration go to users; under users you will see enrolment methods; under that you should see self enrollment (student); click on that and you will see where to type in your enrolment key. Next, the teacher will tell the students what the enrollment key is to self enroll.
If you have editing turned on, you will see an eye icon. The eye needs to be open for self-enrolment to be available. You will also so a tool icon that lets you specify the enrolment key. We need to use this to prevent public from entering courses (and in some cases accessing material we are legally bound to restrict access to)