From 650baaf2d54381b07bc4adc9fa395276a7971125 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Thu, 25 Aug 2016 14:24:20 +1200 Subject: [PATCH] Fixes #215 pull through sessoin information on overview report. --- lib.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib.php b/lib.php index 4c4b61a..442acdc 100644 --- a/lib.php +++ b/lib.php @@ -239,13 +239,11 @@ function attendance_user_outline($course, $user, $mod, $attendance) { $result->time = 0; } if (has_capability('mod/attendance:canbelisted', $mod->context, $user->id)) { - $statuses = attendance_get_statuses($attendance->id); - $grade = attendance_get_user_grade(attendance_get_user_statuses_stat($attendance->id, $course->startdate, - $user->id, $mod), $statuses); - $maxgrade = attendance_get_user_max_grade(attendance_get_user_taken_sessions_count($attendance->id, $course->startdate, - $user->id, $mod), $statuses); + $summary = new mod_attendance_summary($attendance->id, $user->id); + $usersummary = $summary->get_all_sessions_summary_for($user->id); - $result->info = $grade.' / '.$maxgrade; + $result->info = format_float($usersummary->takensessionspoints, 1, true, true) . ' / ' . + format_float($usersummary->allsessionsmaxpoints, 1, true, true); } return $result;