OU blog

Personal Blogs

Devilish differences

Visible to anyone in the world
Edited by Sam Marshall, Friday, 15 May 2009, 17:50

(I thought I'd start with a long technical post just to scare off any non-geek readers! Well, maybe that wasn't the reason, but.)

My advice for any organisation that has developers working on customisations to Moodle code is to keep your changes to a minimum. Completely new code that plugs in - new modules, new admin reports, new blocks - is fine, go crazy. But try as hard as possible not to change existing Moodle core code, even if that means telling your users 'no we can't do that'.

Here's where it came up this week - our quiz module. Oh, dear gods, our quiz module. I'm not particularly enamoured of the fact that we've renamed it 'iCMA' (obviously somebody thinks that's a much snappier name than 'quiz') but hey, that was a local language file, so it didn't cause a difference from Moodle core code. Great!

Unfortunately the eighteen million other things we've changed in quiz did cause a difference from Moodle core code. We have custom navigation, custom statistics, custom reports, custom interface, custom question banks, custom grade calculation, custom ARGH. Some of this is kind of based on work which we were sort of hoping would go into Moodle 2.0 and become standard. But what's actually ended up in Moodle 2 is probably going to be a bit different, won't cover all of it, and is still at least a year away! (From becoming the OU's Moodle platform, that is. I'm not speculating on the public Moodle 2 release date. If you need more information on that, please see this definitive reference.)

The changes to our quiz module are so significant that - unlike every other area of code - we've given up merging bugfixes and other modifications from the Moodle 1.9 'stable' branch - there are so many changes it's impossible to merge without somebody completely expert in the system. While the rest of our platform is just moving to 1.9.4, I don't know where the quiz is, 1.9.1 with bits of 1.9.4? Nightmare.

In this particular case somebody was a little bit over-eager when merging in the 1.9.4 changes. They noticed that one file in quiz actually didn't have any OU custom changes! What an opportunity! So they merged the core changes for that file.

Unfortunately, that file turned out to call a function in another file - which had been newly added in 1.9.4, but hadn't been merged in, because the myriad OU changes already in that file made it too complicated.

For now I have fixed this by de-merging the changes and going back to the older version, which presumably means that we are again suffering from a bug which is fixed in standard Moodle. Yay.

So in summary, this is what we did. Don't do it.

Oh and the solution above might sound a bit short-term, but no worries - I have a long-term plan too. It is 'Wait for Tim to get back here and let him fix it'. smile

Share post