prepare("SELECT * FROM exams WHERE id = ?"); $exam_stmt->execute([$exam_id]); $exam = $exam_stmt->fetch(); if (!$exam) { // Exam not found header("Location: dashboard_siswa.php"); exit(); } // Fetch questions and choices $questions_stmt = db()->prepare("SELECT * FROM questions WHERE exam_id = ? ORDER BY id"); $questions_stmt->execute([$exam_id]); $questions = $questions_stmt->fetchAll(); $page_title = "Kerjakan Ujian: " . htmlspecialchars($exam['title']); ?>