MDL-33398 completion: Fix coding error (should be arrays not objects)

This commit is contained in:
Aaron Barnes 2012-05-29 14:34:16 +12:00
parent e6f5528585
commit 28e0c239ec
5 changed files with 5 additions and 5 deletions

View File

@ -235,7 +235,7 @@ class completion_criteria_activity extends completion_criteria {
// Loop through completions, and mark as complete
$rs = $DB->get_recordset_sql($sql);
foreach ($rs as $record) {
$completion = new completion_criteria_completion($record, DATA_OBJECT_FETCH_BY_KEY);
$completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY);
$completion->mark_complete($record->timecompleted);
}
$rs->close();

View File

@ -193,7 +193,7 @@ class completion_criteria_course extends completion_criteria {
// Loop through completions, and mark as complete
$rs = $DB->get_recordset_sql($sql);
foreach ($rs as $record) {
$completion = new completion_criteria_completion($record, DATA_OBJECT_FETCH_BY_KEY);
$completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY);
$completion->mark_complete($record['timecompleted']);
}
$rs->close();

View File

@ -179,7 +179,7 @@ class completion_criteria_date extends completion_criteria {
// Loop through completions, and mark as complete
$rs = $DB->get_recordset_sql($sql, array(time()));
foreach ($rs as $record) {
$completion = new completion_criteria_completion($record, DATA_OBJECT_FETCH_BY_KEY);
$completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY);
$completion->mark_complete($record['timeend']);
}
$rs->close();

View File

@ -229,7 +229,7 @@ class completion_criteria_duration extends completion_criteria {
$now = time();
$rs = $DB->get_recordset_sql($sql, array($now, $now));
foreach ($rs as $record) {
$completion = new completion_criteria_completion($record, DATA_OBJECT_FETCH_BY_KEY);
$completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY);
// Use time start if not 0, otherwise use timeenrolled
if ($record->otimestart) {

View File

@ -215,7 +215,7 @@ class completion_criteria_grade extends completion_criteria {
// Loop through completions, and mark as complete
$rs = $DB->get_recordset_sql($sql);
foreach ($rs as $record) {
$completion = new completion_criteria_completion($record, DATA_OBJECT_FETCH_BY_KEY);
$completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY);
$completion->mark_complete($record['timecompleted']);
}
$rs->close();