Browse Source

Fixes #215 pull through sessoin information on overview report.

MOODLE_32_STABLE
Dan Marsden 8 years ago
parent
commit
650baaf2d5
  1. 10
      lib.php

10
lib.php

@ -239,13 +239,11 @@ function attendance_user_outline($course, $user, $mod, $attendance) {
$result->time = 0; $result->time = 0;
} }
if (has_capability('mod/attendance:canbelisted', $mod->context, $user->id)) { if (has_capability('mod/attendance:canbelisted', $mod->context, $user->id)) {
$statuses = attendance_get_statuses($attendance->id); $summary = new mod_attendance_summary($attendance->id, $user->id);
$grade = attendance_get_user_grade(attendance_get_user_statuses_stat($attendance->id, $course->startdate, $usersummary = $summary->get_all_sessions_summary_for($user->id);
$user->id, $mod), $statuses);
$maxgrade = attendance_get_user_max_grade(attendance_get_user_taken_sessions_count($attendance->id, $course->startdate,
$user->id, $mod), $statuses);
$result->info = $grade.' / '.$maxgrade; $result->info = format_float($usersummary->takensessionspoints, 1, true, true) . ' / ' .
format_float($usersummary->allsessionsmaxpoints, 1, true, true);
} }
return $result; return $result;

Loading…
Cancel
Save