From f0bbb6795d53423bae24e69dd88771efbc0b4ee8 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Fri, 14 Sep 2018 13:26:13 +1200 Subject: [PATCH] Hide session marking links from teachers for now - not implemented yet. --- classes/output/mobile.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/classes/output/mobile.php b/classes/output/mobile.php index b3b0ed9..033b3fd 100644 --- a/classes/output/mobile.php +++ b/classes/output/mobile.php @@ -90,12 +90,15 @@ class mobile { $data['sessions'] = array(); - $userdata = new \attendance_user_data($att, $USER->id, true); - - $sessions = $DB->get_records_select('attendance_sessions', - 'attendanceid = ? AND sessdate > ? ORDER BY sessdate', array($attendance->id, $time)); + if ($isteacher) { + $sessions = array(); // Support for teacher marking not implemented yet. + } else { + $sessions = $DB->get_records_select('attendance_sessions', + 'attendanceid = ? AND sessdate > ? ORDER BY sessdate', array($attendance->id, $time)); + } if (!empty($sessions)) { + $userdata = new \attendance_user_data($att, $USER->id, true); foreach ($sessions as $sess) { if (!$isteacher && empty($userdata->sessionslog['c'.$sess->id])) { // This session isn't viewable to this student - probably a group session.