Moodle APC

This ‘Speed up Moodle’ series of 4 posts will teach you step-by-step how to optimise your Linux server for Moodle. It is aimed at beginner server administrators. If you find any mistakes or inconsistencies, please comment and I’ll rectify ASAP. This fourth post is about enabling APC, an opcode cache on your server, probably the easiest and most efficient step to increase server performance.

Continue reading

Non optimized Moodle servers can crash under light load

This ‘Speed up Moodle’ series of 4 posts will teach you step-by-step how to optimise your Linux server for Moodle. It is aimed at beginner server administrators. If you find any mistakes or inconsistencies, please comment and I’ll rectify ASAP. This first post is about optimising Apache for Moodle. Check out the other posts on optimising MySQL, installation of an opcode cache such as APC and other ways to optimise your Moodle server. Please see ‘Assumptions’ and ‘Technical notes’ at the bottom of this post.

Continue reading

How to add Google fonts to TinyMCE editor in Moodle

Google has made it easy to use great looking fonts on websites, providing over 600 cross-browser fonts to date, for free. In this short post, you will learn how to add Google fonts to the default Moodle HTML editor, TinyMCE.


  • To complete this tutorial you must be able to login to Moodle as an administrator.
  • You will also need access to the files on the server (FTP or SSH access).
  • This tutorial is for Moodle 2.3 or above (it can be done for Moodle 2.0, 2.1, 2.2 and I’m happy to extend this blog post if someone asks me for it).
  • Adding Google fonts will have a slight impact on page load time (not noticeable in most cases). The more fonts you add, the more significant the impact.
  • This tutorial also works for other Web font services such as FontSquirrelTypeKit, Adobe Edge fonts, etc.
  • Although I have never noticed any problems with this technique, don’t come and blame me if it breaks something in your Moodle installation 😉

How to add Google web fonts to Moodle TinyMCE editor

1. Go to the Google fonts page and find a font you like

Google fonts for Moodle

Click to zoom in

2. Click on the ‘Quick use’ icon (you can click ‘add to collection’ if you want to use more than one font)

Quick use google font for Moodle

Click to zoom in

3. Scroll down to the ‘Add this code to your website’ section and copy the text in the ‘Standard’ box

Select text

Click to zoom in

4. Scroll down to the ‘Integrate the fonts into your CSS’ section

Integrate the fonts into your CSS

Click to zoom in

5. Copy all text after the colon mark, but remove the quotation marks and the semi-colon

Clean text to be copied

Click to zoom in

6. In Moodle, go to ‘Administration > Site administration > Appearance > Additional HTML’
7. Paste the text you copied in step 3 of this tutorial

Additional HTML in Moodle

Click to zoom in

8. Scroll down and click ‘Save changes’
9. Go to ‘Administration > Site administration > Plugins > Text editors > TinyMCE HTML editor > General settings’
10. Scroll down to ‘Available fonts list’
11. Type a semi-colon mark (if not already there), a name for your new font (this can be anything) and an equal sign
12. Paste the text you copied in step 5 of this tutorial (make sure there are no quotation marks)

Adding a Google font to Moodle

Click to zoom in

13. Scroll down and click ‘Save changes’

14. Open the /lib/editor/tinymce/lib.php file for editing

Lib file for TinyMCE editor in Moodle

Click to zoom in

15. Locate ‘$contentcss’ and add a new line following the example below. Replace the bit in pink with the text you copied in step 3 of this tutorial. Note that there are two fonts available in the example. Also note the dot and comma.

Extend CSS for Moodle to register Google fonts in TinyMCEClick to zoom in

16. Save and close the file

17. (optional) Purge all caches at ‘Administration > Site administration > Development > Purge all caches’

18. Your fonts are now available anywhere TinyMCE is present. Enjoy!

How to add Google fonts to Moodle

Click to zoom in 

 Note: I have not yet been able to get this to work using the ‘Custom CSS’ available in some themes. Has anyone done it?


Moodle 2.5 was released a few weeks ago, allowing for Open Badges integration. Quite a few readers have asked me whether there remains a point of using labels for badges, now that Open Badges can easily be integrated with their Moodle courses. In this post, I try and outline why I have been gamifying my courses with labels, and why using labels for badges still makes sense for some users. This is week 11 of my ‘gamified Moodle course vs. non-gamified experiment‘.

What is Open Badges

Mozilla Open Badges

There have been a few great blog posts (1,2) written about Open Badges and Moodle. As explained in this Wikipedia entry, [quote]Open Badges is a program by Mozilla that issues digital badges to recognize skills and achievements. The badge structure allows one to display real-world achievements and skills which may help with future career and education opportunities.[/quote]

