package com.hotwj.platform.securityManagement.trainingAnswer.domain.vo;

import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import com.hotwj.platform.securityManagement.trainingAnswer.domain.HotTrainingAnswerRecord;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;


/**
 * 培训课程答题详情记录视图对象 hot_training_answer_record
 *
 * @author shihongwei
 * @date 2026-02-16
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = HotTrainingAnswerRecord.class)
public class HotTrainingAnswerRecordVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ExcelProperty(value = "主键")
    private Long id;

    /**
     * 公司ID（由应用层保证必填）
     */
    @ExcelProperty(value = "公司ID", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "由=应用层保证必填")
    private Long companyId;

    /**
     * 答题场景：LESSON=课程随堂题 PLAN=计划配置题
     */
    @ExcelProperty(value = "答题场景")
    private String sceneType;

    /**
     * 业务ID：当scene_type=LESSON时为课程ID，当scene_type=PLAN时为培训计划ID
     */
    @ExcelProperty(value = "业务ID")
    private Long businessId;

    /**
     * 题目来源：课程章节ID或计划配置项ID
     */
    @ExcelProperty(value = "题目来源")
    private Long questionSource;

    /**
     * 培训计划ID
     */
    @ExcelProperty(value = "培训计划ID")
    private Long trainingId;

    /**
     * 课程ID
     */
    @ExcelProperty(value = "课程ID")
    private Long courseId;

    /**
     * 试卷ID
     */
    @ExcelProperty(value = "试卷ID")
    private Long examId;

    /**
     * 培训人员ID
     */
    @ExcelProperty(value = "培训人员ID")
    private String userId;

    /**
     * 培训人员姓名
     */
    @ExcelProperty(value = "培训人员姓名")
    private String userName;

    /**
     * 题库题目ID（hot_question_bank.id）
     */
    @ExcelProperty(value = "题库题目ID", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "h=ot_question_bank.id")
    private Long questionId;

    /**
     * 试卷-题目关联ID（hot_exam_paper_question.id，可选）
     */
    @ExcelProperty(value = "试卷-题目关联ID", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "h=ot_exam_paper_question.id，可选")
    private Long paperQuestionId;

    /**
     * 题型：1=单选 2=多选 3=判断
     */
    @ExcelProperty(value = "题型：1=单选 2=多选 3=判断")
    private Long questionType;

    /**
     * 该题总分
     */
    @ExcelProperty(value = "该题总分")
    private Long questionScore;

    /**
     * 试卷中题目序号
     */
    @ExcelProperty(value = "试卷中题目序号")
    private Long questionOrder;

    /**
     * 标准答案(如 A,B)
     */
    @ExcelProperty(value = "标准答案(如 A,B)")
    private String correctAnswers;

    /**
     * 用户作答选项(如 A,B)
     */
    @ExcelProperty(value = "用户作答选项(如 A,B)")
    private String selectedAnswers;

    /**
     * 是否答对：1=正确 0=错误
     */
    @ExcelProperty(value = "是否答对：1=正确 0=错误")
    private Long isCorrect;

    /**
     * 本题得分
     */
    @ExcelProperty(value = "本题得分")
    private Long gainedScore;

    /**
     * 答题用时(秒)
     */
    @ExcelProperty(value = "答题用时(秒)")
    private Long answerDuration;

    /**
     * 提交答题时间
     */
    @ExcelProperty(value = "提交答题时间")
    private Date answerTime;

    /**
     * 创建者姓名
     */
    @ExcelProperty(value = "创建者姓名")
    private String createByName;

    /**
     * 更新者姓名
     */
    @ExcelProperty(value = "更新者姓名")
    private String updateByName;

    /**
     * 0=正常, 1=已删除
     */
    @ExcelProperty(value = "0=正常, 1=已删除")
    private Long isDeleted;

    private String trainingName;

    private String courseName;

    private String examName;

    private Long paperTotalScore;

    private Long passScore;

    private Long examScore;

    private Long learnDurationMin;

    private Date completeTime;

    private String questionDesc;

    private String optionA;

    private String optionB;

    private String optionC;

    private String optionD;

    private String optionE;

    private String optionF;

    private Long difficulty;

    private Long questionOriginalScore;

    private Long singleChoiceCount;

    private Long judgeCount;

    private Long totalQuestionScore;

    private Boolean passed;

    private Integer errorCount;

    private String errorAnswers;
}
