Browse Source

Prevent error when updating status when student marking disabled.

MOODLE_32_STABLE
Dan Marsden 7 years ago
parent
commit
b88244a706
  1. 5
      defaultstatus.php

5
defaultstatus.php

@ -100,7 +100,7 @@ switch ($action) {
$acronym = required_param_array('acronym', PARAM_TEXT); $acronym = required_param_array('acronym', PARAM_TEXT);
$description = required_param_array('description', PARAM_TEXT); $description = required_param_array('description', PARAM_TEXT);
$grade = required_param_array('grade', PARAM_RAW); $grade = required_param_array('grade', PARAM_RAW);
$studentavailability = required_param_array('studentavailability', PARAM_RAW); $studentavailability = optional_param_array('studentavailability', '0', PARAM_RAW);
$unmarkedstatus = optional_param('setunmarked', null, PARAM_INT); $unmarkedstatus = optional_param('setunmarked', null, PARAM_INT);
foreach ($grade as &$val) { foreach ($grade as &$val) {
$val = unformat_float($val); $val = unformat_float($val);
@ -113,6 +113,9 @@ switch ($action) {
if ($unmarkedstatus == $id) { if ($unmarkedstatus == $id) {
$setunmarked = true; $setunmarked = true;
} }
if (!isset($studentavailability[$id])) {
$studentavailability[$id] = 0;
}
$errors[$id] = attendance_update_status($status, $acronym[$id], $description[$id], $grade[$id], $errors[$id] = attendance_update_status($status, $acronym[$id], $description[$id], $grade[$id],
null, null, null, $studentavailability[$id], $setunmarked); null, null, null, $studentavailability[$id], $setunmarked);
} }

Loading…
Cancel
Save