Teaching tips and tricks
From MoodleDocs
How can I force automatic course enrollment?
You can link to a course in an HTML block, using the resources drop down or indeed any other method and then use the following URL (where 999 is your course ID):
http://yourmoodlesite.com/moodle/course/enrol.php?id=999&confirm=1