<?php
require_once 'config/database.php';
$pdo = getDB();

try {
    // Update student_answer status enum
    $pdo->exec("ALTER TABLE student_answer MODIFY COLUMN status ENUM('pending','in_progress','submitted','graded','needs_review','auto_graded','manually_graded','partially_graded','regraded','archived','pending_manual_review') NOT NULL DEFAULT 'pending'");
    echo "✓ Updated student_answer status enum\n";

    // Update student_answers status enum
    $pdo->exec("ALTER TABLE student_answers MODIFY COLUMN status ENUM('in_progress','saved','submitted','graded','reviewed','pending_manual_review') DEFAULT 'in_progress'");
    echo "✓ Updated student_answers status enum\n";

} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
?>