package cn.com.qmth.examcloud.core.questions.dao.entity;

import java.util.Date;

import org.springframework.data.mongodb.core.mapping.DBRef;

import cn.com.qmth.examcloud.core.questions.dao.entity.base.MongoBaseEntity;


/**
 * @author chenken
 * @date 017年8月10日 下午:5:53
 * @company QMTH
 * @description 音频播放次数设置
 */
public class AudioTimeConfig extends MongoBaseEntity {
    /**
	 * 
	 */
	private static final long serialVersionUID = 7379774910493107448L;
	/**
     * 考试ID
     */
    private String examId;
    /**
     * 考试名称
     */
    private String examName;

    /**
     * 课程ID
     */
    private String courseCode;
    /**
     * 关联试卷
     */
    @DBRef
    private Paper paper;
    /**
     * 试卷类型 ：调卷规则中的groupCode
     */
    private String groupCode;
    /**
     * 关联题目
     */
    @DBRef
    private PaperDetailUnit paperDetailUnit;

    private String questionId;

    /**
     * 播放次数
     */
    private Integer playTime;

    private Date createDate;

    private String createUser;

    public AudioTimeConfig() {

    }

    public AudioTimeConfig(String examId, String courseCode, String groupCode, String questionId) {
        super();
        this.examId = examId;
        this.courseCode = courseCode;
        this.groupCode = groupCode;
        this.questionId = questionId;
    }

    public AudioTimeConfig(String examId, String examName, String groupCode, String courseCode, PaperDetailUnit paperDetailUnit) {
        this.examId = examId;
        this.examName = examName;
        this.courseCode = courseCode;
        this.groupCode = groupCode;
        this.paperDetailUnit = paperDetailUnit;
        if (this.paperDetailUnit != null) {
            this.questionId = this.paperDetailUnit.getQuestion().getId();
            this.paper = this.paperDetailUnit.getPaper();
        }
    }

    public String getExamId() {
        return examId;
    }

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

    public String getExamName() {
        return examName;
    }

    public void setExamName(String examName) {
        this.examName = examName;
    }

    public Paper getPaper() {
        return paper;
    }

    public void setPaper(Paper paper) {
        this.paper = paper;
    }

    public PaperDetailUnit getPaperDetailUnit() {
        return paperDetailUnit;
    }

    public void setPaperDetailUnit(PaperDetailUnit paperDetailUnit) {
        this.paperDetailUnit = paperDetailUnit;
        if (paperDetailUnit != null && paperDetailUnit.getQuestion() != null) {
            this.setQuestionId(paperDetailUnit.getQuestion().getId());
        }
    }

    public Integer getPlayTime() {
        return playTime;
    }

    public void setPlayTime(Integer playTime) {
        this.playTime = playTime;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getGroupCode() {
        return groupCode;
    }

    public void setGroupCode(String groupCode) {
        this.groupCode = groupCode;
    }

    public String getCourseCode() {
        return courseCode;
    }

    public void setCourseCode(String courseCode) {
        this.courseCode = courseCode;
    }

    public String getQuestionId() {
        return questionId;
    }

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

}

