Moodle in Debian

Over the past few weeks, i’ve been working with Francois, Penny and Matt to take over maintaining the moodle package for Debian. Unfortunately the previous maintainer could not keep up with maintenance since some time ago, and the package was orphaned (awaiting someone else to take over caring for the package). Penny invited me to get involved & we’ve been hard at work since: Producing a huge security update to debian stable, getting moodle accepted into lenny – the next version of debian (by fixing outstanding bugs which blocked it from being accepted) and getting on top of the debian bugs which were outstanding.

Unfortunately debian was in freeze stage for lenny when we took on maintaining moodle, so we could not upgrade the version from 1.8.2 (however this is much better than 1.6 which is currently in debian stable). Its great to keep moodle in debian with security support and a lot of thanks is owed to Francois Marrier (the debian developer who has taken this on) to make this happen. I’m hopeful i’ll be able to buy francois a drink in thanks sometime soon. :-)

Personally, I use Debian in my leisure & working life extensively (indeed, its the platform we use to provide moodle for 1000 schools), its a project close to my heart (and saves me so much time) so i’m really pleased to be able to contribute back to debian (as well as moodle). I have been interested in getting involved with debian for quite some time – doing this as part of the moodle packaging team is a great way to begin to get involved.

I’m confident that the moodle community will benefit from increased exposure of debian bug reports and the closer exposure of perspectives of upstream distribution packagers will also help the moodle development community. :-)

Moodle & Mojitos

I was just reporting MDLSITE-594 and I noticed Mojtos in Martins profile interests. Mojitos have become somewhat of a moot tradition which i’ve also come to appreciate! In the current economic climate – its probably the most stable moodle development currency! :-P

So who is responsible for introducing the moodle’s premier cocktail & is there more to it than the first two shared letters? <

Rewriting history with git

On my home laptop I use git for personal projects and company projects, when using git I try to use the appropriate email address for task. [1]

On a project I was working on today I managed to forget to do this and made 20 commits in the wrong email address. Git is an incredibly versitile tool and I frequently find i’m restricted not by what it can do, but my knowledge of the tool which will help me! In this case it was git-filter-branch, which lets you rewrite history, in seconds.

I used the following to rewrite my email address from work to my personal email address

git-filter-branch --env-filter \
'if [ "$GIT_AUTHOR_EMAIL" = "dan@work" ];
then
export GIT_AUTHOR_EMAIL="dan@personal"
fi'

[1] Easily achieved by setting my work email in the global .gitconfig and per-repoistory config overrides for exceptions on personal projects (in the minority)

Edit:I forgot about the git committer field though, doh!

Moodle 2.0 and Googley Plugins

Early screenshot of Picasa Web Albums with Picasa Plugin One of the many major features in the Moodle 2.0 Roadmap is an overhaul to handling of the files in Moodle. The Portfolio (push from moodle) & Repository (pull to moodle) API’s allow for external systems to interact with Moodle and bring exciting new possibilities!

A few months back when Penny and the gang in Australia were working toward getting a stabilised API, I decided to test them out and try to develop plugins for Google Docs during a free weekend. I was really pleased about how easy the plugins were to develop and found the process very productive – I used the api in a slightly different way to existing plugins which allowed for additional testing and we collaboratively improved things.

The Google API’s are pretty simple to get to grips with – whilst there is a mammoth zend php library which will interact with google already, I wrote my own since I didn’t think we really wanted that much bloat in Moodle. All in all it was quite a fun experience, and I got mostly working portfolio and repository plugins with very little work.

Unfortunately with the repository plugin, ‘mostly working’ was as far as I could get.. I could browse my Google Docs from Moodle, narrow down documents by text searches of the document contents and even delete the documents if I wanted – but not download the document into Moodle. Which made the plugin largely useless.. There are a few open bugs for this and it seems google are working on a solution, but for the time being its a little bit frustrating. There is a workaround using a different method of authentication but i’ve not yet got that to work either.

At the time I didn’t commit my plugins to moodle and left them in my own git repository as I wasn’t happy with this situation, I also wanted to investigate if OAuth was worth using and rapidly became busy with other things.

This weekend I finally got some time to work on this again and get some of the work into moodle core.

For authentication, i’ve created the plugins using Google’s AuthSub (whilst keeping it pluggable), which still seems to be the best way of authenticating users for Moodle because:

    • It doesn’t require any administrator setup (registering, adding API keys/certificates etc)

 

  • It doesn’t make the user enter their google username and password anywhere other than google (I feel very strongly that this is security practice we should be encouraging)

OAuth looks pretty good and useful for authenticating with multiple services, but it’d require a considerable amount of administrator setup which I was keen to avoid in favour of the plugins being used ;-)

After a bit of tidying up and updating to match the recent moodle developments I’ve now commited the Google Docs Portfolio plugin. It allows images and documents to be exported to Google Documents in a basic manner. I’ve not found a solution to the google docs repository saving problem, but i’ve created a prototype which will just insert links to google documents (rather than embedding the content).

As the Google API’s are pretty consistent, most of the work I did creating a library for Google Docs could be used to create plugins for Picasa Web Albums in very little time, so i’ve also created plugins for Picasa too and these allow both import and export from Moodle to Picasa. It should be reasonably simple to make other googley plugins by expanding lib/googleapi.php.

I’ve made a hacky little screencast to show off these features at this early stage: