$sess->subnet = '';
$sess->automark = 0;
$sess->automarkcompleted = 0;
+ if (!empty(get_config('attendance', 'enablewarnings'))) {
+ $sess->absenteereport = empty($formdata->absenteereport) ? 0 : 1;
+ }
if (!empty($formdata->autoassignstatus)) {
$sess->autoassignstatus = $formdata->autoassignstatus;
}
$sesendtime = $formdata->sestime['endhour'] * HOURSECS + $formdata->sestime['endminute'] * MINSECS;
$sessiondate = $formdata->sessiondate + $sesstarttime;
$duration = $sesendtime - $sesstarttime;
+ if (empty(get_config('attendance', 'enablewarnings'))) {
+ $absenteereport = get_config('attendance', 'absenteereport_default');
+ } else {
+ $absenteereport = empty($formdata->absenteereport) ? 0 : 1;
+ }
+
$now = time();
if (empty(get_config('attendance', 'studentscanmark'))) {
$sess->description = $formdata->sdescription['text'];
$sess->descriptionformat = $formdata->sdescription['format'];
$sess->timemodified = $now;
+ $sess->absenteereport = $absenteereport;
+ $sess->studentpassword = '';
if (isset($formdata->studentscanmark)) { // Students will be able to mark their own attendance.
$sess->studentscanmark = 1;
if (!empty($formdata->usedefaultsubnet)) {
$sess->automarkcompleted = 0;
if (!empty($formdata->randompassword)) {
$sess->studentpassword = attendance_random_string();
- } else {
+ } else if (!empty($formdata->studentpassword)) {
$sess->studentpassword = $formdata->studentpassword;
}
} else {
- $sess->studentpassword = '';
$sess->subnet = '';
$sess->automark = 0;
$sess->automarkcompleted = 0;
$sess->studentpassword = '';
$sess->automark = 0;
$sess->automarkcompleted = 0;
- $sess->absenteereport = 1;
+ $sess->absenteereport = $absenteereport;
if (isset($formdata->studentscanmark) && !empty($formdata->studentscanmark)) {
// Students will be able to mark their own attendance.
'autoassignstatus' => $sess->autoassignstatus,
'subnet' => $sess->subnet,
'automark' => $sess->automark,
+ 'absenteereport' => $sess->absenteereport,
'automarkcompleted' => 0);
if ($sess->subnet == $attendancesubnet) {
$data['usedefaultsubnet'] = 1;
array('rows' => 1, 'columns' => 80), $defopts);
$mform->setType('sdescription', PARAM_RAW);
+ // If warnings allow selector for reporting.
+ if (!empty(get_config('attendance', 'enablewarnings'))) {
+ $mform->addElement('checkbox', 'absenteereport', '', get_string('includeabsentee', 'attendance'));
+ $mform->addHelpButton('absenteereport', 'includeabsentee', 'attendance');
+ }
+
// Students can mark own attendance.
if (!empty(get_config('attendance', 'studentscanmark'))) {
$mform->addElement('header', 'headerstudentmarking', get_string('studentmarking', 'attendance'), true);