Mar 6 2009

Ooops…

A critical bug has been discovered in the module Course ordering and invoicing. The recently added VAT calculation support did not work correctly, leading to wrong VAT calculation. See details in CONTRIB-1091. Looks like an omen for me to start unit testing massively ;-) . Hopefully Moodle 2.0 seems to support mock database connector which should make the thing easier.


Feb 18 2009

Moodle site hacked

As reported in a community support forum at http://moodle.cz, at least one Czech Moodle site has been hacked, probably because of the recently discovered vulnerability in Snoopy library (announced in MSA-09-0003). Well, the hacked site was running Moodle 1.5 which I consider hazard. But the exploit exists for all currentMoodle versions. Upgrade to the most recent weekly build is warmly recommended.

Strange feeling to realize (again) that a bad guy lives next door in this global village…


Feb 17 2009

Course contents block

I published a simple Moodle block called Course contens. It generates a list of all visible topics/weeks in the course. Clicking at one of these links displays that particular week or topic. What I needed to solve was how to automatically obtain a title for every course section.

The block extracts a suitable title for every week or topic from the section summary. If you start summary with a heading (H1, H2, H3, etc), it will use such heading text. If your summary starts with a bold text, it will be used as a section title. If the summary consists of several paragraphs, the first one will be used. If the summary is empty, a customizable text “Unit X” (where X is the number) is displayed.

Technically spoken, the plain text content of the first non-empty HTML DOM node of the section summary is used as the summary title. I realized that Moodle 1.9 does not contain any HTML parser so the block source code is shipped with a its own Simple HTML DOM parser library (credit goes to S. C. Chen and other contributors).


Feb 5 2009

Group selection module

My work on the autosave support has been postponed (see the tracker for details) so I decided to look at the Group selection module. During almost the whole Moodle history there were some patches available allowing students to select their group themselves. But as the group API has changed several times in the recent versions (…or There and Back Again ;-) ) these patches do not work any more. Also, for a long time it wasn’t clear if this should be a part of groups UI or a separate activity module (eg. integrated into Choice).

It seems to me like a good decision to implement this as an activity module. Together with groupings, this for example allows to have a group selection as the first module in every topic section. And after a student chooses her group (imagine a work group, project role etc.), the rest of activities relevant for this group automagically appears (since they are available only for selected groupings). This allows course creators to desing inetractive non-linear courses. I can imagine this become part of 1.9.5 in case of strong demand. Check and comment MDL-1310.


Jan 30 2009

TinyMCE is the project of the month at SourceForge.net

The default Moodle 2.0 wysiwyg editor – TinyMCE – has been chosen as the Project of the Month (January 2009) at SourceForge.net. TinyMCE is 100% JavaScript based product with the ability to convert standard HTML TEXTAREA fields to “wordpad-like” editors embedded into the web page. More about the project, its history and backgrounds at SF.NET.


Jan 25 2009

Autosave support for Moodle HTML editor

I started to work on autosave support for Moodle 2.0. It uses AJAX call to periodically save the content of a given textarea/wysiwyg field into a temporary area. It may be used to backup forum posts, quiz essays, etc. on the fly during the text composition. It should help avoid data loss in case of accidental browser crash or close, pressing “back” button , lost connection etc.
At the moment, several design decisions are needed. I am waiting for the feedback and comments from the core team. Check MDL-18014 for more information.


Jan 22 2009

Forcing Moodle and any other PHP application to always display errors

Again, I ran into situation when a very o{l|d}d installation of Moodle displayed just an empty page instead of a useful error message. That’s why I again had to play a bit with all these error_reporting and display_error settings. Let me summarise how it works – at least as far as I know.

There are basically four places where PHP configuration parameters can be defined: 1) php.ini, 2) httpd.conf 3) .htaccess and 4) source code itself.

The file php.ini contains site-wide PHP configuration. You can define parameters by assigning them a value – eg display_errors=1

PHP configuration can be defined in Apache configuration as well (either in httpd.conf or a sub-config file included by it). This allows you to redefine defaults from php.ini for a particular directories. You can use statements like php_flag to php_value do it. Or, you can use php_admin_flag or php_admin_value to do the same with the exception that the later form can not be redefined at a lower level again.

If you have “AllowOverride Options” defined in Apache for the given location, you can use .htaccess files to redefine PHP settings. The statements php_flag or php_value can be used in .htaccess files. The forms php_admin_* are not supported at this level.

Finally, you can modify some settings by ini_set() or error_reporting() PHP commands. It seems to me that these are at the same level as .htaccess is. I mean – IMHO there is no way how to disable ini_set() in .htaccess.

What I needed was to disable Moodle code to call error_reporting(0) and ini_set(‘display_errors’, 0). Therefore I had to go a relevant httpd.conf section and use

php_admin_flag display_errors on
php_admin_value error_reporting 2147483647

With this settings, neither .htaccess nor source code itself is able to hide any error message any more.


Jan 17 2009

We have moved – back to work!

Finally we have moved into our new flat. In one of these paper boxes we are currently living among, I managed to find my notebook. Using the biggest box as a table I am able (oh – a rhyme!) to contribute to Moodle again. Yay!

I started with the Czech language pack update. There was couple of missing new strings. A new gradebook display type combining letter and percentage value made me happy – that is exactly what I needed this week at the school (there is a mid-term now in Czech).

I plan to finish my recent work on the language statistics tools and start to work on a completely new language translation UI. A lot of ideas in my head – let us put them to the HEAD :-)


Dec 31 2008

git experiences

Recently I spent many hours reading git user’s manual and experiencing git-merge and git-rebase. Thanks to Nigel’s and Penny’s comments, I hope I can see differences between these. Hopefuly I’ll be able to maintain my adminlang repo effectively.

Still, I would like to find what procedure to take when porting a fix from one branch to another. Is cherry-pick intented for this?

Also, I found an interesting note about using git-format-patch | git-am to massive port from a branch to another.

Git is cool :-) Can’t wait Moodle switch ti it as well…


Jul 27 2008

I have switched to “G”

Recently, I bought a new notebook – pretty nice Lenovo R61. It was a great opportunity to make some changes in my working environment. Firstly, I switched from Slackware to Gentoo. I have already been compiling a lot of apps from source code so it was very natural step to start using this GNU/Linux distribution. And I was very surprised by the performance, really. OpenOffice.org start up almost instantly ;-)
Also, I left KDE and I am not looking back. I found Gnome more user friendly in some important details, eg. bookmark feature of open file/directory dialogue etc.
As the notebook is equipped with a powerful graphics card, I decided to try and installed compiz-fuzion. Of course, I can live without but it’s nice to show when it comes to comparison of my GNU/Linux box with someone’s Vista ;-)
All good things are three. Thus, I changed the hostname of my notebook from preciousss to gollum :-)





film streaming sur Megaupload