Existing exam tables: exam_attempt_answers, exam_attempts, exam_materials, exam_questions, exam_sets Table: exam_materials ------------------------------------------------------------ id int(10) unsigned NOT NULL AUTO_INCREMENT original_filename varchar(255) NOT NULL stored_filename varchar(255) NOT NULL file_extension varchar(10) NOT NULL mime_type varchar(127) NOT NULL file_size int(10) unsigned NOT NULL extracted_text longtext NULL structured_content_json longtext NULL status enum('uploaded','text_extracted','questions_generated','failed') NOT NULL DEFAULT uploaded error_message text NULL created_at datetime NOT NULL DEFAULT current_timestamp() Indexes: - UNIQUE PRIMARY (id) - idx_em_status (status) - idx_em_created_at (created_at) Table: exam_sets ------------------------------------------------------------ id int(10) unsigned NOT NULL AUTO_INCREMENT material_id int(10) unsigned NOT NULL set_number int(10) unsigned NOT NULL requested_count int(10) unsigned NOT NULL DEFAULT 50 generated_count int(10) unsigned NOT NULL DEFAULT 0 skipped_duplicate_count int(10) unsigned NOT NULL DEFAULT 0 status enum('requested','generated','partial','failed') NOT NULL DEFAULT requested error_message text NULL created_at datetime NOT NULL DEFAULT current_timestamp() rejected_invalid_count int(10) unsigned NOT NULL DEFAULT 0 Indexes: - UNIQUE PRIMARY (id) - UNIQUE uq_es_material_set_number (material_id) - UNIQUE uq_es_material_set_number (set_number) - idx_es_material_id (material_id) - idx_es_set_number (set_number) - idx_es_status (status) Table: exam_questions ------------------------------------------------------------ id int(10) unsigned NOT NULL AUTO_INCREMENT material_id int(10) unsigned NOT NULL exam_set_id int(10) unsigned NOT NULL question text NOT NULL option_a text NOT NULL option_b text NOT NULL option_c text NOT NULL option_d text NOT NULL correct_option enum('A','B','C','D') NOT NULL explanation text NULL source_location varchar(255) NOT NULL source_quote text NULL topic varchar(150) NULL difficulty enum('easy','medium','hard') NULL DEFAULT medium question_hash char(64) NULL sort_order int(10) unsigned NOT NULL DEFAULT 0 created_at datetime NOT NULL DEFAULT current_timestamp() Indexes: - UNIQUE PRIMARY (id) - idx_eq_material_id (material_id) - idx_eq_exam_set_id (exam_set_id) - idx_eq_question_hash (question_hash) Table: exam_attempts ------------------------------------------------------------ id int(10) unsigned NOT NULL AUTO_INCREMENT exam_set_id int(10) unsigned NOT NULL material_id int(10) unsigned NOT NULL started_at datetime NULL expires_at datetime NULL submitted_at datetime NULL status enum('not_started','in_progress','submitted','auto_submitted','expired') NOT NULL DEFAULT not_started score int(10) unsigned NULL total_questions int(10) unsigned NOT NULL DEFAULT 0 answered_count int(10) unsigned NOT NULL DEFAULT 0 created_at datetime NOT NULL DEFAULT current_timestamp() Indexes: - UNIQUE PRIMARY (id) - idx_ea_exam_set_id (exam_set_id) - idx_ea_material_id (material_id) - idx_ea_status (status) Table: exam_attempt_answers ------------------------------------------------------------ id int(10) unsigned NOT NULL AUTO_INCREMENT attempt_id int(10) unsigned NOT NULL question_id int(10) unsigned NOT NULL selected_option enum('A','B','C','D') NULL is_correct tinyint(1) NULL answered_at datetime NULL created_at datetime NOT NULL DEFAULT current_timestamp() Indexes: - UNIQUE PRIMARY (id) - UNIQUE uq_eaa_attempt_question (attempt_id) - UNIQUE uq_eaa_attempt_question (question_id) - idx_eaa_attempt_id (attempt_id) - idx_eaa_question_id (question_id) All expected Exam Prep tables verified.