Browse Source

Fix stupid way of checking if user already has a recorded attendance.

MOODLE_36_STABLE
Dan Marsden 6 years ago
parent
commit
9c02796d51
  1. 6
      classes/structure.php

6
classes/structure.php

@ -622,8 +622,10 @@ class mod_attendance_structure {
$record->takenby = $USER->id; $record->takenby = $USER->id;
$record->ipaddress = getremoteaddr(null); $record->ipaddress = getremoteaddr(null);
$dbsesslog = $this->get_session_log($mformdata->sessid); $existingattendance = $DB->record_exists('attendance_log',
if (array_key_exists($record->studentid, $dbsesslog)) { array('sessionid' => $mformdata->sessid, 'studentid' => $USER->id));
if ($existingattendance) {
// Already recorded do not save. // Already recorded do not save.
return false; return false;
} }

Loading…
Cancel
Save