|
|
@ -856,14 +856,18 @@ class mod_attendance_renderer extends plugin_renderer_base { |
|
|
|
$table->attributes['class'] .= ' summaryreport'; |
|
|
|
} |
|
|
|
|
|
|
|
$colclass = null; |
|
|
|
|
|
|
|
// User picture. |
|
|
|
$table->head[] = ''; |
|
|
|
$table->align[] = 'left'; |
|
|
|
$table->size[] = '1px'; |
|
|
|
$table->colclasses[] = $colclass; |
|
|
|
|
|
|
|
$table->head[] = $this->construct_fullname_head($reportdata); |
|
|
|
$table->align[] = 'left'; |
|
|
|
$table->size[] = ''; |
|
|
|
$table->colclasses[] = $colclass; |
|
|
|
$sessionstats = array(); |
|
|
|
|
|
|
|
foreach ($reportdata->sessions as $sess) { |
|
|
@ -892,40 +896,65 @@ class mod_attendance_renderer extends plugin_renderer_base { |
|
|
|
$table->head[] = $sesstext; |
|
|
|
$table->align[] = 'center'; |
|
|
|
$table->size[] = '1px'; |
|
|
|
$table->colclasses[] = $colclass; |
|
|
|
} |
|
|
|
|
|
|
|
$setnumber = -1; |
|
|
|
foreach ($reportdata->statuses AS $sts) { |
|
|
|
if ($sts->setnumber != $setnumber) { |
|
|
|
$colclass = empty($colclass) ? 'columncontrast' : null; |
|
|
|
$setnumber = $sts->setnumber; |
|
|
|
} |
|
|
|
|
|
|
|
$table->head[] = $sts->acronym; |
|
|
|
$table->align[] = 'center'; |
|
|
|
$table->size[] = '1px'; |
|
|
|
$table->colclasses[] = $colclass; |
|
|
|
} |
|
|
|
|
|
|
|
$table->head[] = get_string('takensessions', 'attendance'); |
|
|
|
$table->align[] = 'center'; |
|
|
|
$table->size[] = '1px'; |
|
|
|
$colclass = empty($colclass) ? 'columncontrast' : null; |
|
|
|
$table->colclasses[] = $colclass; |
|
|
|
|
|
|
|
$table->head[] = get_string('points', 'attendance'); |
|
|
|
$table->align[] = 'center'; |
|
|
|
$table->size[] = '1px'; |
|
|
|
$table->colclasses[] = $colclass; |
|
|
|
|
|
|
|
$table->head[] = get_string('percentage', 'attendance'); |
|
|
|
$table->align[] = 'center'; |
|
|
|
$table->size[] = '1px'; |
|
|
|
$table->colclasses[] = $colclass; |
|
|
|
|
|
|
|
if ($reportdata->pageparams->view == ATT_VIEW_SUMMARY) { |
|
|
|
$table->head[] = get_string('sessionstotal', 'attendance'); |
|
|
|
$table->align[] = 'center'; |
|
|
|
$table->size[] = '1px'; |
|
|
|
$colclass = empty($colclass) ? 'columncontrast' : null; |
|
|
|
$table->colclasses[] = $colclass; |
|
|
|
|
|
|
|
$table->head[] = get_string('pointsallsessions', 'attendance'); |
|
|
|
$table->align[] = 'center'; |
|
|
|
$table->size[] = '1px'; |
|
|
|
$table->colclasses[] = $colclass; |
|
|
|
|
|
|
|
$table->head[] = get_string('percentageallsessions', 'attendance'); |
|
|
|
$table->align[] = 'center'; |
|
|
|
$table->size[] = '1px'; |
|
|
|
$table->colclasses[] = $colclass; |
|
|
|
|
|
|
|
$table->head[] = get_string('maxpossiblepoints', 'attendance'); |
|
|
|
$table->align[] = 'center'; |
|
|
|
$table->size[] = '1px'; |
|
|
|
$colclass = empty($colclass) ? 'columncontrast' : null; |
|
|
|
$table->colclasses[] = $colclass; |
|
|
|
|
|
|
|
$table->head[] = get_string('maxpossiblepercentage', 'attendance'); |
|
|
|
$table->align[] = 'center'; |
|
|
|
$table->size[] = '1px'; |
|
|
|
$table->colclasses[] = $colclass; |
|
|
|
} |
|
|
|
|
|
|
|
if ($bulkmessagecapability) { // Display the table header for bulk messaging. |
|
|
@ -948,6 +977,12 @@ class mod_attendance_renderer extends plugin_renderer_base { |
|
|
|
} else { |
|
|
|
$usersummary = $reportdata->summary->get_taken_sessions_summary_for($user->id); |
|
|
|
} |
|
|
|
|
|
|
|
foreach ($reportdata->statuses AS $sts) { |
|
|
|
$row->cells[] = isset($usersummary->userstakensessionsbyacronym[$sts->setnumber][$sts->acronym]) ? |
|
|
|
$usersummary->userstakensessionsbyacronym[$sts->setnumber][$sts->acronym] : 0; |
|
|
|
} |
|
|
|
|
|
|
|
$row->cells[] = $usersummary->numtakensessions; |
|
|
|
$row->cells[] = format_float($usersummary->takensessionspoints, 1, true, true) . ' / ' . |
|
|
|
format_float($usersummary->takensessionsmaxpoints, 1, true, true); |
|
|
@ -972,6 +1007,7 @@ class mod_attendance_renderer extends plugin_renderer_base { |
|
|
|
$table->data[] = $row; |
|
|
|
} |
|
|
|
|
|
|
|
if ($reportdata->pageparams->view != ATT_VIEW_SUMMARY) { |
|
|
|
// Calculate the sum of statuses for each user. |
|
|
|
$statrow = new html_table_row(); |
|
|
|
$statrow->cells[] = ''; |
|
|
@ -994,7 +1030,7 @@ class mod_attendance_renderer extends plugin_renderer_base { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$statsoutput = '<br/>'; |
|
|
|
$statsoutput = ''; |
|
|
|
foreach ($sessionstats as $status) { |
|
|
|
$statsoutput .= "$status->description: {$status->count}<br/>"; |
|
|
|
} |
|
|
@ -1002,7 +1038,15 @@ class mod_attendance_renderer extends plugin_renderer_base { |
|
|
|
$cell->style = 'white-space:nowrap;'; |
|
|
|
$statrow->cells[] = $cell; |
|
|
|
} |
|
|
|
foreach ($reportdata->statuses AS $sts) { |
|
|
|
$statrow->cells[] = ''; |
|
|
|
} |
|
|
|
$statrow->cells[] = ''; |
|
|
|
$statrow->cells[] = ''; |
|
|
|
$statrow->cells[] = ''; |
|
|
|
$statrow->cells[] = ''; |
|
|
|
$table->data[] = $statrow; |
|
|
|
} |
|
|
|
|
|
|
|
if ($bulkmessagecapability) { // Require that the user can bulk message users. |
|
|
|
// Display check boxes that will allow the user to send a message to the students that have been checked. |
|
|
|