package com.ruoyi.web.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.mxjb.domain.MxjbContants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

@Data
@ApiModel("考题")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class QuestionDto implements Serializable {
    @ApiModelProperty("考生类型 1是测评evaluation(default)，2是竞赛competitor ")
    Integer examineeType;
    @ApiModelProperty("考生id")
    Long examineeId;
    @ApiModelProperty("考生号")
    String customerCode;
    @ApiModelProperty("姓名")
    String customerName;
    @ApiModelProperty("班名")
    String className;
    @ApiModelProperty("考题id")
    Long questionId;
    @ApiModelProperty("考题序号")
    Long seq;
    @ApiModelProperty("学科Id")
    Long subjectId;
    @ApiModelProperty("知识点Id")
    Long knowledgeId;
    @ApiModelProperty("知识点")
    String knowledgeName;
    @ApiModelProperty("考题类型 question_type")
    String typeId;
    @ApiModelProperty("考题类型名称")
    String type;
    @ApiModelProperty("考题题干")
    String title;
    @ApiModelProperty("考题来源")
    String source;

    @ApiModelProperty("考生答案")
    String answer;
    @ApiModelProperty("考生附件")
    List<String> attachments;
    private Long duration;
    @ApiModelProperty("试题解析")
    String parse;
    @ApiModelProperty("答题正确状态")
    Long state;
    @ApiModelProperty("得分级别")
    String scoreLevel = "E";
    @ApiModelProperty("总分")
    Long scoreTotal;
    @ApiModelProperty("得分")
    Long score;
    @ApiModelProperty("得分率")
    Double scoreRate;
    @ApiModelProperty("试题视频")
    String videoUrl;
    @ApiModelProperty("视频类型")
    Integer aliIdType = MxjbContants.Ali_Id_question;


    @ApiModelProperty("错误个数")
    Long wrongCount;
    @ApiModelProperty("备注")
    String comment;
    List<String> options;
    List<String> answers;
    List<QuestionDto> subQuestions;
    @ApiModelProperty("收藏")
    boolean collect;
    @ApiModelProperty("当前题")
    boolean current;
    @ApiModelProperty("测评时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    Date time;
    @ApiModelProperty("测试时间")
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    Date createTime;

    public String getAnswer() {
        return (null == answer || "null".equals(answer)) ? "" : answer;
    }
}
