From 018eda2c4ee3d469744392e732fd3a664d203d30 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Tue, 29 Nov 2016 20:17:25 +1300 Subject: [PATCH] Revert "Fix #217 - hide percentage/points columns when no grade is set." This reverts commit ce686d21fed0a79e7f21271e0c47a2e3b7df36ef. --- renderer.php | 64 +++++++++++++++++++++++----------------------------- 1 file changed, 28 insertions(+), 36 deletions(-) diff --git a/renderer.php b/renderer.php index 8d41377..6f46e5a 100644 --- a/renderer.php +++ b/renderer.php @@ -898,38 +898,34 @@ class mod_attendance_renderer extends plugin_renderer_base { $table->align[] = 'center'; $table->size[] = '1px'; - if (!empty($reportdata->att->grade)) { - $table->head[] = get_string('points', 'attendance'); - $table->align[] = 'center'; - $table->size[] = '1px'; + $table->head[] = get_string('points', 'attendance'); + $table->align[] = 'center'; + $table->size[] = '1px'; - $table->head[] = get_string('percentage', 'attendance'); - $table->align[] = 'center'; - $table->size[] = '1px'; - } + $table->head[] = get_string('percentage', 'attendance'); + $table->align[] = 'center'; + $table->size[] = '1px'; if ($reportdata->pageparams->view == ATT_VIEW_SUMMARY) { $table->head[] = get_string('sessionstotal', 'attendance'); $table->align[] = 'center'; $table->size[] = '1px'; - if (!empty($reportdata->att->grade)) { - $table->head[] = get_string('pointsallsessions', 'attendance'); - $table->align[] = 'center'; - $table->size[] = '1px'; + $table->head[] = get_string('pointsallsessions', 'attendance'); + $table->align[] = 'center'; + $table->size[] = '1px'; - $table->head[] = get_string('percentageallsessions', 'attendance'); - $table->align[] = 'center'; - $table->size[] = '1px'; + $table->head[] = get_string('percentageallsessions', 'attendance'); + $table->align[] = 'center'; + $table->size[] = '1px'; - $table->head[] = get_string('maxpossiblepoints', 'attendance'); - $table->align[] = 'center'; - $table->size[] = '1px'; + $table->head[] = get_string('maxpossiblepoints', 'attendance'); + $table->align[] = 'center'; + $table->size[] = '1px'; - $table->head[] = get_string('maxpossiblepercentage', 'attendance'); - $table->align[] = 'center'; - $table->size[] = '1px'; - } + $table->head[] = get_string('maxpossiblepercentage', 'attendance'); + $table->align[] = 'center'; + $table->size[] = '1px'; } if ($bulkmessagecapability) { // Display the table header for bulk messaging. @@ -953,23 +949,19 @@ class mod_attendance_renderer extends plugin_renderer_base { $usersummary = $reportdata->summary->get_taken_sessions_summary_for($user->id); } $row->cells[] = $usersummary->numtakensessions; - if (!empty($reportdata->att->grade)) { - $row->cells[] = format_float($usersummary->takensessionspoints, 1, true, true) . ' / ' . - format_float($usersummary->takensessionsmaxpoints, 1, true, true); - $row->cells[] = format_float($usersummary->takensessionspercentage * 100) . '%'; - } + $row->cells[] = format_float($usersummary->takensessionspoints, 1, true, true) . ' / ' . + format_float($usersummary->takensessionsmaxpoints, 1, true, true); + $row->cells[] = format_float($usersummary->takensessionspercentage * 100) . '%'; if ($reportdata->pageparams->view == ATT_VIEW_SUMMARY) { $row->cells[] = $usersummary->numallsessions; - if (!empty($reportdata->att->grade)) { - $row->cells[] = format_float($usersummary->takensessionspoints, 1, true, true) . ' / ' . - format_float($usersummary->allsessionsmaxpoints, 1, true, true); - $row->cells[] = format_float($usersummary->allsessionspercentage * 100) . '%'; - - $row->cells[] = format_float($usersummary->maxpossiblepoints, 1, true, true) . ' / ' . - format_float($usersummary->allsessionsmaxpoints, 1, true, true); - $row->cells[] = format_float($usersummary->maxpossiblepercentage * 100) . '%'; - } + $row->cells[] = format_float($usersummary->takensessionspoints, 1, true, true) . ' / ' . + format_float($usersummary->allsessionsmaxpoints, 1, true, true); + $row->cells[] = format_float($usersummary->allsessionspercentage * 100) . '%'; + + $row->cells[] = format_float($usersummary->maxpossiblepoints, 1, true, true) . ' / ' . + format_float($usersummary->allsessionsmaxpoints, 1, true, true); + $row->cells[] = format_float($usersummary->maxpossiblepercentage * 100) . '%'; } if ($bulkmessagecapability) { // Create the checkbox for bulk messaging.