Archive for the ‘Open Source’ Category

Bugs, Patches and Open Source

Saturday, July 19th, 2008

moodlepatch.jpgOne of the requirements of my project is to develop the stats and visual plug-in for Moodle 2.0, a version of Moodle witch is still under development. This means that if done right my plug-in will be compatible with the new release of Moodle once it comes out as well as take advantages of the new functions and frame works that are being added and are introduced in PHP5 (Moodle 2.x is moving from PHP4 to PHP5). However it also means that some of the functions i am using from the Moodle frame work are still buggy and at rare times new bugs are introduced to the development branch as the core developers work towards the new release.

Such seems to be the case tonight where a new bug showed up once i updated from development branch and all of a sudden the group (class/course sections) functions started messing up in my plug-in. After searching my own code for some time, thinking it was something i changed, i traced the bug back in to the Moodle core functions where there was a check that was failing as a side effect of a change to a seemingly unrelated piece of code.

So i whipped up a bug report and a patch to fix the bug and summited it to the Moodle tracker in the hopes that some one would look over my report in a day or two and look in to it. After all i was posting it at 3:37 AM on the week end, however to my amazement 30 minutes latter my report had been looked in to, commented on, a patch (based on mine but better) was committed to the development branch and the tracker issue was closed.

This is one of the reasons why i love the Open Source Ideology so much. In a closed source corporate environment a bug like this could take days to get from begin reported, to being looked in to, to being fixed (especially since it was reported early in the morning on Saturday) causing untold amount of frustration to the users and delays to developers working on the code effected by the bug. If Moodle was closed source software for witch i was creating the same plug-in from a limited plug-in API available to the public my bug report would have not be any where as nearly detailed in to the cause of and how to fix the bug and would be limited to simply saying “hey X is not working for some reason” and i deftly would not haven been able to give a patch that the core developers could base a fix on, causing lost man hours for the payed developers looking in to and tracking down a bug in a vague report that could be better spent.

There is also a great feeling knowing that you where able to help out an Open Source project and that your patch (as simple as it may be in this case) got in to the code base and will help others. It is also great thing to be able to fix the bugs you come across in software, change it in any way you may feel like or just see how things work under the hood.

Now if i could only get the bugs in windows mobile on my phone fixed….

CVS, Demo and a Bug

Tuesday, June 17th, 2008

I have committed the code for my first version of the report/stats plug-in to the Moodle cvs (in the contrib module). You can brows the contrib cvs files here or you can download a copy of the nightly build of the stats report at http://download.moodle.org/plugins/grade/report/stats.zip.

There is also a public demo online located at http://compsci.ca/~dan/moodle/. You can login as a guest, go to a course, click grades in the lower left hand menu and then select stats report in the drop down menu at the top left to see the stats report. You may also create an account and sing up as a student to see how tasking some of the tests effects the stats report.

My latest development efforts where slowed down some what due to a new bug creeping in to some of the core Moodle 2.0 code and everything breaking for me once i updated to the latest version threw cvs. Lucky i was able to report the bug and submit a patch to fix it and it was added to the cvs so everything is back to working. You can find out more about the bug at http://tracker.moodle.org/browse/MDL-15253. It was not much of a patch (just changed one line) but it is kind of cool seeing your bug report and patch get in to an open source project.

For up to date information on the project including cvs commit messages you can view the tracker issues and sub issues set up for it at: http://tracker.moodle.org/browse/CONTRIB-477 (report/stats sub task here).