-- 语音评测表
DROP TABLE IF EXISTS `voice_evaluation`;
CREATE TABLE `voice_evaluation` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '评测ID',
  `student_id` bigint NOT NULL COMMENT '学员ID（外键关联sys_user表）',
  `course_id` bigint DEFAULT NULL COMMENT '课程ID（外键关联course表，可为空）',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '评测内容（课文或文字）',
  `audio_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '音频文件路径',
  `score` decimal(10,2) DEFAULT NULL COMMENT '评分（总分，0-100）',
  `accuracy` decimal(10,2) DEFAULT NULL COMMENT '准确度（0-100）',
  `fluency` decimal(10,2) DEFAULT NULL COMMENT '流畅度（0-100）',
  `completeness` decimal(10,2) DEFAULT NULL COMMENT '完整度（0-100）',
  `pronunciation` decimal(10,2) DEFAULT NULL COMMENT '发音得分（0-100）',
  `result_detail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '评测详情（JSON格式，包含详细评测结果）',
  `evaluation_time` datetime DEFAULT NULL COMMENT '评测时间',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`),
  KEY `idx_student_id` (`student_id`),
  KEY `idx_course_id` (`course_id`),
  KEY `idx_evaluation_time` (`evaluation_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='语音评测表';

