adited functions in moodle.js