Rewrite for Moodle 2.5