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

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

import cn.com.qmth.examcloud.core.questions.base.core.ExamCourseDto;
import cn.com.qmth.examcloud.api.commons.enums.CallType;
import cn.com.qmth.examcloud.core.questions.base.enums.ExtractPolicy;
import cn.com.qmth.examcloud.core.questions.dao.entity.base.MongoBaseEntity;

/**
 * 调卷规则
 *
 * @author chenken
 */
public class ExtractConfig extends MongoBaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = -2723715817328472562L;
	/**
	 * 考试ID
	 */
	private Long examId;
	/**
	 * 考试类型 网络考试 传统考试
	 */
	private String examType;
	/**
	 * 考试名称
	 */
	private String examName;
	/**
	 * 课程名称
	 */
	private String courseName;
	/**
	 * 课程代码
	 */
	private String courseCode;

	private Course course;
	/**
	 * 调卷类型 成套调用 重组调用
	 */
	private CallType callType;
	/**
	 * 是否生成 1:生成 0：没生成 生成预览卷
	 */
	private Short ifFinish;
	/**
	 * 已经生成的试卷ID Map 数据结构: { "A":"0001", "B":"0002" } A 类型下生成的paperId为 0001 B
	 * 类型下生成的paperId为 0002
	 */
	private Map<String, String> finishedPaperIdMap;
	/**
	 * 抽取试卷对象集合
	 */
	private List<ExamPaper> examPaperList;
	/**
	 * 小题乱序 1:乱序 0：不乱序
	 */
	private Short scrambling_the_question_order;
	/**
	 * 选项乱序 1:乱序 0：不乱序
	 */
	private Short scrambling_the_option_order;

	/**
	 * 抽卷规则
	 */
	private ExtractPolicy policy;
	/**
	 * 类型参数
	 */
	private Map<String, Object> params;
	/**
	 * 机构ID
	 */
	private String orgId;

	private String orgName;

	// 随机抽题试卷模板
	private String randomPaperId;

	// 随机抽题音频播放次数
	private Integer playTime;

	public ExtractConfig() {

	}

	public ExtractConfig(String id) {
		this.id = id;
	}

	public ExtractConfig(Long exam_id, String course_code) {
		this.examId = exam_id;
		this.courseCode = course_code;
	}

	public ExtractConfig(ExamCourseDto examCourseDto) {
		this.examId = examCourseDto.getExamId();
		this.examName = examCourseDto.getExamName();
		this.courseCode = examCourseDto.getCourseCode();
		this.courseName = examCourseDto.getCourseName();
		this.examType = examCourseDto.getExamType().name();
	}

	public Long getExamId() {
		return examId;
	}

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

	public String getCourseCode() {
		return courseCode;
	}

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

	public ExtractPolicy getPolicy() {
		return policy;
	}

	public void setPolicy(ExtractPolicy policy) {
		this.policy = policy;
	}

	public String getExamType() {
		return examType;
	}

	public void setExamType(String examType) {
		this.examType = examType;
	}

	public String getExamName() {
		return examName;
	}

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

	public String getCourseName() {
		return courseName;
	}

	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}

	public CallType getCallType() {
		return callType;
	}

	public void setCallType(CallType callType) {
		this.callType = callType;
	}

	public Short getIfFinish() {
		return ifFinish;
	}

	public void setIfFinish(Short ifFinish) {
		if (ifFinish == null) {
			this.ifFinish = 0;
		} else {
			this.ifFinish = ifFinish;
		}
	}

	public Map<String, Object> getParams() {
		return params;
	}

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

	public String getOrgId() {
		return orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

	public List<ExamPaper> getExamPaperList() {
		return examPaperList;
	}

	public void setExamPaperList(List<ExamPaper> examPaperList) {
		this.examPaperList = examPaperList;
	}

	public Short getScrambling_the_question_order() {
		return scrambling_the_question_order;
	}

	public void setScrambling_the_question_order(Short scrambling_the_question_order) {
		if (scrambling_the_question_order == null) {
			this.scrambling_the_question_order = 0;
		} else {
			this.scrambling_the_question_order = scrambling_the_question_order;
		}
	}

	public Short getScrambling_the_option_order() {
		return scrambling_the_option_order;
	}

	public void setScrambling_the_option_order(Short scrambling_the_option_order) {
		if (scrambling_the_option_order == null) {
			this.scrambling_the_option_order = 0;
		} else {
			this.scrambling_the_option_order = scrambling_the_option_order;
		}
	}

	public Map<String, String> getFinishedPaperIdMap() {
		return finishedPaperIdMap;
	}

	public void setFinishedPaperIdMap(Map<String, String> finishedPaperIdMap) {
		this.finishedPaperIdMap = finishedPaperIdMap;
	}

	public String getOrgName() {
		return orgName;
	}

	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}

	public Course getCourse() {
		return course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	public String getRandomPaperId() {
		return randomPaperId;
	}

	public void setRandomPaperId(String randomPaperId) {
		this.randomPaperId = randomPaperId;
	}

	public Integer getPlayTime() {
		return playTime;
	}

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

}
