From e03a2bddbc0e17a2dee3a3ec6c83c72c0a83cc69 Mon Sep 17 00:00:00 2001 From: Artem Andreev Date: Fri, 28 Sep 2012 16:17:56 +0400 Subject: [PATCH] Fixed #21: No Grade attendance - added to gradebook on attendance update --- locallib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/locallib.php b/locallib.php index 5ba1339..522752c 100644 --- a/locallib.php +++ b/locallib.php @@ -828,7 +828,7 @@ class attforblock { $rec->lasttakenby = $USER->id; $DB->update_record('attendance_sessions', $rec); - $this->update_users_grade(array_keys($sesslog)); + if ($this->grade != 0) $this->update_users_grade(array_keys($sesslog)); $params = array( 'sessionid' => $this->pageparams->sessionid, @@ -1010,6 +1010,7 @@ class attforblock { $grades = array(); foreach ($userids as $userid) { + $grades[$userid] = new stdClass(); $grades[$userid]->userid = $userid; $grades[$userid]->rawgrade = att_calc_user_grade_fraction($this->get_user_grade($userid), $this->get_user_max_grade($userid)) * $this->grade; }