diff --git a/cis/testtool/externeueberwachung.js b/cis/testtool/externeueberwachung.js
new file mode 100644
index 000000000..71951779f
--- /dev/null
+++ b/cis/testtool/externeueberwachung.js
@@ -0,0 +1,15 @@
+(function () {
+ function sendMessage() {
+ let frame = window.frames['content'];
+ if (frame)
+ frame.postMessage({ type: "proctoringReady" });
+ }
+
+ window.addEventListener("message", function (e)
+ {
+ if (e.data.indexOf("proctoringReady_") === 0)
+ {
+ sendMessage();
+ }
+ });
+})();
diff --git a/cis/testtool/frage.css b/cis/testtool/frage.css
new file mode 100644
index 000000000..04024ae53
--- /dev/null
+++ b/cis/testtool/frage.css
@@ -0,0 +1,30 @@
+.proctoring-blocker
+{
+ position: fixed;
+ inset: 0;
+ z-index: 99999;
+ backdrop-filter: blur(6px);
+ pointer-events: all;
+ user-select: none;
+}
+
+.proctoring-blocker.hidden
+{
+ display: none !important;
+}
+
+.proctoring-text
+{
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ color: #fff;
+ font-size: 16px;
+ font-family: sans-serif;
+}
+
+.proctoring-blur-fallback
+{
+ filter: blur(6px);
+}
diff --git a/cis/testtool/frage.php b/cis/testtool/frage.php
index c38229cdf..bf2ee24c5 100644
--- a/cis/testtool/frage.php
+++ b/cis/testtool/frage.php
@@ -45,7 +45,7 @@ if (!$db = new basis_db())
$PHP_SELF=$_SERVER["PHP_SELF"];
// Start session
-session_start();
+require_once './session_init.php';
// If language is changed by language select menu, reset language variables
if (isset($_GET['sprache_user']) && !empty($_GET['sprache_user']))
@@ -182,6 +182,12 @@ echo '
if(!isset($_SESSION['pruefling_id']))
die($p->t('testtool/bitteZuerstAnmelden'));
+if (!empty($_SESSION['externe_ueberwachung']) && isset($_SESSION['externe_ueberwachung_verified'])): ?>
+
+
+
+load($_SESSION['pruefling_id']);
diff --git a/cis/testtool/frage_externe_ueberwachung.js b/cis/testtool/frage_externe_ueberwachung.js
new file mode 100644
index 000000000..31a7b414f
--- /dev/null
+++ b/cis/testtool/frage_externe_ueberwachung.js
@@ -0,0 +1,53 @@
+(function () {
+ let ok = false;
+ let blocker;
+
+ function showBlocker() {
+ blocker = document.getElementById("proctoringBlocker");
+
+ if (!blocker)
+ {
+ blocker = document.createElement("div");
+ blocker.id = "proctoringBlocker";
+ blocker.className = "proctoring-blocker";
+ blocker.innerHTML = 'Loading...
';
+ document.body.appendChild(blocker);
+ }
+ document.documentElement.classList.add("proctoring-blur-fallback");
+ }
+
+ function block() {
+ showBlocker();
+ blocker.classList.remove("hidden");
+ }
+
+ function unblock() {
+ document.documentElement.classList.remove("proctoring-blur-fallback");
+ if (!blocker) return;
+ blocker.classList.add("hidden");
+ }
+
+ const blockTimer = setTimeout(function () {
+ if (!ok)
+ block();
+ }, 1500);
+
+ window.addEventListener("message", function (e) {
+ const data = e.data || {};
+
+ if (data.type === "proctoringReady")
+ {
+ ok = true;
+ clearTimeout(blockTimer);
+ unblock();
+ }
+ });
+
+ setTimeout(function () {
+ if (!ok) {
+ top.location.href = "resetconnection.php";
+ }
+ }, 3000);
+})();
+
+
diff --git a/cis/testtool/index.php b/cis/testtool/index.php
index d235e6ce9..6f2cfac26 100644
--- a/cis/testtool/index.php
+++ b/cis/testtool/index.php
@@ -1,16 +1,79 @@
TestTool - FH Technikum Wien
+
+
+
+
+
diff --git a/cis/testtool/login.php b/cis/testtool/login.php
index 5306dadab..5aa46de7e 100644
--- a/cis/testtool/login.php
+++ b/cis/testtool/login.php
@@ -40,8 +40,7 @@ if (!$db = new basis_db())
die('Fehler beim Oeffnen der Datenbankverbindung');
// Start session
-session_start();
-
+require_once './session_init.php';
// Logout (triggered by logout button in menu.php)
if (isset($_GET['logout']) && $_GET['logout'] == true)
{
@@ -173,6 +172,12 @@ if (isset($_REQUEST['prestudent']))
else
$reload_menu = true;
}
+
+ if ($rt->externe_ueberwachung && defined('TESTTOOL_EXTERNE_UEBERWACHUNG_ALLOWED') && TESTTOOL_EXTERNE_UEBERWACHUNG_ALLOWED)
+ {
+ $_SESSION['externe_ueberwachung'] = true;
+ $_SESSION['externe_ueberwachung_verified'] = false;
+ }
}
$pruefling = new pruefling();
@@ -339,6 +344,8 @@ if ((isset($_SESSION['prestudent_id']) && !isset($_SESSION['pruefling_id']) &&
!isset($_SESSION['confirmation_needed']) && !isset($_SESSION['confirmed_code'])) ||
(isset($_SESSION['confirmation_needed']) && $_SESSION['confirmation_needed'] === true &&
isset($_SESSION['confirmed_code']) && $_SESSION['confirmed_code'] === true &&
+ isset($_SESSION['externe_ueberwachung']) && $_SESSION['externe_ueberwachung'] === true &&
+ isset($_SESSION['externe_ueberwachung_verified']) && $_SESSION['externe_ueberwachung_verified'] === true &&
isset($_SESSION['prestudent_id']) && !isset($_SESSION['pruefling_id'])))
{
$pruefling = new pruefling();
@@ -460,7 +467,13 @@ if (isset($_POST['save']) && isset($_SESSION['prestudent_id']))
top.location.href = 'resetconnection.php';";
+ exit;
+}
+else if (isset($_SESSION['confirmation_needed']) && $_SESSION['confirmation_needed'] === true &&
isset($_SESSION['confirmed_code']) && $_SESSION['confirmed_code'] === false)
{
echo '
diff --git a/cis/testtool/menu.php b/cis/testtool/menu.php
index 7cb6f138d..11e032f0b 100644
--- a/cis/testtool/menu.php
+++ b/cis/testtool/menu.php
@@ -34,7 +34,7 @@ if (!$db = new basis_db())
die('Fehler beim Oeffnen der Datenbankverbindung');
// Start session
-session_start();
+require_once './session_init.php';
// If language is changed by language select menu, reset language and session variables
if(isset($_GET['sprache_user']) && !empty($_GET['sprache_user']))
@@ -61,8 +61,12 @@ $p = new phrasen($sprache_user);
db_add_param($_SESSION['studiengang_kz'])." LIMIT 1";
@@ -73,7 +77,7 @@ if (isset($_SESSION['pruefling_id']))
// Link zur Startseite
echo '|
- '.$p->t('testtool/startseite').'
+ '.$p->t('testtool/startseite').'
|
';
// Link zur Einleitung
@@ -83,7 +87,7 @@ if (isset($_SESSION['pruefling_id']))
{
echo '
|
- '.$p->t('testtool/einleitung').'
+ '.$p->t('testtool/einleitung').'
|
';
}
@@ -379,10 +383,13 @@ if (isset($_SESSION['pruefling_id']))
}
}
+
echo '
+
|
- '.$gebietbezeichnung.'
+ '.$gebietbezeichnung.'
+
|
';
@@ -401,7 +408,7 @@ if (isset($_SESSION['pruefling_id']))
// Link zum Logout
echo '|
- Logout
+ Logout
|
';
echo '';
@@ -439,5 +446,22 @@ else
'');
}
});
+
+ function loadContent(url)
+ {
+ if (parent && typeof parent.loadInContent === 'function')
+ {
+ parent.loadInContent(url);
+ return false;
+ }
+
+ let frame = parent?.frames?.["content"];
+ if (frame)
+ {
+ frame.location.href = url;
+ return false;
+ }
+ }
+