Code for Moodle plugins