package com.ruoyi.mxjb.domain;

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

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ruoyi.common.enums.EnumWrongAnswersSource;
import com.ruoyi.common.utils.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 学生错题本对象 mxjb_wrong_book
 *
 * @author mingxue
 * @date 2021-06-12
 */
public class MxjbWrongBook extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** wrong_id */
    private Long wrongId;

    /** customer_code */
    @Excel(name = "customer_code")
    private String customerCode;

    /** 名称 */
    @Excel(name = "名称")
    private String name;

    /** 科目 */
    @Excel(name = "科目")
    private Long subjectId;

    /** 知识点 */
    @Excel(name = "知识点")
    private Long knownledgeId;

    /** 知识点 */
    @Excel(name = "知识点")
    private String knownledgeName;

    /** 试卷类型 */
    @Excel(name = "试卷类型")
    private String paperType;

    /** 试卷Id */
    @Excel(name = "试卷Id")
    private Long paperId;

    /** question_id */
    @Excel(name = "question_id")
    private Long questionId;

    /** 支持自动阅卷判断的答案（客观题可用） */
    @Excel(name = "支持自动阅卷判断的答案", readConverterExp = "客=观题可用")
    private String answer1;

    /** 非标准格式答案或含部分过程说明的答案 */
    @Excel(name = "非标准格式答案或含部分过程说明的答案")
    private String answer2;

    String answer;
    List<String> attachments;

    /** 最后来源 */
    @Excel(name = "最后来源")
    private String source;

    /** 错误次数 */
    @Excel(name = "错误次数")
    private Long wrongCount;

    /** 正确次数 */
    @Excel(name = "正确次数")
    private Long rightCount;

    /** 正确次数 */
    @Excel(name = "总次数")
    private Long totalCount;


    /** 总分 */
    @Excel(name = "总分")
    private Long scoreTotal;

    /** 得分 */
    @Excel(name = "得分")
    private Long score;

    /** 用时 */
    @Excel(name = "用时")
    private Long duration;

    /** 备注 */
    @Excel(name = "备注")
    private String comment;

    /** 最后状态 */
    @Excel(name = "最后状态")
    private Long state;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdTime;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedTime;

    @Excel(name = "参考答案")
    private String answers;

    private String subjectName;

    /** 试题题型 */
    @Excel(name = "试题题型")
    private String qtpye;
    String typeId;

    private String title;
    @JsonIgnore
    private String title0;
    private String paperName;
    private Long examineeId;
    private String parse;

    @Excel(name = "选项A")
    private String optionA;

    /** 选项B */
    @Excel(name = "选项B")
    private String optionB;

    /** 选项C */
    @Excel(name = "选项C")
    private String optionC;

    /** 选项D */
    @Excel(name = "选项D")
    private String optionD;

    /** 选项E */
    @Excel(name = "选项E")
    private String optionE;
    private String optionF;
    private String optionG;

    boolean collect;

    public String getQtpye() {
        return qtpye;
    }

    public void setQtpye(String qtpye) {
        this.qtpye = qtpye;
    }

    public Long getDuration() {
        return duration;
    }

    public void setDuration(Long duration) {
        this.duration = duration;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getAnswers() {
        return answers;
    }

    public void setAnswers(String answers) {
        this.answers = answers;
    }

    public Long getPaperId() {
        return paperId;
    }

    public void setPaperId(Long paperId) {
        this.paperId = paperId;
    }

    public String getAnswer1() {
        return answer1;
    }

    public void setAnswer1(String answer1) {
        this.answer1 = answer1;
    }

    public String getAnswer2() {
        return answer2;
    }

    public void setAnswer2(String answer2) {
        this.answer2 = answer2;
    }

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    public List<String> getAttachments() {
        return attachments;
    }

    public void setAttachments(List<String> attachments) {
        this.attachments = attachments;
    }

    public Long getScoreTotal() {
        return scoreTotal;
    }

    public void setScoreTotal(Long scoreTotal) {
        this.scoreTotal = scoreTotal;
    }

    public Long getScore() {
        return score;
    }

    public void setScore(Long score) {
        this.score = score;
    }

    public void setWrongId(Long wrongId)
    {
        this.wrongId = wrongId;
    }

    public Long getWrongId()
    {
        return wrongId;
    }
    public void setCustomerCode(String customerCode)
    {
        this.customerCode = customerCode;
    }

    public String getCustomerCode()
    {
        return customerCode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(Long subjectId) {
        this.subjectId = subjectId;
    }

    public Long getKnownledgeId() {
        return knownledgeId;
    }

    public void setKnownledgeId(Long knownledgeId) {
        this.knownledgeId = knownledgeId;
    }

    public String getKnownledgeName() {
        return knownledgeName;
    }

    public void setKnownledgeName(String knownledgeName) {
        this.knownledgeName = knownledgeName;
    }

    public String getPaperType() {
        return paperType;
    }

    public void setPaperType(String paperType) {
        this.paperType = paperType;
    }

    public void setQuestionId(Long questionId)
    {
        this.questionId = questionId;
    }

    public Long getQuestionId()
    {
        return questionId;
    }
    public void setSource(String source)
    {
        this.source = EnumWrongAnswersSource.getRemarkByName(source);

    }

    public String getSource()
    {
        return source;
    }
    public void setWrongCount(Long wrongCount)
    {
        this.wrongCount = wrongCount;
    }

    public Long getWrongCount()
    {
        return wrongCount;
    }
    public void setRightCount(Long rightCount)
    {
        this.rightCount = rightCount;
    }

    public Long getRightCount()
    {
        return rightCount;
    }

    public Long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Long totalCount) {
        this.totalCount = totalCount;
    }

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

    public Long getState()
    {
        return state;
    }
    public void setCreatedTime(Date createdTime)
    {
        this.createdTime = createdTime;
    }

    public Date getCreatedTime()
    {
        return createdTime;
    }
    public void setUpdatedTime(Date updatedTime)
    {
        this.updatedTime = updatedTime;
    }

    public Date getUpdatedTime()
    {
        return updatedTime;
    }

    public String getTitle() {
        return title+"<br />"+bindOptions();
    }

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    public String bindOptions() {
         String options = StringUtils.isNotBlank(optionA)?("A."+optionA+"<br />"):"";
        options+=StringUtils.isNotBlank(optionB)?"B."+optionB+"<br />":"";
        options+=StringUtils.isNotBlank(optionC)?"C."+optionC+"<br />":"";
        options+=StringUtils.isNotBlank(optionD)?"D."+optionD+"<br />":"";
        options+=StringUtils.isNotBlank(optionE)?"E."+optionE+"<br />":"";
        options+=StringUtils.isNotBlank(optionF)?"F."+optionF+"<br />":"";
        options+=StringUtils.isNotBlank(optionG)?"G."+optionG:"";
         return options;
    }

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

    public String getPaperName() {
        return paperName;
    }

    public void setPaperName(String paperName) {
        this.paperName = paperName;
    }

    public Long getExamineeId() {
        return examineeId;
    }

    public void setExamineeId(Long examineeId) {
        this.examineeId = examineeId;
    }

    public String getParse() {
        return parse;
    }

    public void setParse(String parse) {
        this.parse = parse;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("wrongId", getWrongId())
            .append("customerCode", getCustomerCode())
            .append("questionId", getQuestionId())
            .append("source", getSource())
            .append("wrongCount", getWrongCount())
            .append("rightCount", getRightCount())
            .append("state", getState())
            .append("createdTime", getCreatedTime())
            .append("updatedTime", getUpdatedTime())
            .toString();
    }

    public String getSubjectName() {
        return subjectName;
    }

    public void setSubjectName(String subjectName) {
        this.subjectName = subjectName;
    }

    public String getOptionA() {
        return optionA;
    }

    public void setOptionA(String optionA) {
        this.optionA = optionA;
    }

    public String getOptionB() {
        return optionB;
    }

    public void setOptionB(String optionB) {
        this.optionB = optionB;
    }

    public String getOptionC() {
        return optionC;
    }

    public void setOptionC(String optionC) {
        this.optionC = optionC;
    }

    public String getOptionD() {
        return optionD;
    }

    public void setOptionD(String optionD) {
        this.optionD = optionD;
    }

    public String getOptionE() {
        return optionE;
    }

    public void setOptionE(String optionE) {
        this.optionE = optionE;
    }

    public String getOptionF() {
        return optionF;
    }

    public void setOptionF(String optionF) {
        this.optionF = optionF;
    }

    public String getOptionG() {
        return optionG;
    }

    public void setOptionG(String optionG) {
        this.optionG = optionG;
    }

    public String getTitle0() {
        return title0;
    }

    public void setTitle0(String title0) {
        this.title0 = title0;
    }

    public boolean isCollect() {
        return collect;
    }

    public void setCollect(boolean collect) {
        this.collect = collect;
    }
}
