SpreadQuiz/game_manager_frame.php
Epagris 1fff851fb5 - function doing report generation has been beautified
- report generation windows was added to game manager
- full TeX source downloading compressed into a ZIP
2024-09-28 13:23:08 +02:00

160 lines
6.4 KiB
PHP

<?php
require_once "check_maintenance.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}`)"><br>
<input type="button" value="Csoportonkénti jelentés" onclick="show('report_generator')">
</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>
<section class="window" shown="false" id="report_generator">
<section class="window-inner">
<input type="text" placeholder="Csoportok" value="" id="report_groups">
<input type="text" placeholder="Szűrő" value="" id="report_filter">
<select id="report_output_type">
<option value="pdf">PDF</option>
<option value="tex">TeX</option>
</select>
<input type="button" value="Előállítás" onclick="generate_game_report_by_groups()">
<input type="button" value="Bezárás" onclick="hide('report_generator')">
</section>
</section>
<script>
list_all_games();
</script>
</body>
</html>