Add custom CSS to your Moodle theme.

I’m just getting set up for a fringe session as part of JISC’s Discover-e 2013 called “The V Factor”. The session is going to be looking at how to give Moodle a bit more of a wow factor and in the first section I will be talking about how to add some custom CSS to your themes.

I thought I would post up a few resources for anyone who would like to take a look and maybe try this themselves. Remember that in order to do any of this you will need access to the Moodle folder on your web server as well as an admin account. Make sure you back up any files you edit as this can save any headaches.

You’ll need a plain text editor like Notepad++

My AutoHide CSS file for cleaning up editing mode.

My new Crumbs CSS file for polishing up the navigation breadcrumbs

You can follow the process on this video tutorial.


Try AutoEnrol 1.2 today!

AutoEnrol 1.2 Logo

 I’ve had some tremendous support and positive comments from the Moodle community since releasing AutoEnrol over a year ago. It’s clear that people are stretching the plugin and finding some pretty awesome uses for it and as such there have been a few features which seemed to be sorely missing from the plugin.

Earlier this week I released AutoEnrol 1.1 on to purely deal with some compatibility issues with Moodle 2.5 and this remains the current stable version.

Today however I am happy to present AutoEnrol 1.2 which introduces a whole raft of new features and remains compatible with Moodle 2.0 to Moodle 2.5. Here’s a run down of what’s new:

  • It is now possible to add multiple instances to a single course.
  • Added an option to give instance a custom label.
  • Filtering functions now allow for partial matches.
  • Expanded filtering functions to include email address.
  • Added an option to limit number of enrolments. 
  • By default, users are now only enrolled if they aren’t already enrolled on a course.
  • Individual users can now be manually unenrolled through Users > Enrolled Users.
  • Where a user has the “unenrolself” permission and users are being enrolled on “Loading the Course” they can now unenrol themselves from the settings block.

AutoEnrol 1.2 Form

The plugin is available as a Release Candidate from here: AutoEnrol 1.2rc2. As ever I’m really keen to get feedback on this release, so if you have any suggestions please leave a comment!

**update: RC2 now supports self-unenrolment.

Making the most of AutoEnrol

After a year of testing I added a couple of tweaks to AutoEnrol and officially raised its status to stable. Since then the plugin has had a good amount of downloads and I really want to thank everyone for their support!

Enrolment Plugin 101

As with any enrolment plugin in Moodle 2 the administration really occurs on a course by course basis. If you go to any course which you are a teacher on and have a look under the settings block you should see course administration – users – enrolment methods. This is a new interface in Moodle 2.0.

Enrolment Methods Page

Put simply, this page will explain how users are getting access to your course. If you look under the main table you should also see a drop down menu of possible enrolment methods you can add to a course.

If you select AutoEnrol and add it to your course with the default settings it will happily get to work enrolling anyone who visits the course as a student. In the example above you can see that Auto Enrol has already successfully enrolled 5,395 users onto the course in questions (a student help course).

Getting more from AutoEnrol

There are four optional settings for AutoEnrol which are controlled by a couple of permissions. These can be revealed by clicking the show advanced option.

AutoEnrol Configuration

The first is pretty straightforward and let’s you choose the role you wish to assign to users. This is set to student by default but I have changed this to teacher in the past for setting up sandbox courses and the like.

The next option defines when the user actually gets enrolled on the course. By default this is configured to enrol a user as they load the course, which is particularly useful when the user has been provided with a direct link from either another page or course or indeed an email. Sometimes however it is useful to have a user enrolled as soon as they log into the site, for example a student help course, and this configuration also supports that option. I would recommend using this option sparingly to keep log in as short as possible.

The Less Obvious Stuff

Group By is where the really advanced techniques start. It allows you to select a particular field from the mdl_user table by which to group your users. If you have accurate department information for example you could group members of staff by their department. At BSDC we store account type in the institution field meaning we can group users into Staff or Student.

Of course once your groups are in place you can use the grouping functionality in Moodle 2 to control what some users see such as staff-only content.

The final option builds on the filter and simply allows you to filter users by a specific string. So if I wanted to only enrol students on a questionnaire course for example I would group by institution and then filter by “student”. AutoEnrol will now only enrol students on to this course

Using these two options in conjunction with some good user administration will give you a great deal of control over who can access what.

Google I/O 09 – The Myth of the Genius Programmer

I’d thoroughly recommend watching this, it sums up a lot of my thoughts on working with the Moodle community.

It is such a natural thing to take feedback on your code personally but in truth working with the experienced folk at is a fantastic opportunity to develop your skills and recognise your weaknesses.

In ProMonitor the Course is King

When I first switched from teaching to development one of my biggest dislikes was having to manually transfer feedback from my Moodle Assessments to the student records on ProMonitor, the E-ILP system used at BSDC.

I’m now looking at the possibility of developing an Advanced Grading Method for Moodle 2.2+ which can be driven by the markbook structure in ProMonitor. My hope is that I can present the tutor with a form which matches up to their gradebook in ProMonitor 100%; something which 9 other colleges in the UK have expressed an interest in!

Today I have been looking at how the grading method will be related to ProMonitor’s database. Initially I was quite optimistic that it would be easy to select a course, followed by a unit, and finally an assessment which you wanted to use for the grading structure. This is a simple workflow which makes sense, but unfortunately it doesn’t reflect the way that people use ProMonitor.

ProMonitor's Course Structure
ProMonitor’s Course Structure

