package cn.com.qmth.stmms.admin.dto;

import java.text.DecimalFormat;

import cn.com.qmth.stmms.biz.exam.model.ExamQuestion;
import cn.com.qmth.stmms.biz.exam.model.ExamSubject;
import cn.com.qmth.stmms.common.annotation.ExcelField;

public class ExceptionQuestionDTO {

    @ExcelField(title = "课程代码", align = 2, sort = 10)
    private String subjectCode;

    @ExcelField(title = "课程名称", align = 2, sort = 20)
    private String subjectName;

    @ExcelField(title = "大题名称", align = 2, sort = 30)
    private String mainTitle;

    @ExcelField(title = "大题号", align = 2, sort = 40)
    private Integer mainNumber;

    @ExcelField(title = "小题号", align = 2, sort = 50)
    private Integer subNumber;

    @ExcelField(title = "零分比例", align = 2, sort = 60)
    private String zeroRate;

    public ExceptionQuestionDTO(ExamQuestion question, ExamSubject subject) {
        setSubjectCode(question.getSubjectCode());
        setSubjectName(subject.getName());
        setMainTitle(question.getMainTitle());
        setMainNumber(question.getMainNumber());
        setSubNumber(question.getSubNumber());
        setZeroRate(new DecimalFormat("##%").format(question.getZeroCount() * 1.0 / question.getTotalCount()));
    }

    public String getSubjectCode() {
        return subjectCode;
    }

    public void setSubjectCode(String subjectCode) {
        this.subjectCode = subjectCode;
    }

    public String getSubjectName() {
        return subjectName;
    }

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

    public String getMainTitle() {
        return mainTitle;
    }

    public void setMainTitle(String mainTitle) {
        this.mainTitle = mainTitle;
    }

    public Integer getMainNumber() {
        return mainNumber;
    }

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

    public Integer getSubNumber() {
        return subNumber;
    }

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

    public String getZeroRate() {
        return zeroRate;
    }

    public void setZeroRate(String zeroRate) {
        this.zeroRate = zeroRate;
    }
}
