projects
/
moodle-mod_attendance.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
84f2373
)
On upgrade, update grade items to 'attendance'
author
Tim Lock
<tim.lock@netspot.com.au>
Wed, 2 Oct 2013 03:00:48 +0000
(12:30 +0930)
committer
Tim Lock
<tim.lock@netspot.com.au>
Wed, 2 Oct 2013 03:00:48 +0000
(12:30 +0930)
locallib.php
patch
|
blob
|
history
diff --git
a/locallib.php
b/locallib.php
index
011c56c
..
28a081e
100644
(file)
--- 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) {