From 42698f10d765bff89e0b7d76c3348c67c400356c Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Thu, 4 Jul 2013 11:38:02 +1200 Subject: [PATCH] remove old code and bump version to make sure upgrade occurs after migration from attforblock --- lib.php | 75 ----------------------------------------------------- version.php | 2 +- 2 files changed, 1 insertion(+), 76 deletions(-) diff --git a/lib.php b/lib.php index 56691db..e8a002a 100644 --- a/lib.php +++ b/lib.php @@ -265,81 +265,6 @@ function attendance_cron () { return true; } -/** - * Return grade for given user or all users. - * - * @param int $attendanceid id of attendance - * @param int $userid optional user id, 0 means all users - * @return array array of grades, false if none - */ -/*function attendance_get_user_grades($attendance, $userid=0) { - global $CFG, $DB; - - require_once('_locallib.php'); - - if (! $course = $DB->get_record('course', array('id'=> $attendance->course))) { - error("Course is misconfigured"); - } - - $result = false; - if ($userid) { - $result = array(); - $result[$userid]->userid = $userid; - $result[$userid]->rawgrade = $attendance->grade * get_percent($userid, $course, $attendance) / 100; - } else { - if ($students = get_course_students($course->id)) { - $result = array(); - foreach ($students as $student) { - $result[$student->id]->userid = $student->id; - $result[$student->id]->rawgrade = $attendance->grade * get_percent($student->id, $course, $attendance) / 100; - } - } - } - - return $result; -}*/ - -/** - * Update grades by firing grade_updated event - * - * @param object $attendance null means all attendances - * @param int $userid specific user only, 0 mean all - */ -/*function attendance_update_grades($attendance=null, $userid=0, $nullifnone=true) { - global $CFG, $DB; - if (!function_exists('grade_update')) { //workaround for buggy PHP versions - require_once($CFG->libdir.'/gradelib.php'); - } - - if ($attendance != null) { - if ($grades = attendance_get_user_grades($attendance, $userid)) { - foreach($grades as $k=>$v) { - if ($v->rawgrade == -1) { - $grades[$k]->rawgrade = null; - } - } - attendance_grade_item_update($attendance, $grades); - } else { - attendance_grade_item_update($attendance); - } - - } else { - $sql = "SELECT a.*, cm.idnumber as cmidnumber, a.course as courseid - FROM {attendance} a, {course_modules} cm, {modules} m - WHERE m.name='attendance' AND m.id=cm.module AND cm.instance=a.id"; - if ($rs = $DB->get_records_sql($sql)) { - foreach ($rs as $attendance) { -// if ($attendance->grade != 0) { - attendance_update_grades($attendance); -// } else { -// attendance_grade_item_update($attendance); -// } - } - $rs->close($rs); - } - } -}*/ - /** * Create grade item for given attendance * diff --git a/version.php b/version.php index fdf8281..4da10d4 100644 --- a/version.php +++ b/version.php @@ -22,7 +22,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$module->version = 2012120700; +$module->version = 2013070400; $module->requires = 2012120300; $module->release = '2.4.1'; $module->maturity = MATURITY_ALPHA;