Why not simply use Open Badges

Moodle label badges and open badges

I am not stubborn, I think Open Badges is a project full of potential! Timing was the real issue. I started ‘gamifying’ my courses long before Moodle 2.5 was released, about 18 months ago in a bid to increase engagement in my courses. My ‘hack’ was never intended to compete with Open Badges, I only thought it out to bridge a gap. Now that I have used labels for badges for a while, I believe I am going to use both systems in parallel, as they serve a different purpose in my everyday teaching.

1. Works with any version of Moodle 2

Moodle 2 versions

A lot of institutions have upgrade policies that dictate when software can be updated to the latest version. Some institutions even prohibit software to be updated during an academic cycle. I also know quite a few Moodle administrators who refuse to update to the latest major version until all of the major bugs, found post-release, are ironed out. Last but not least, some of us rely on third-party plugins that don’t always get updated promptly for compatibility. All, or some of these reasons will prevent a significant number of Moodle administrators to update to Moodle 2.5 or above for a while yet. My ‘hack’ works with any version of Moodle 2, but doesn’t work on Moodle 1.9.

2. No reliance on the Moodle administrator

enable badges

In Moodle 2.5, the Open Badges integration can be disabled altogether by the system administrator. This may happen in institutions that want to keep complete control over the the ‘certifications’ they award. There is also a useful set of new permissions to granularly allow/prevent users to create, view and manage badges, which means not all teachers may be able to create and issue badges. With my ‘hack’, unless the administrator has disabled labels (more than unusual), nothing should stop teachers from creating their own badges.

3. More suited to link to existing reward system

Open badges backpack

Once awarded, Open Badges may go into a ‘backpack‘, which makes the whole system appear rather ‘official’. I view Open Badges as a system to show that specific skills have been acquired/mastered by a student. I can see myself using only a few Open Badges per course, for fear to devalue the system. Some of my current ‘badges’ reward some pretty low level achievements, and I do not think they would have their place in student’s Open Badges backpack. I have been able to tie in my ‘badges’ system to our existing whole school reward system, whereas I don’t think Open Badges would work with it. I wouldn’t award enough badges, or at least not regularly enough and it wouldn’t help with my goal of increasing student engagement.

4. Ability to hide badges, per badge

Hidden badges

I may be wrong here but I believe it is only possible to show/hide all available badges with the Open Badges Moodle integration (through this capability). With my system, badges can be hidden/shown until they are unlocked on a per-badge basis, using the ‘Restrict access‘ option.

5. Checking badges is a passive process

With the Open Badges Moodle integration, a user needs to visit a ‘badges’ page to view their badges, or access their profile page where all badges are shown. There is a block that allows users to see their latest badges, but not all badges are shown at once. With my system, there is no need for a user to visit their user profile to view all of the badges they have been awarded.

6. Open Badges are linked to a user profile

Open Badges Moodle profile

By default, with the Open Badges Moodle integration users can see each others’ badges through profile pages. Whilst this can be changed by editing the permissions, it can be an issue in some school settings. In my system, badges are not tied to a user profile.

7. No design limitations for badges

When a teacher creates an Open Badge in Moodle, there are design restrictions such as the type of image allowed (only .jpg and .png are allowed), and once uploaded badges are cropped and resized if necessary.

With the ‘labels for badges’ system, there are no restrictions as to what badges are, as long as it can be displayed in a label (i.e. any valid HTML). For example, any type of image is accepted .svg for retina ready displays, .gif (animated, for little ones), etc. Badges can be text, videos, etc.

8. Both systems can co-exist

As mentioned at the beginning of this post, both systems can co-exist and even complement each other. I am planning on using Open Badges for more official, assessment linked badges, or skill-based evidence and my system for less official and more frequent rewards.

Features unique to Open Badges

Here some of the best features of the Open Badges Moodle integration, that are simply not possible to replicate with the ‘labels as badges’ system (bar going into the database).

Manually award badges to users

With the Open Badges integration, teachers (or others with the capability) can award badges manually. My system cannot do that, unless a teacher maitained checklist is created.

See badge recipients

With the Open Badges Moodle integration, a teacher can easily view a list of users who have been awarded a specific badge, along with a timestamp.

Message user when badge is awarded

A notification is sent to users when they have been awarded a badge. This could be useful in other areas than just badges, but that is another debate.

Any/All activity(ies) for completion criteria

The completion criteria to a badge is better than the overall completion criteria for Moodle activities. Badge creators can decide whether a badge is earned when any or all conditions are met in a list of conditions. The normal completion criteria across Moodle is all or nothing.

I can see both systems happily co-exist in my day-to-day teaching. What are your feelings about Open Badges?