-- 为错题表添加掌握状态和统计字段

ALTER TABLE `exam_mistakes`
ADD COLUMN `mastery_status` VARCHAR(20) DEFAULT 'unmastered' COMMENT '掌握状态: unmastered-未掌握, mastered-已掌握' AFTER `question_type`,
ADD COLUMN `difficulty` VARCHAR(20) DEFAULT 'medium' COMMENT '题目难度: easy-简单, medium-中等, hard-困难' AFTER `mastery_status`,
ADD COLUMN `wrong_count` INT DEFAULT 1 COMMENT '错误次数统计' AFTER `difficulty`,
ADD COLUMN `mastered_at` DATETIME NULL COMMENT '标记掌握时间' AFTER `wrong_count`,
ADD INDEX `idx_mastery_status` (`mastery_status`),
ADD INDEX `idx_difficulty` (`difficulty`);



