Browse Source

Add pair (points/maxpoints) after the acronym in the reports

MOODLE_31_STABLE
Antonio Carlos Mariani 9 years ago
parent
commit
d6c6d75e27
  1. 2
      classes/structure.php
  2. 5
      renderhelpers.php

2
classes/structure.php

@ -233,6 +233,7 @@ class mod_attendance_structure {
'edate' => $this->pageparams->enddate, 'edate' => $this->pageparams->enddate,
'cgroup' => $this->pageparams->get_current_sesstype()); 'cgroup' => $this->pageparams->get_current_sesstype());
$sessions = $DB->get_records_select('attendance_sessions', $where, $params, 'sessdate asc'); $sessions = $DB->get_records_select('attendance_sessions', $where, $params, 'sessdate asc');
$statussetmaxpoints = attendance_get_statusset_maxpoints($this->get_statuses(true, true));
foreach ($sessions as $sess) { foreach ($sessions as $sess) {
if (empty($sess->description)) { if (empty($sess->description)) {
$sess->description = get_string('nodescription', 'attendance'); $sess->description = get_string('nodescription', 'attendance');
@ -240,6 +241,7 @@ class mod_attendance_structure {
$sess->description = file_rewrite_pluginfile_urls($sess->description, $sess->description = file_rewrite_pluginfile_urls($sess->description,
'pluginfile.php', $this->context->id, 'mod_attendance', 'session', $sess->id); 'pluginfile.php', $this->context->id, 'mod_attendance', 'session', $sess->id);
} }
$sess->maxpoints = $statussetmaxpoints[$sess->statusset];
} }
return $sessions; return $sessions;

5
renderhelpers.php

@ -49,7 +49,10 @@ class user_sessions_cells_generator {
if (array_key_exists($sess->id, $this->reportdata->sessionslog[$this->user->id])) { if (array_key_exists($sess->id, $this->reportdata->sessionslog[$this->user->id])) {
$statusid = $this->reportdata->sessionslog[$this->user->id][$sess->id]->statusid; $statusid = $this->reportdata->sessionslog[$this->user->id][$sess->id]->statusid;
if (array_key_exists($statusid, $this->reportdata->statuses)) { if (array_key_exists($statusid, $this->reportdata->statuses)) {
$this->construct_existing_status_cell($this->reportdata->statuses[$statusid]->acronym); $points = attendance_format_float($this->reportdata->statuses[$statusid]->grade);
$maxpoints = attendance_format_float($sess->maxpoints);
$this->construct_existing_status_cell($this->reportdata->statuses[$statusid]->acronym .
" ({$points}/{$maxpoints})");
} else { } else {
$this->construct_hidden_status_cell($this->reportdata->allstatuses[$statusid]->acronym); $this->construct_hidden_status_cell($this->reportdata->allstatuses[$statusid]->acronym);
} }

Loading…
Cancel
Save