diff --git a/classes/form/addsession.php b/classes/form/addsession.php index 43dda86..4bf381c 100644 --- a/classes/form/addsession.php +++ b/classes/form/addsession.php @@ -252,9 +252,8 @@ class addsession 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 5b7b52c..eeb6342 100644 --- a/settings.php +++ b/settings.php @@ -161,6 +161,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));