$url = new moodle_url('/mod/attendance/view.php', array('id' => $cm->id));
redirect($url);
} else if ($fromform = $mform->get_data()) {
- // check if password required and if set correctly.
+ // Check if password required and if set correctly.
if (!empty($attforsession->studentpassword) &&
$attforsession->studentpassword !== $fromform->studentpassword) {
$sess->timemodified = $now;
$sess->studentscanmark = 0;
$sess->studentpassword = '';
- if (isset($formdata->studentscanmark) && !empty($formdata->studentscanmark)) { // Students will be able to mark their own attendance.
+
+ if (isset($formdata->studentscanmark) && !empty($formdata->studentscanmark)) {
+ // Students will be able to mark their own attendance.
$sess->studentscanmark = 1;
if (!empty($formdata->randompassword)) {
$sess->studentpassword = random_string(5);