getMessage());
}
// === PROCESS FORM DATA ===
if (isset($_POST['team']) && isset(QUESTION_POINTS[$_POST['question']])) {
$team = $_POST['team'];
$question = $_POST['question'];
$date = (new DateTime())->format("Y-m-d");
if (isset($teamQuestionDates[$team][$question])) {
unset($teamQuestionDates[$team][$question]);
} else {
$teamQuestionDates[$team][$question] = $date;
}
try {
updateScoreFile($teamQuestionDates);
} catch (Exception $e) {
showError($e->getMessage());
}
}
$teamPoints = array_map("calculatePoints", $teamQuestionDates);
arsort($teamPoints);
$allQuestions = array_keys(QUESTION_POINTS);
?>
AIVD Kerstpuzzel Scorebord
Huidige stand
$points) {
$class = "w3-badge";
if ($i < 3) {
$class .= " w3-".MEDAL_COLORS[$i];
}
echo "- ".($i + 1)." ".$team." (".$points.")
\n";
$i++;
}
?>
Opgeloste vragen
Klik in het kaartje van jouw team op het nummer van een opgave om deze als (on)opgelost te markeren, dan
wordt de ranglijst meteen bijgewerkt.
$questionDates) {
echo "
\n";
$i++;
if ($i % 4 == 0 && $i < $n) {
echo "
\n";
echo "