Browse Source

set default values a bit better.

MOODLE_32_STABLE
Dan Marsden 8 years ago
parent
commit
4ba19a86ca
  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->lasttaken = 0;
$sess->lasttakenby = 0; $sess->lasttakenby = 0;
$sess->studentscanmark = 0; $sess->studentscanmark = 0;
$sess->studentpassword = '';
$event->add_record_snapshot('attendance_sessions', $sess); $event->add_record_snapshot('attendance_sessions', $sess);
$event->trigger(); $event->trigger();

6
sessions.php

@ -294,11 +294,11 @@ function construct_sessions_data_for_add($formdata) {
$sess->description = $formdata->sdescription['text']; $sess->description = $formdata->sdescription['text'];
$sess->descriptionformat = $formdata->sdescription['format']; $sess->descriptionformat = $formdata->sdescription['format'];
$sess->timemodified = $now; $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->studentscanmark = 1;
$sess->studentpassword = $formdata->studentpassword; $sess->studentpassword = $formdata->studentpassword;
} else {
$sess->studentpassword = '';
} }
$sess->statusset = $formdata->statusset; $sess->statusset = $formdata->statusset;

Loading…
Cancel
Save