diff --git a/add_form.php b/add_form.php index 0419e97..9aecda6 100644 --- a/add_form.php +++ b/add_form.php @@ -247,9 +247,8 @@ class mod_attendance_add_form extends moodleform { if (isset($pluginconfig->includeqrcode_default)) { $mform->setDefault('includeqrcode', $pluginconfig->includeqrcode_default); } - // TODO - Change in DB and provide value. - if (isset($pluginconfig->includeqrcode_default)) { - $mform->setDefault('rotateqrcode', $pluginconfig->includeqrcode_default); + if (isset($pluginconfig->rotateqrcode_default)) { + $mform->setDefault('rotateqrcode', $pluginconfig->rotateqrcode_default); } if (isset($pluginconfig->automark_default)) { $mform->setDefault('automark', $pluginconfig->automark_default); diff --git a/classes/import/sessions.php b/classes/import/sessions.php index 7233c2c..5b13b61 100644 --- a/classes/import/sessions.php +++ b/classes/import/sessions.php @@ -112,6 +112,7 @@ class sessions { get_string('preventsharediptime', 'attendance'), get_string('calendarevent', 'attendance'), get_string('includeqrcode', 'attendance'), + get_string('rotateqrcode', 'attendance'), ); } @@ -151,7 +152,8 @@ class sessions { 'preventsharedip' => $data->header16, 'preventsharediptime' => $data->header17, 'calendarevent' => $data->header18, - 'includeqrcode' => $data->header19 + 'includeqrcode' => $data->header19, + 'rotateqrcode' => $data->header20, ); } else { return array( @@ -174,7 +176,8 @@ class sessions { 'preventsharedip' => 16, 'preventsharediptime' => 17, 'calendarevent' => 18, - 'includeqrcode' => 19 + 'includeqrcode' => 19, + 'rotateqrcode' => 20 ); } } @@ -357,6 +360,11 @@ class sessions { } } + if ($mapping['rotateqrcode'] == -1) { + $session->rotateqrcode = $pluginconfig->rotateqrcode_default; + } else { + $session->rotateqrcode = $this->get_column_data($row, $mapping['rotateqrcode']); + } $session->statusset = 0; diff --git a/settings.php b/settings.php index 88ce361..8d8aba2 100644 --- a/settings.php +++ b/settings.php @@ -136,6 +136,9 @@ if ($ADMIN->fulltree) { $settings->add(new admin_setting_configcheckbox('attendance/includeqrcode_default', get_string('includeqrcode', 'attendance'), '', 0)); + $settings->add(new admin_setting_configcheckbox('attendance/rotateqrcode_default', + get_string('rotateqrcode', 'attendance'), '', 0)); + $settings->add(new admin_setting_configcheckbox('attendance/autoassignstatus', get_string('autoassignstatus', 'attendance'), '', 0));