Recently, I shared this Moodle Tip on how to make changes to MySQL database in Moodle to facilitate creation of enrollment keys for multiple courses. I realized I hadn’t shared this with the MoodleMayhem email list, most of which I would guess know how to do this. Of course, it’s easy to assume others know stuff when they may not (happens to me all the time).

Here is the email I shared:

Thought I’d share this with the list members…since we had lots of Moodle courses without enrollment keys, were bringing on students who could “enrol” in any course, we needed to quickly add enrollment keys. Rather than going one by one, there is a way to do it via MySQL. It wasn’t hard, but for those who aren’t familiar with it…

Read the details online at:

One response was this one from Moodle Mayhem member, Jeff K.:

Thanks for this. So then, you set a single enrollment key for all courses that did not already have one? If so, will you now notify teachers, and if so, how will you do this efficiently?

My response follows below:

 Here’s what we did:

1) After doing the enrollment key replacement, delete all “old” student accounts. In our case, it’s “” so it was pretty easy to do a bulk delete of all 6K accounts that had been created over the last few years.

2) Clean out old course instructors/teachers…I went back to anyone who hadn’t logged in since June, 2009.

3) Create a new course called “Teachers’ Lounge” and subscribed all remaining users (which all instructors).

4) Sent out a news forum post/update to all subscribed users notifying them that their courses now have enrollment keys.

And, that’s that!

I thought it was a nifty solution that didn’t take long to implement…and I couldn’t help but wonder why we hadn’t set something up like that before! How would you have done it?

Subscribe to Around the

Everything posted on Miguel Guhlin’s blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure