Browse Source

Prevent automarking settings from being used if setunmarked status not in place.

40-behatfixes
Dan Marsden 3 years ago
parent
commit
4e4c2542d2
  1. 3
      classes/form/addsession.php
  2. 3
      classes/form/updatesession.php

3
classes/form/addsession.php

@ -207,7 +207,7 @@ class addsession extends moodleform {
$mform->addElement('hidden', 'studentscanmark', '0');
$mform->settype('studentscanmark', PARAM_INT);
}
if ($DB->record_exists('attendance_statuses', ['attendanceid' => $this->_customdata['att']->id, 'setunmarked' => 1])) {
$options = attendance_get_automarkoptions();
$mform->addElement('select', 'automark', get_string('automark', 'attendance'), $options);
@ -220,6 +220,7 @@ class addsession extends moodleform {
$mform->addElement('select', 'automarkcmid', get_string('selectactivity', 'attendance'), $automarkcmoptions);
$mform->setType('automarkcmid', PARAM_INT);
$mform->hideif('automarkcmid', 'automark', 'neq', '3');
}
if (!empty($studentscanmark)) {
$mgroup = array();

3
classes/form/updatesession.php

@ -143,6 +143,7 @@ class updatesession extends \moodleform {
$mform->settype('studentscanmark', PARAM_INT);
}
if ($DB->record_exists('attendance_statuses', ['attendanceid' => $this->_customdata['att']->id, 'setunmarked' => 1])) {
$options2 = attendance_get_automarkoptions();
$mform->addElement('select', 'automark', get_string('automark', 'attendance'), $options2);
@ -157,7 +158,7 @@ class updatesession extends \moodleform {
if (!empty($sess->automarkcompleted)) {
$mform->hardFreeze('automarkcmid,automark,studentscanmark');
}
}
if (!empty($studentscanmark)) {
$mform->addElement('text', 'studentpassword', get_string('studentpassword', 'attendance'));
$mform->setType('studentpassword', PARAM_TEXT);

Loading…
Cancel
Save