proctoring check ueberarbeitet

This commit is contained in:
ma0048
2026-01-08 12:01:20 +01:00
parent 5a77478071
commit 40ae57fb0c
5 changed files with 96 additions and 29 deletions
+9 -28
View File
@@ -1,34 +1,15 @@
(function () {
/*
const params = new URLSearchParams(location.search);
let expectedOrigin = params.get("examus-client-origin");
if (!expectedOrigin)
{
window.top.location.href = 'resetconnection.php';
return;
function sendMessage() {
let frame = window.frames['content'];
if (frame)
frame.postMessage({ type: "proctoringReady" });
}
*/
let proctoringOK = false;
window.addEventListener("message", function (e) {
/*if (e.origin !== expectedOrigin) {
return;
}*/
const data = e.data || {};
if (data.proctoringIsActive)
window.addEventListener("message", function (e)
{
if (e.data.indexOf("proctoringReady_") === 0)
{
proctoringOK = true;
sendMessage();
}
});
setTimeout(function () {
if (!proctoringOK)
{
top.location.href='resetconnection.php';
}
}, 1000);
})();
})();
+30
View File
@@ -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);
}
+3 -1
View File
@@ -183,7 +183,9 @@ if(!isset($_SESSION['pruefling_id']))
die($p->t('testtool/bitteZuerstAnmelden'));
if (!empty($_SESSION['externe_ueberwachung']) && isset($_SESSION['externe_ueberwachung_verified'])): ?>
<script type="text/javascript" src="externeueberwachung.js"></script>
<link href="frage.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="frage_externe_ueberwachung.js"></script>
<div id="proctoringBlocker" class="proctoring-blocker hidden"></div>
<?php endif;
$pruefling = new pruefling();
@@ -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 = '<div class="proctoring-text">Loading...</div>';
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);
})();
+1
View File
@@ -22,6 +22,7 @@ if ((isset($_SESSION['externe_ueberwachung']) && $_SESSION['externe_ueberwachung
<link href="../../skin/style.css.php" rel="stylesheet" type="text/css">
<?php
if (!empty($_SESSION['externe_ueberwachung'])) : ?>
<script type="text/javascript" src="externeueberwachung.js"></script>
<script>
function loadInContent(url)
{