Archive for November 6th, 2008

Custom script Moodle groups

Thursday, November 6th, 2008

Created custom script in <moodleroot>/local/cron.php which enrolls users in a course and puts users in groups in depending on custom user profile fields set in Moodle. To enrol participants in a course, I use the role_assign function from accesslib.php: role_assign($roleid, $userid, $groupid, $contextid, $timestart=0, $timeend=0, $hidden=0, $enrol='manual',$timemodified='') In this case ideal function because ...

Moodlestats

Thursday, November 6th, 2008

Developing Moodle usage statistics report for client. Created some SQL queries and dummy report. Structure will be as follows: stats_collect.php -> script which collects stats from the Moodle database and updates the moodlestats database. This script should be run by a cron job like every week. stats_display.php -> script to display the stats from ...