package com.zd.exam.domain;

import java.util.List;
import java.util.Date;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zd.common.core.annotation.Excel;
import com.zd.common.core.web.domain.BaseEntity;
import com.zd.exam.domain.vo.ExamConfig;
import com.zd.exam.util.CourcseUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.data.annotation.Transient;

/**
 * 试卷管理对象 el_paper
 *
 * @author zd
 * @date 2021-08-31
 */
@ApiModel(value = "试卷管理", description = "试卷管理")
public class ElPaper extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 试卷ID
     */
    private Long id;

    /**
     * 考试类型- 同exam
     */
    private Integer scopeType;
    /**
     * 分类ID 多个以逗号分隔
     */
    @ApiModelProperty(value = "分类ID 多个以逗号分隔")
    private String classifyIds;

    @ApiModelProperty(value = "分类名称 多个以逗号分隔")
    private String classifyNames;
    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID")
    @Excel(name = "用户ID")
    private Long joinUserId;

    /**
     * 考试ID
     */
    @ApiModelProperty(value = "考试ID")
    @Excel(name = "考试ID")
    private Long examId;

    /**
     * 章节ID
     */
    @ApiModelProperty(value = "章节ID")
    private Long courseChapterId;

    /**
     * 考试分值 设置类
     */
    private ExamConfig examConfig;

    /**
     * 考试标题
     */
    @ApiModelProperty(value = "考试标题")
    @Excel(name = "考试标题")
    private String title;

    /**
     * 考试时长
     */
    @ApiModelProperty(value = "考试时长")
    @Excel(name = "考试时长")
    private Integer totalTime;

    /**
     * 用户时长
     */
    @ApiModelProperty(value = "用户时长")
    @Excel(name = "用户时长")
    private Integer userTime;

    private String userTimeStr;

    /**
     * 试卷总分
     */
    @ApiModelProperty(value = "试卷总分")
    @Excel(name = "试卷总分")
    private Integer totalScore;

    /**
     * 及格分
     */
    @ApiModelProperty(value = "及格分")
    @Excel(name = "及格分")
    private Integer qualifyScore;

    /**
     * 客观得分
     */
    @ApiModelProperty(value = "客观得分")
    @Excel(name = "客观得分")
    private Integer objScore;

    /**
     * 主观分
     */
    @ApiModelProperty(value = "主观分")
    @Excel(name = "主观分")
    private Integer subjScore;

    /**
     * 用户得分
     */
    @ApiModelProperty(value = "用户得分")
    @Excel(name = "用户得分")
    private Integer userScore;

    /**
     * 是否包含简答
     */
    @Excel(name = "是否包含简答")
    private Integer hasSaq;

    /**
     * 试卷状态
     */
    @ApiModelProperty(value = "试卷状态")
    @Excel(name = "试卷状态")
    private Integer state;

    /**
     * 截止时间
     */
    @ApiModelProperty(value = "截止时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "截止时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date limitTime;

    /**
     * 试卷考题信息
     */
    @ApiModelProperty(value = "试卷考题信息")
    private List<ElPaperQu> elPaperQuList;

    @ApiModelProperty(value = "单选题列表")
    private List<ElPaperQu> radioList;

    @ApiModelProperty(value = "多选题列表")
    private List<ElPaperQu> multiList;

    @ApiModelProperty(value = "判断题")
    private List<ElPaperQu> judgeList;

    @Transient
    @ApiModelProperty(value = "违规id")
    private Long violationId;

    private Map<String, Object> otherData;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setJoinUserId(Long joinUserId) {
        this.joinUserId = joinUserId;
    }

    public Long getJoinUserId() {
        return joinUserId;
    }

    public void setExamId(Long examId) {
        this.examId = examId;
    }

    public Long getExamId() {
        return examId;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    public void setLimitTime(Date limitTime) {
        this.limitTime = limitTime;
    }

    public Date getLimitTime() {
        return limitTime;
    }

    public List<ElPaperQu> getElPaperQuList() {
        return elPaperQuList;
    }

    public void setElPaperQuList(List<ElPaperQu> elPaperQuList) {
        this.elPaperQuList = elPaperQuList;
    }

    public Integer getTotalTime() {
        return totalTime;
    }

    public void setTotalTime(Integer totalTime) {
        this.totalTime = totalTime;
    }

    public Integer getUserTime() {
        return userTime;
    }

    public void setUserTime(Integer userTime) {
        this.userTime = userTime;
        if(userTime != null){
            this.setUserTimeStr(userTime);
        }
    }

    public Integer getTotalScore() {
        return totalScore;
    }

    public void setTotalScore(Integer totalScore) {
        this.totalScore = totalScore;
    }

    public Integer getQualifyScore() {
        return qualifyScore;
    }

    public void setQualifyScore(Integer qualifyScore) {
        this.qualifyScore = qualifyScore;
    }

    public Integer getObjScore() {
        return objScore;
    }

    public void setObjScore(Integer objScore) {
        this.objScore = objScore;
    }

    public Integer getSubjScore() {
        return subjScore;
    }

    public void setSubjScore(Integer subjScore) {
        this.subjScore = subjScore;
    }

    public Integer getUserScore() {
        return userScore;
    }

    public void setUserScore(Integer userScore) {
        this.userScore = userScore;
    }

    public Integer getHasSaq() {
        return hasSaq;
    }

    public void setHasSaq(Integer hasSaq) {
        this.hasSaq = hasSaq;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public List<ElPaperQu> getRadioList() {
        return radioList;
    }

    public void setRadioList(List<ElPaperQu> radioList) {
        this.radioList = radioList;
    }

    public List<ElPaperQu> getMultiList() {
        return multiList;
    }

    public void setMultiList(List<ElPaperQu> multiList) {
        this.multiList = multiList;
    }

    public List<ElPaperQu> getJudgeList() {
        return judgeList;
    }

    public void setJudgeList(List<ElPaperQu> judgeList) {
        this.judgeList = judgeList;
    }

    public Long getViolationId() {
        return violationId;
    }

    public void setViolationId(Long violationId) {
        this.violationId = violationId;
    }

    public Integer getScopeType() {
        return scopeType;
    }

    public void setScopeType(Integer scopeType) {
        this.scopeType = scopeType;
    }

    public String getUserTimeStr() {
        return userTimeStr;
    }

    public void setUserTimeStr(Integer userTime) {
        this.userTimeStr = CourcseUtils.getTimeString(userTime);
    }

    public String getClassifyIds() {
        return classifyIds;
    }

    public void setClassifyIds(String classifyIds) {
        this.classifyIds = classifyIds;
    }

    public String getClassifyNames() {
        return classifyNames;
    }

    public void setClassifyNames(String classifyNames) {
        this.classifyNames = classifyNames;
    }

    public ExamConfig getExamConfig() {
        return examConfig;
    }

    public void setExamConfig(ExamConfig examConfig) {
        this.examConfig = examConfig;
    }

    public Long getCourseChapterId() {
        return courseChapterId;
    }

    public void setCourseChapterId(Long courseChapterId) {
        this.courseChapterId = courseChapterId;
    }

    public Map<String, Object> getOtherData() {
        return otherData;
    }

    public void setOtherData(Map<String, Object> otherData) {
        this.otherData = otherData;
    }
}
