Browse Source

Fix #340 Check duration of session when checking if a student enrolled before a session.

MOODLE_35_STABLE
Dan Marsden 6 years ago
parent
commit
cf09ca702e
  1. 2
      renderer.php
  2. 2
      renderhelpers.php

2
renderer.php

@ -1101,7 +1101,7 @@ class mod_attendance_renderer extends plugin_renderer_base {
$row->cells[] = format_float($status->grade, 1, true, true) . ' / ' . $row->cells[] = format_float($status->grade, 1, true, true) . ' / ' .
format_float($statussetmaxpoints[$status->setnumber], 1, true, true); format_float($statussetmaxpoints[$status->setnumber], 1, true, true);
$row->cells[] = $sess->remarks; $row->cells[] = $sess->remarks;
} else if ($sess->sessdate < $userdata->user->enrolmentstart) { } else if (($sess->sessdate + $sess->duration) < $userdata->user->enrolmentstart) {
$cell = new html_table_cell(get_string('enrolmentstart', 'attendance', $cell = new html_table_cell(get_string('enrolmentstart', 'attendance',
userdate($userdata->user->enrolmentstart, '%d.%m.%Y'))); userdate($userdata->user->enrolmentstart, '%d.%m.%Y')));
$cell->colspan = 3; $cell->colspan = 3;

2
renderhelpers.php

@ -74,7 +74,7 @@ class user_sessions_cells_generator {
$this->construct_remarks_cell($this->reportdata->sessionslog[$this->user->id][$sess->id]->remarks); $this->construct_remarks_cell($this->reportdata->sessionslog[$this->user->id][$sess->id]->remarks);
} }
} else { } else {
if ($this->user->enrolmentstart > $sess->sessdate) { if ($this->user->enrolmentstart > ($sess->sessdate + $sess->duration)) {
$starttext = get_string('enrolmentstart', 'attendance', userdate($this->user->enrolmentstart, '%d.%m.%Y')); $starttext = get_string('enrolmentstart', 'attendance', userdate($this->user->enrolmentstart, '%d.%m.%Y'));
$this->construct_enrolments_info_cell($starttext); $this->construct_enrolments_info_cell($starttext);
} else if ($this->user->enrolmentend and $this->user->enrolmentend < $sess->sessdate) { } else if ($this->user->enrolmentend and $this->user->enrolmentend < $sess->sessdate) {

Loading…
Cancel
Save