From f7ec1426820c35038694e5b8b0963a1618493c54 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Wed, 6 Jul 2016 10:20:07 +1200 Subject: [PATCH] Don't show attendance if no records found for the user. Fixes #209 --- renderer.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/renderer.php b/renderer.php index e8c7b36..bc44259 100644 --- a/renderer.php +++ b/renderer.php @@ -751,14 +751,12 @@ class mod_attendance_renderer extends plugin_renderer_base { $o .= html_writer::tag('h3', $ca->coursefullname); } - $o .= html_writer::tag('h4', $ca->attname); if (isset($userdata->summary[$ca->attid])) { + $o .= html_writer::tag('h4', $ca->attname); $usersummary = $userdata->summary[$ca->attid]->get_all_sessions_summary_for($userdata->user->id); - } else { - $usersummary = null; + $o .= construct_user_data_stat($usersummary, ATT_VIEW_ALL); } - $o .= construct_user_data_stat($usersummary, ATT_VIEW_ALL); } }