diff options
| author | Friedrich Beckmann <friedrich.beckmann@gmx.de> | 2026-01-30 17:59:23 +0100 |
|---|---|---|
| committer | Friedrich Beckmann <friedrich.beckmann@gmx.de> | 2026-01-30 17:59:23 +0100 |
| commit | d0fce093ef2f16fc2897baf7ddf93b6f969890bf (patch) | |
| tree | c39446943c2a36c4bafcaa5e1640d3ea85721a90 /setup.php | |
initial commit
The first prototype where you can upload student data from moodle
and change the marks. In student view the results for the logged in
person can be viewed.
Diffstat (limited to 'setup.php')
| -rw-r--r-- | setup.php | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/setup.php b/setup.php new file mode 100644 index 0000000..640ee56 --- /dev/null +++ b/setup.php @@ -0,0 +1,93 @@ +<?php +if (!isset($setupdone)) { +$setupdone=TRUE; +include "database.php"; + +$semester = ["WiSe 2025/26", "SoSe 2025", "WiSe 2024/25"]; + +$admins = ["beckmanf"]; + +function my_session_start() { + $secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'); + session_start([ + 'use_strict_mode' => 1, + 'cookie_httponly' => 1, + 'cookie_secure' => $secure, // Only if using HTTPS + 'cookie_samesite' => 'Strict', // or 'Lax' + 'use_only_cookies' => 1 + ]); + // Set session timeout + if (isset($_SESSION['LAST_ACTIVITY']) && + (time() - $_SESSION['LAST_ACTIVITY'] > 1800)) { // 30 minutes + session_unset(); + session_destroy(); + } + $_SESSION['LAST_ACTIVITY'] = time(); +} + +$pfp = array ( + "ti" => array ( + "name" => "Technische Informatik", + "pnr" => ["1710080", "3707100"], + "studiengang" => ["EI", "ME"] + ), + "dt" => array ( + "name" => "Digitaltechnik", + "pnr" => ["3976090"], + "studiengang" => ["TI"] + ) +); + +$notenlabor = ["BE", "NB", "AB", "NM", "NA"]; +$notenklausur = ["100","130","170","200","230","270","300","330","370","400","500"]; + +$students = array ( + "12345" => array ( + "vorname" => "Karl", + "nachname" => "Meier", + "studiengang" => "EI", + "noten" => array ( + "ti" => array ( + "klausur" => "500", + "labor" => "BE" + ), + "dt" => [] + ) + ), + "11111" => array ( + "vorname" => "Claudia", + "nachname" => "Darbo", + "studiengang" => "ME", + "noten" => array("ti" => [],"dt" => []) + ), + "22222" => array ( + "vorname" => "Günther", + "nachname" => "Kohl", + "studiengang" => "TI", + "noten" => array("ti" => [],"dt" => []) + ) +); + +$groups = array ( + "WiSe 2025/26" => array ( + "ti" => array ( + "G99-AA" => ["12345", "11111"], + "G99-ZZ" => ["22222", "11111"] + ) + ), + "SoSe 2025" => array ( + "ti" => array ( + "G99-AA" => ["11111"], + "G98-ZZ" => ["22222"] + ), + "dt" => array ( + "G99-KK" => ["11111"], + "G37-ZZ" => ["22222","12345"] + ) + ) +); + +db_read(); + +} //setupdone +?> |
