|
|
@ -38,6 +38,9 @@ $attendance = $DB->get_record('attendance', array('id' => $attforsession->attend |
|
|
|
$cm = get_coursemodule_from_instance('attendance', $attendance->id, 0, false, MUST_EXIST); |
|
|
|
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); |
|
|
|
|
|
|
|
// Require the user is logged in. |
|
|
|
require_login($course, true, $cm); |
|
|
|
|
|
|
|
// If the randomised code is on grab it. |
|
|
|
if ($attforsession->rotateqrcode == 1) { |
|
|
|
$cookiename = 'attendance_'.$attforsession->id; |
|
|
@ -75,9 +78,6 @@ if ($attforsession->rotateqrcode == 1) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Require the user is logged in. |
|
|
|
require_login($course, true, $cm); |
|
|
|
|
|
|
|
list($canmark, $reason) = attendance_can_student_mark($attforsession); |
|
|
|
if (!$canmark) { |
|
|
|
redirect(new moodle_url('/mod/attendance/view.php', array('id' => $cm->id)), get_string($reason, 'attendance')); |
|
|
|