From dadf8426a49cb8a4d9f6170412935281a89e56fc 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 27f1623..3297ec9 100644 --- a/renderer.php +++ b/renderer.php @@ -431,7 +431,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]++; } } @@ -568,7 +568,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');