CREATE TABLE IF NOT EXISTS student_training_answer (
  id varchar(64) NOT NULL COMMENT '主键ID',
  student_user_id varchar(64) NOT NULL COMMENT '学生用户ID',
  teaching_class_id varchar(64) NOT NULL COMMENT '教学班ID',
  task_id varchar(64) NOT NULL COMMENT '实训任务模块ID',
  task_key varchar(128) NOT NULL COMMENT '实训任务标识',
  task_name varchar(128) NOT NULL COMMENT '实训任务名称',
  step1_answer text NULL COMMENT '步骤一答案',
  step2_answer text NULL COMMENT '步骤二答案',
  step3_answer text NULL COMMENT '步骤三答案',
  step4_answer text NULL COMMENT '步骤四答案',
  current_step int DEFAULT 1 COMMENT '当前步骤',
  progress_status varchar(32) DEFAULT 'NOT_STARTED' COMMENT '进度状态',
  submitted bit(1) DEFAULT b'0' COMMENT '是否提交',
  submit_time datetime NULL COMMENT '提交时间',
  create_time datetime NULL COMMENT '创建时间',
  update_time datetime NULL COMMENT '更新时间',
  PRIMARY KEY (id),
  UNIQUE KEY uk_student_training_answer (student_user_id, teaching_class_id, task_id),
  KEY idx_student_training_answer_task (task_id),
  KEY idx_student_training_answer_class (teaching_class_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='学生实训任务答案';

ALTER TABLE student_training_answer CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
