Modified version for Moodle compliance