For example, if you have an option of three routes on the second year of a BTEC programme, the probability is that each route will share a large number of units. In this case you will have three ProMonitor courses each containing the same unit.

Unfortunately ProMonitor’s approach to solving this is to allow tutors to clone assessment units in the database. In order to allow tweaks and changes to be made to one and not the other these clones are duplicated in the database with no common identifier shared between them. Even if there was a common identifier it would not be sensible to assume the structure was remained identical on each unit. In other words we have to accept that the unit within each course unique.

Assessment Clones
Assessment Clones

The easy solution is to make my new grading method refer to one “course” only and expect our Moodle users to create separate assessment activities for each path of the course where they might not have done before. This is not ideal but at least gives us a safe fallback position.

One option may be to write a method of finding duplicated assessment structures and “undoing” the duplication within the database. The worry with this is that an assessment structure may change after the grading method has been added to the assessment which would lead to problems when trying to synchronise with ProMonitor.

The better solution may be to alter my workflow allowing tutors to add multiple courses/unit/assessments to the grading method and then dynamically switching to the correct one for each student. However, this raises the prospect that a student may have more than one applicable assignment, in which case we would need to ask the tutor which they would like to grade. Alternatively the student might not be enrolled on any of the assessments, in which case we would have to present the tutor with an error message.

Fingers crossed I can come up with something that works well for everyone!

Just a simple straw poll

There is a tendancy to over-engineer solutions in the Moodle community sometimes, and this tends to lead to confusing interfaces or even worse something that doesn’t work as it should.

I’ve spent most of the last few months writing local plugins for Moodle; the kind that have eight tables in the database and make your mind melt as you work on them. So when I found a bit of time I decided to create a simple straw poll block which would “just work”.

straw poll
A simple straw poll

A straw poll is a simple thing, and because it is in a block we know that there should be a limited number of questions. Equally I felt it was overkill to support the exporting of complex spreadsheets to show the results. A total and a percentage should be enough for any straw poll, and if you want more than that there is the wonderful Choice activity!

So I decided that the Questions and the Responses could all be held directly in the block configuration meaning the only table that would needed in the database would be for responses. This is more efficient since block configuration is already loaded and it cuts down the number of DB queries Moodle needs to do.

straw poll config
The configuration for the example poll shown above. Only the red fields need to be filled out.

The configuration for the block is very simple, with one text box for the question, six text boxes for possible options, and a few extra options to control how the user will interact with the block. The empty options are simply ignored by the block and responses cannot be submitted for them.

I will be submitting a Beta of this block to soon, but if you would like to try it out now you can download it from my GitHub repository.

Making Moodle’s forms less intimidating.

Forms in Moodle have always been a bit lacklustre. Whenever I am training staff on how to use them I have to admit that the forms “look scary but are mostly irrelevant” when adding new modules or editing course settings. Gladly this is all set to change with the upgrade to Moodle 2.5.

For those of you who haven’t looked into this too closely I should explain that Moodle uses a class called MForm to make it really easy to build forms in Moodle. These forms are then rendered in a pretty standardised way. In Moodle 2.5 these forms have been streamlined to hide the superfluous settings within an expandable tab by default

I had been looking at the possibility of writing a YUI module to take these mform pages and give them a tabbed format which highlights sections with required fields. But with these improvements it may be possible to do this with just CSS.

I will keep posting about my progress, but it occurs that there are a few difficulties which I am going to have to think about fairly carefully:

  1. MForms are not used everywhere that you would expect. For example when editing the settings on the front page of Moodle I was suprised to find that it presents itself without any fieldsets and without the standard mform classes.
  2. MForms are used where you wouldn’t expect. Right the way through the course import process the pages are dynamic mforms in two columns making the styling look slightly out of place.
  3. Not all required fields are required. By which I mean that you can create a completely useless instance of the “File” resource, but really we want the attached file to be highlighted to the user as a priority. Somehow this has been overcome in the new version of Moodle, but I’m not sure how dependable that is.

Hopefully I will be able to come up with a non-invasive solution for tabbed forms in Moodle!

Try out the Page Hints preview now!


Back in June last year I had the idea of developing a Moodle plugin which could be used to add information to a page allowing users to learn how to use Moodle “on the fly”. I came up with the slightly goofy name of Page Annotations and posted a new discussion over on receiving some quite positive feedback.

After that it all went quiet (sorry about that!), but you will be glad to hear I didn’t forget about page annotations. In actual fact I have been running an early version of the plugin on BSDC‘s Moodle site since September and have been looking for ways to improve it since then. Now called Page Hints, I have been working with the advice of Andy Nicols to improve the efficiency and compatibility of the plugin.


Once you have the plugin installed you need to look under Site Administration > Plugins > Local Plugins for the admin panel.



The management screen is basically just a table showing all your instances which can be edited, cloned, disabled or deleted at any time. You can also create a new instance by clicking on the “New Hint” button in the bottom right.



The editing screen is a form which auto-updates a hint on the screen as you make changes. Make sure you read the help information on the last “page filters” section as this is what determines where the hint will appear.

I can see a lot of room for enhancements to this plugin; making it easier for admins to add hints to any page and making it possible for teachers to add hints to their courses are high on my priority before this is submitted to’s plugin repository. That said the plugin is now quite mature, running on several production servers.

If you would like to take a Page Hints for a spin on your Moodle you can get a copy from my GitHub Repository. I’d love to hear your thoughts on what I have so far as well as any suggestions for the future.