How would you like to have a Hobby field show up in the Participants List in Moodle 1.9? Well it can be done! Charles Kelly of http://www.manythings.org has done it in his post here. The purpose of my blog post today, is to show you how to do it for your Moodle site.
What’s the benefit of doing this? In my humble opinion, knowing that you come from Melaka or Kansas City is not as interesting as knowing that you have a liking for Pink Floyd, Manchester City Football Club or body building. How can we do this? Two steps.
- Firstly, change the City field’s display name to “Hobby / Interest / Free Time”.
- Secondly, modify the length of City field from a measly 20 characters to a generous 100 characters.
Figure 1. What the Participants List looks like. Note that some users had earlier typed their City data since I only recently implemented the hack.
Figure 2. Editing your User profile.
Figure 3. what the Participants’ List looks like with ALL hobby data filled in my students. Nice, eh?
Like what you see? What do you think? Do you think that a Hobby data field makes the Participants list more interesting? Personally, I feel that if everyone were to be truthful and open to show others their hobbies, then the online community of your course page will get to know each other better. And that makes for a fun experience for your students.
First, we will need to change the display from the default “City” to “Hobby” something or other. For that, we have Charles Kelly to thank for! Please head over to:
These following instructions are from Charles Kelly’s webpage.
Add the following to the end of the file /lang/en_utf8, just before the ?>
// Hobby Instead of City CK 2007-03-29 $string['city'] = 'Hobby / Interest / Free Time'; $string['location'] = 'Hobby / Interest'; $string['missingcity'] = 'What do you do in your free time?'; // END OF Hobby Instead of City CK 2007-03-29
That was easy enough, wasn’t it?
Next, we will need to expand the database’s City field from the default and stingy 20 characters to a generous 100 character data field. The below link is most helpful. Especially the attached text patch file. Go to: http://tracker.moodle.org/browse/MDL-19629
Don’t faint, it’s easier than you think.
While it is easy to increase the limit manually, it requires altering several files and the database table, which makes maintainability over upgrades a challenge. To make the change, some minor surgery is required.
Edit these files at the line numbers indicated to allow for 100 chars in the city field:
\login\signup_form.php - line 51 \user\editlib.php - line 196 \admin\uploaduser_form.php - line 195 \lib\moodlelib.php -line 2998 You also need to increase the database field mdl_user.city from 20 to 100 characters using phpMyAdmin.
Have fun doing the micro-surgery hack on your Moodle 1.9.x core files. In the meantime, check out Moodle 2.3. She’s getting better and better.