MoodleTip – Mass Assignation of Group Enrolment Keys

Source: http://i1.bibtopia.com/b/090m/41893090-0-m.jpg

I recently shared this upcoming adventure with using Moodle to facilitate 3000+ user completion of a Digital Citizenship course and assessment. While it wasn’t difficult to add 3000+ users to Moodle and assign them to specific groups, I didn’t see an easy way to bulk upload the enrolment keys for each group. In short, group enrolment keys were coming up blank.

So, the question in my head was,how do you mass upload enrolment keys for groups?”
The answer involved using PHPMyAdmin and taking a look at the Moodle SQL tables, in particular, mdl_groups. The path ahead might be described in this way:

One possibility is to export the MySQL table for groups, modify it in a dbase program (FMP) or spreadsheet (LibreOffice/Excel) add the enrolment keys, then reimport into MySQL dbase for the Moodle.

First, I exported the mdl_groups as a SQL text file for backup purposes.
 Then, I exported the mdl_groups table as a CSV file I could open in LibreOffice (or MS Excel for those of you still using that). First, I imported it:
 It looked like this in LibreOffice:
I modified the files manually (if I’d had Filemaker Pro handy, I could have done it more automated fashion but…I was doing this on Peppermint ICE Linux). I saved the modified CSV file so that it looked like this:
Notice that 5th column in the spreadsheet has the list of enrolment keys for each group. 
The next step involved EMPTYING the MySQL table entitled “mdl_groups” as shown below:
You’ll be asked the following…click OK.
Once the mdl_groups table has been emptied, I was ready to import the modified CSV file.
Once you’re done, you’re ready to see the results…
And, in the Moodle, it shows up like this:
Is there an easy way to get this done that doesn’t involve all these steps? If there is, I’ll feel foolish…but it was fun.
Back to watching IronMan 2…


Get Blog Updates via Email!

Enter your email address:

Delivered by FeedBurner

PingIt!
pingthis();

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

One thought on “MoodleTip – Mass Assignation of Group Enrolment Keys

  1. Anonymous August 16, 2011 at 3:40 am Reply

    UPDATE mytable set fieldname=enrollmentkey

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: