145 lines
5.7 KiB
PHP
145 lines
5.7 KiB
PHP
<?php
|
|
|
|
require_once "globals.php";
|
|
require_once "autologin.php";
|
|
|
|
$user_data = get_autologin_user_data();
|
|
if (!get_autologin_state() || (($user_data["privilege"] !== PRIVILEGE_CREATOR) && ($user_data["privilege"] !== PRIVILEGE_QUIZMASTER))) {
|
|
exit(); // this page is only available for quizmasters
|
|
}
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="hu">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>SpreadQuiz</title>
|
|
<script src="js/o.js"></script>
|
|
<script src="js/req.js"></script>
|
|
<script src="js/quizmaster_common.js"></script>
|
|
<script src="js/spreadquiz.js"></script>
|
|
<script src="js/common.js"></script>
|
|
<script src="js/hintbox.js"></script>
|
|
<script src="js/usermgr.js"></script>
|
|
<script src="js/gamemgr.js"></script>
|
|
<link rel="stylesheet" href="style/spreadquiz.css"/>
|
|
<link rel="stylesheet" href="style/quizmaster_area.css"/>
|
|
</head>
|
|
<body>
|
|
<section id="table_section">
|
|
<table class="management">
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
<th>Név</th>
|
|
<th>Leírás</th>
|
|
<th>Tulajdonos</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="game_manager_table">
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
<section>
|
|
<input type="button" value="Új játék" onclick="create_edit_game();">
|
|
<input type="button" value="Játék(ok) törlése" onclick="delete_games()">
|
|
</section>
|
|
<section class="window" shown="false" id="game_editor_window">
|
|
<section class="window-inner">
|
|
<section style="text-align: right">
|
|
<table>
|
|
<tr>
|
|
<td><label for="game_name">Név:</label></td>
|
|
<td><input type="text" id="game_name"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><label for="game_description">Leírás:</label></td>
|
|
<td><input type="text" id="game_description"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><label for="game_owner">Tulajdonos:</label></td>
|
|
<td><input type="text" id="game_owner" readonly></td>
|
|
</tr>
|
|
</table>
|
|
<section id="additional_controls">
|
|
<table>
|
|
<tr>
|
|
<td><label for="game_contributors">Szerkesztők:</label></td>
|
|
<td><input type="text" id="game_contributors"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><label>Kérdés-fájlok:</label></td>
|
|
<td>
|
|
<input type="button" id="download_challenges_btn" value="Letöltés CSV-ként" shown="false"
|
|
onclick="download_challenges()">
|
|
<input type="button" id="edit_challenges_btn" value="Szerkesztés"
|
|
onclick="edit_challenges()" shown="false">
|
|
<input type="button" value="Új feltöltése" id="show_game_file_upload"
|
|
onclick="show_hide_gamefile_upload(true)">
|
|
<input type="file" id="game_file" shown="false">
|
|
<input type="button" value="Mégse" id="cancel_game_file_upload" shown="false"
|
|
onclick="show_hide_gamefile_upload(false);">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><label for="game_groups">Csoportok:</label></td>
|
|
<td><input type="text" id="game_groups"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><label for="time_limited">Időkorlátos:</label></td>
|
|
<td>
|
|
<input type="checkbox" id="time_limited" oninput="handle_time_limit_chkbox()">
|
|
<input type="text" pattern="(([01][0-9])|([2][0-3])):[0-5][0-9]:[0-5][0-9]" id="time_limit">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<label for="repeatable">Megismételhető:</label>
|
|
</td>
|
|
<td>
|
|
<input type="checkbox" id="repeatable">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<label for="public">Publikus:</label>
|
|
</td>
|
|
<td>
|
|
<input type="checkbox" id="public">
|
|
<input type="text" id="public_url" readonly>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
Eredmények:
|
|
</td>
|
|
<td>
|
|
<input type="button" value="Gyors áttekintés" onclick="list_results_by_game(EDITED_GAME)">
|
|
<input type="button" value="Részletes megjelenítés" onclick="window.open(`result_analyzer.php?game_id=${EDITED_GAME._id}`)">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</section>
|
|
</section>
|
|
<section style="text-align: right; display: block">
|
|
<input type="button" value="" id="game_editor_submit_btn">
|
|
<input type="button" value="Mégse" onclick="hide('game_editor_window')">
|
|
</section>
|
|
</section>
|
|
</section>
|
|
|
|
<section class="window" shown="false" id="results_viewer_window">
|
|
<section class="window-inner">
|
|
<section id="results_display">
|
|
|
|
</section>
|
|
<input type="button" value="Bezárás" onclick="hide('results_viewer_window')">
|
|
</section>
|
|
</section>
|
|
|
|
<script>
|
|
list_all_games();
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|