Browse Source

Fix for session add/update when studentscanmark is empty but automark set to close

MOODLE_32_STABLE
Dan Marsden 7 years ago
parent
commit
b9e65039e1
  1. 2
      add_form.php
  2. 2
      update_form.php

2
add_form.php

@ -332,7 +332,7 @@ class mod_attendance_add_form extends moodleform {
$this->_form->setConstant('previoussessiondate', $data['sessiondate']); $this->_form->setConstant('previoussessiondate', $data['sessiondate']);
} }
if ($data['automark'] == ATTENDANCE_AUTOMARK_CLOSE) { if (!empty($data['studentscanmark']) && $data['automark'] == ATTENDANCE_AUTOMARK_CLOSE) {
$cm = $this->_customdata['cm']; $cm = $this->_customdata['cm'];
// Check that the selected statusset has a status to use when unmarked. // Check that the selected statusset has a status to use when unmarked.
$sql = 'SELECT id $sql = 'SELECT id

2
update_form.php

@ -207,7 +207,7 @@ class mod_attendance_update_form extends moodleform {
$errors['sestime'] = get_string('invalidsessionendtime', 'attendance'); $errors['sestime'] = get_string('invalidsessionendtime', 'attendance');
} }
if ($data['automark'] == ATTENDANCE_AUTOMARK_CLOSE) { if (!empty($data['studentscanmark']) && $data['automark'] == ATTENDANCE_AUTOMARK_CLOSE) {
$cm = $this->_customdata['cm']; $cm = $this->_customdata['cm'];
// Check that the selected statusset has a status to use when unmarked. // Check that the selected statusset has a status to use when unmarked.
$sql = 'SELECT id $sql = 'SELECT id

Loading…
Cancel
Save