Browse Source

fix some codechecker warnings.

MOODLE_32_STABLE
Dan Marsden 8 years ago
parent
commit
25e3f2f7a0
  1. 2
      attendance.php
  2. 4
      sessions.php

2
attendance.php

@ -67,7 +67,7 @@ if ($mform->is_cancelled()) {
$url = new moodle_url('/mod/attendance/view.php', array('id' => $cm->id)); $url = new moodle_url('/mod/attendance/view.php', array('id' => $cm->id));
redirect($url); redirect($url);
} else if ($fromform = $mform->get_data()) { } 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) && if (!empty($attforsession->studentpassword) &&
$attforsession->studentpassword !== $fromform->studentpassword) { $attforsession->studentpassword !== $fromform->studentpassword) {

4
sessions.php

@ -300,7 +300,9 @@ function construct_sessions_data_for_add($formdata) {
$sess->timemodified = $now; $sess->timemodified = $now;
$sess->studentscanmark = 0; $sess->studentscanmark = 0;
$sess->studentpassword = ''; $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; $sess->studentscanmark = 1;
if (!empty($formdata->randompassword)) { if (!empty($formdata->randompassword)) {
$sess->studentpassword = random_string(5); $sess->studentpassword = random_string(5);

Loading…
Cancel
Save