From 283c2f552a4cd52f8653dc5d10e50d6a6589aafe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B5nis=20Tartes?= Date: Tue, 23 Oct 2018 04:39:31 +0300 Subject: [PATCH] =?UTF-8?q?ISSUE-336=20-=20Viewing=20single=20session=20ta?= =?UTF-8?q?ble=20total=20counts=20in=20also=20users=20w=E2=80=A6=20(#337)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ISSUE-336 - Viewing single session table total counts in also users who are unenrolled from course --- renderer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renderer.php b/renderer.php index 6159f88..df289bf 100644 --- a/renderer.php +++ b/renderer.php @@ -433,7 +433,7 @@ class mod_attendance_renderer extends plugin_renderer_base { $sessionstats[] = array(); foreach ($takedata->sessionlog as $userlog) { foreach ($takedata->statuses as $status) { - if ($userlog->statusid == $status->id) { + if ($userlog->statusid == $status->id && in_array($userlog->studentid, array_keys($takedata->users))) { $sessionstats[$status->id]++; } } @@ -569,7 +569,7 @@ class mod_attendance_renderer extends plugin_renderer_base { $controls .= $this->output->render($select); } - if (count($takedata->sessions4copy) > 0) { + if (isset($takedata->sessions4copy) && count($takedata->sessions4copy) > 0) { $controls .= html_writer::empty_tag('br'); $controls .= html_writer::empty_tag('br');