Creating the attendance sessions automatically

Re: Creating the attendance sessions automatically

by Grant Carmichael -
Number of replies: 0
I'm running Moodle 1.8 and the attendance module version 2.0.2. (I think this is still the beta version)

So, a teacher must first add the block to a course. After that, they must go into attendance and create the sessions for each class. We have way too many courses to do this manually. So, this script does the following:

Get all course id's.

For each course id, add the block to the course and create all the attendance sessions based on the course start date and the number of sections.

The result is, for each course, the attendance block is added and all the attendance sessions are created for each section date.

Like the notes in the script say, on a test instance of moodle, drop the file into $CFG->dirroot/courses and execute. For me, that is /usr/local/apache/htdocs/moodle/moodle182/course/shorter_attendance.php

So, it might look like this:

shell> cp shorter_attendance.php /usr/local/apache/htdocs/moodle/moodle182/courses/
shell> cd /usr/local/apache/htdocs/moodle/moodle182/courses
shell> php shorter_attendance.php

Let me know how it works for you before I run it on my stuff... (Just kidding...) Its working fine for us.