$sess->lasttaken = 0;
$sess->lasttakenby = 0;
$sess->studentscanmark = 0;
+ $sess->studentpassword = '';
$event->add_record_snapshot('attendance_sessions', $sess);
$event->trigger();
$sess->description = $formdata->sdescription['text'];
$sess->descriptionformat = $formdata->sdescription['format'];
$sess->timemodified = $now;
- if (isset($formdata->studentscanmark)) { // Students will be able to mark their own attendance.
+ $sess->studentscanmark = 0;
+ $sess->studentpassword = '';
+ if (isset($formdata->studentscanmark) && !empty($formdata->studentscanmark)) { // Students will be able to mark their own attendance.
$sess->studentscanmark = 1;
$sess->studentpassword = $formdata->studentpassword;
- } else {
- $sess->studentpassword = '';
}
$sess->statusset = $formdata->statusset;