package com.qmth.teachcloud.report.business.bean.result;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.qmth.teachcloud.common.contant.SystemConstant;
import com.qmth.teachcloud.report.business.entity.TBPaperStruct;
import com.qmth.teachcloud.report.business.enums.PaperStructJudgeEnum;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Objects;

/**
 * @Description: 试卷结构result
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/6/10
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TBPaperStructResult extends TBPaperStruct implements Serializable {

    @ApiModelProperty(value = "试卷类型")
    private String paperType;

    @ApiModelProperty(value = "大题号")
    private String mainNumber;

    @ApiModelProperty(value = "小题号")
    private String subNumber;

    @ApiModelProperty(value = "得分率")
    private BigDecimal scoreRate;

    @ApiModelProperty(value = "难度")
    private String difficult;

    @ApiModelProperty(value = "效度")
    private BigDecimal validity;

    @ApiModelProperty(value = "试卷结构每道题目正确（全对），错误枚举")
    private PaperStructJudgeEnum paperStructJudge;

    public String getMainNumber() {
        return mainNumber;
    }

    public void setMainNumber(String mainNumber) {
        this.mainNumber = mainNumber;
    }

    public String getSubNumber() {
        return subNumber;
    }

    public void setSubNumber(String subNumber) {
        this.subNumber = subNumber;
    }

    public String getPaperType() {
        return paperType;
    }

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

    public BigDecimal getScoreRate() {
        if (Objects.nonNull(scoreRate)) {
            return scoreRate.setScale(SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP);
        } else {
            return scoreRate;
        }
    }

    public void setScoreRate(BigDecimal scoreRate) {
        this.scoreRate = scoreRate;
    }

    public String getDifficult() {
        return difficult;
    }

    public void setDifficult(String difficult) {
        this.difficult = difficult;
    }

    public BigDecimal getValidity() {
        if (Objects.nonNull(validity)) {
            return validity.setScale(SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP);
        } else {
            return validity;
        }
    }

    public void setValidity(BigDecimal validity) {
        this.validity = validity;
    }

    public PaperStructJudgeEnum getPaperStructJudge() {
        return paperStructJudge;
    }

    public void setPaperStructJudge(PaperStructJudgeEnum paperStructJudge) {
        this.paperStructJudge = paperStructJudge;
    }
}
