From 5cd532f951fd56007ea46b4562f70dbe6df5b47e Mon Sep 17 00:00:00 2001 From: Tim Lock Date: Wed, 2 Oct 2013 12:30:48 +0930 Subject: [PATCH] On upgrade, update grade items to 'attendance' --- locallib.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/locallib.php b/locallib.php index 011c56c..28a081e 100644 --- a/locallib.php +++ b/locallib.php @@ -1432,6 +1432,12 @@ function attforblock_upgrade() { $module->name = 'attendance'; $DB->update_record('modules', $module); + // Now convert grade items to 'attendance' + $sql = "UPDATE {grade_items} + SET itemmodule = ? + WHERE itemmodule = ?"; + $DB->execute($sql, array('attendance', 'attforblock')); + // Clear cache for courses with attendances. $attendances = $DB->get_recordset('attendance', array(), '', 'course'); foreach ($attendances as $attendance) {