From 83a9b87f6fa019118bd419c726cc002994525621 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Mon, 19 Jun 2017 12:55:42 +1200 Subject: [PATCH] Fix hardcoded reference to mdl_ --- locallib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locallib.php b/locallib.php index b7ba6e5..397faee 100644 --- a/locallib.php +++ b/locallib.php @@ -690,13 +690,13 @@ function attendance_course_users_points($courseids = array(), $orderby = '') { $sql = "SELECT courseid, coursename, sum(points) / sum(maxpoints) as percentage FROM ( SELECT a.id, a.course as courseid, c.fullname as coursename, atl.studentid AS userid, COUNT(DISTINCT ats.id) AS numtakensessions, SUM(stg.grade) AS points, SUM(stm.maxgrade) AS maxpoints - FROM mdl_attendance_sessions ats - JOIN mdl_attendance a ON a.id = ats.attendanceid - JOIN mdl_course c ON c.id = a.course - JOIN mdl_attendance_log atl ON (atl.sessionid = ats.id) - JOIN mdl_attendance_statuses stg ON (stg.id = atl.statusid AND stg.deleted = 0 AND stg.visible = 1) + FROM {attendance_sessions} ats + JOIN {attendance} a ON a.id = ats.attendanceid + JOIN {course} c ON c.id = a.course + JOIN {attendance_log} atl ON (atl.sessionid = ats.id) + JOIN {attendance_statuses} stg ON (stg.id = atl.statusid AND stg.deleted = 0 AND stg.visible = 1) JOIN (SELECT attendanceid, setnumber, MAX(grade) AS maxgrade - FROM mdl_attendance_statuses + FROM {attendance_statuses} WHERE deleted = 0 AND visible = 1 GROUP BY attendanceid, setnumber) stm