- test-related request block redesigned - elvis operator replaced with the more adequate null coalescing one
70 lines
2.1 KiB
PHP
70 lines
2.1 KiB
PHP
<?php
|
|
|
|
require_once "globals.php";
|
|
require_once "autologin.php";
|
|
|
|
$user_data = get_autologin_user_data();
|
|
if (!get_autologin_state() || !isset($_REQUEST["testid"])) {
|
|
exit();
|
|
}
|
|
|
|
$testid = trim($_REQUEST["testid"] ?? "");
|
|
$view_only = trim($_REQUEST["view_only"] ?? "false") === "true";
|
|
$gameid = trim($_REQUEST["gameid"] ?? "");
|
|
|
|
if ($testid === "") {
|
|
exit();
|
|
}
|
|
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0'>
|
|
<title>SpreadQuiz</title>
|
|
<script src="js/req.js"></script>
|
|
<script src="js/spreadquiz.js"></script>
|
|
<script src="js/o.js"></script>
|
|
<script src="js/common.js"></script>
|
|
<script src="js/testground.js"></script>
|
|
<link rel="stylesheet" href="style/spreadquiz.css">
|
|
<link rel="stylesheet" href="style/spreadquiz_mobile.css">
|
|
<script id="MathJax-script" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
|
</head>
|
|
<body>
|
|
<section id="test_display">
|
|
|
|
</section>
|
|
<section id="infobox">
|
|
<span id="game_name"></span>
|
|
<section>
|
|
<?php if ($view_only) { ?>
|
|
<section style="margin-bottom: 1em">
|
|
CSAK OLVASHATÓ,<br>
|
|
NEM FRISSÜL AUTOMATIKUSAN!
|
|
</section>
|
|
<?php } ?>
|
|
<section id="ongoing-info">
|
|
<section id="time-info" shown="false">
|
|
<span class="infobox-description">Hátralevő idő:</span>
|
|
<section id="timer">00:00:00</section>
|
|
</section>
|
|
<section id="further-info">
|
|
|
|
</section>
|
|
<input type="button" value="Beküld" onclick="submit_test()" id="submit_btn">
|
|
</section>
|
|
<section id="concluded-info">
|
|
<section id="duration"></section>
|
|
<span class="infobox-description">Eredmény:</span>
|
|
<section id="percentage">100% (20/20)</section>
|
|
</section>
|
|
</section>
|
|
</section>
|
|
<script>
|
|
populate_all("<?=$testid ?>", "<?=$gameid ?>", <?=$view_only ?>);
|
|
</script>
|
|
</body>
|
|
</html>
|