summaryrefslogtreecommitdiffstats
path: root/modules-available/exams/baseconfig/getconfig.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/exams/baseconfig/getconfig.inc.php')
-rw-r--r--modules-available/exams/baseconfig/getconfig.inc.php39
1 files changed, 24 insertions, 15 deletions
diff --git a/modules-available/exams/baseconfig/getconfig.inc.php b/modules-available/exams/baseconfig/getconfig.inc.php
index 37a2caf4..10aa1d84 100644
--- a/modules-available/exams/baseconfig/getconfig.inc.php
+++ b/modules-available/exams/baseconfig/getconfig.inc.php
@@ -1,19 +1,28 @@
<?php
-$locations = ConfigHolder::get('SLX_LOCATIONS');
-if ($locations === false) {
- $locationIds = [];
-} else {
- $locationIds = explode(' ', $locations);
-}
-if (Exams::isInExamMode($locationIds, $lectureId, $autoLogin)) {
- ConfigHolder::add('SLX_EXAM', 'yes', 10000);
- if (strlen($lectureId) > 0) {
- ConfigHolder::add('SLX_EXAM_START', $lectureId, 10000);
+$foofoo = function($machineUuid) {
+ // Leave clients in any runmode alone
+ $res = Database::queryFirst('SELECT machineuuid FROM runmode WHERE machineuuid = :uuid',
+ array('uuid' => $machineUuid), true);
+ if (is_array($res))
+ return;
+ // Check if exam mode should apply
+ $locations = ConfigHolder::get('SLX_LOCATIONS');
+ if ($locations === false) {
+ $locationIds = [];
+ } else {
+ $locationIds = explode(' ', $locations);
}
- if (strlen($autoLogin) > 0) {
- ConfigHolder::add('SLX_AUTOLOGIN', $autoLogin, 10000);
+ if (Exams::isInExamMode($locationIds, $lectureId, $autoLogin)) {
+ ConfigHolder::add('SLX_EXAM', 'yes', 10000);
+ if (strlen($lectureId) > 0) {
+ ConfigHolder::add('SLX_EXAM_START', $lectureId, 10000);
+ }
+ if (strlen($autoLogin) > 0) {
+ ConfigHolder::add('SLX_AUTOLOGIN', $autoLogin, 10000);
+ }
+ ConfigHolder::add('SLX_SYSTEMD_TARGET', 'exam-mode', 10000);
}
- ConfigHolder::add('SLX_SYSTEMD_TARGET', 'exam-mode', 10000);
- ConfigHolder::add("SLX_PVS_HYBRID", false, 10000);
-}
+};
+
+$foofoo($uuid); \ No newline at end of file