<?php
require_once __DIR__ . '/config/database.php';
requireLogin();
if (!hasRole('instructor') && !hasPermission('can_create_assessments')) redirect('dashboard.php');
$db = Database::getInstance();
$id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
$assessment_id = isset($_GET['assessment_id']) ? (int)$_GET['assessment_id'] : 0;
if ($id) {
    $db->query("DELETE FROM assessment_questions WHERE id = ?", [$id]);
}
header('Location: ' . APP_URL . '/lms/assessment_questions.php?assessment_id=' . (int)$assessment_id);
exit;
