Browse Source

set default values a bit better.

MOODLE_33_STABLE
Dan Marsden 8 years ago
parent
commit
35a553661b
  1. 1
      classes/structure.php
  2. 6
      sessions.php

1
classes/structure.php

@ -395,6 +395,7 @@ class mod_attendance_structure {
$sess->lasttaken = 0;
$sess->lasttakenby = 0;
$sess->studentscanmark = 0;
$sess->studentpassword = '';
$event->add_record_snapshot('attendance_sessions', $sess);
$event->trigger();

6
sessions.php

@ -294,11 +294,11 @@ function construct_sessions_data_for_add($formdata) {
$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;

Loading…
Cancel
Save