13:$allEvents = $db->query('SELECT id, title, category, book_ref, chapter_ref, summary FROM events ORDER BY sort_order')->fetchAll(PDO::FETCH_ASSOC);
21:    $event = $stmt->fetch(PDO::FETCH_ASSOC);
27:        $questions = $stmt->fetchAll(PDO::FETCH_ASSOC);
34:    $stmt = $db->prepare('SELECT score, total FROM quiz_results WHERE user_id = ? AND entity_type = ? AND entity_id = ? ORDER BY score DESC LIMIT 1');
36:    $bestScore = $stmt->fetch(PDO::FETCH_ASSOC);
41:$stmt = $db->prepare('SELECT entity_id, MAX(score) as best_score, MAX(total) as total FROM quiz_results WHERE user_id = ? AND entity_type = ? GROUP BY entity_id');
43:foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $row) {
178:        <button type="button" class="btn-quiz-submit" id="btnSubmit" onclick="submitQuiz()">
229:async function submitQuiz() {
253:    const res = await api('/src/api/quiz.php?action=submit', 'POST', {
