|
Moodle
2.2.1
http://www.collinsharper.com
|
Go to the source code of this file.
Namespaces | |
| namespace | moodlecore |
Functions | |
| completion_cron () | |
| completion_cron_mark_started () | |
| completion_cron_criteria () | |
| completion_cron_completions () | |
| completion_cron_aggregate ($method, $data, &$state) | |
| completion_cron | ( | ) |
| completion_cron_aggregate | ( | $ | method, |
| $ | data, | ||
| &$ | state | ||
| ) |
Mark users as started if the config option is set
A quick explaination of this horrible looking query
It's purpose is to locate all the active participants of a course with course completion enabled.
We also only want the users with no course_completions record as this functions job is to create the missing ones :)
We want to record the user's enrolment start time for the course. This gets tricky because there can be multiple enrolment plugins active in a course, hence the possibility of multiple records for each couse/user in the results
An explaination of the following loop
We are essentially doing a group by in the code here (as I can't find a decent way of doing it in the sql).
Since there can be multiple enrolment plugins for each course, we can have multiple rows for each particpant in the query result. This isn't really a problem until you combine it with the fact that the enrolment plugins can save the enrol start time in either timestart or timeenrolled.
The purpose of this loop is to find the earliest enrolment start time for each participant in each course.
Definition at line 53 of file cron.php.

