package com.qmth.qrzk.repository.user.model;

import java.util.Date;

/**
 * 试题选项实体类
 * @author 钟辉
 *
 */
public class QuestionOption {

	private Integer id;				//编号id
	private Integer questionId;		//试题编号id
	private Integer optionNo;		//选项顺序
	private Integer isCorrectOption;//是否为正确答案
	private String content;		//选项内容
	private byte[] contentWord;	//选项内容--word形式保存
	private String summary;		//选项摘要
	private Date createdTime;	//创建时间
	private Integer createdBy;		//创建人
	private Date updatedTime;	//更新时间
	private Integer updatedBy;		//更新人
	private String guid;
	
	public String getGuid() {
		return guid;
	}
	public void setGuid(String guid) {
		this.guid = guid;
	}
	
	public Integer getQuestionId() {
		return questionId;
	}
	public void setQuestionId(Integer questionId) {
		this.questionId = questionId;
	}
	public Integer getOptionNo() {
		return optionNo;
	}
	public void setOptionNo(Integer optionNo) {
		this.optionNo = optionNo;
	}
	public Integer getIsCorrectOption() {
		return isCorrectOption;
	}
	public void setIsCorrectOption(Integer isCorrectOption) {
		this.isCorrectOption = isCorrectOption;
	}
	public String getContent() {
		return content;
	}
	public void setContentHtml(String str) {
		//do nothing
	}
	public String getContentHtml() {
		return (content != null && !content.equals(""))?content:summary;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public byte[] getContentWord() {
		return contentWord;
	}
	public void setContentWord(byte[] contentWord) {
		this.contentWord = contentWord;
	}
	public String getSummary() {
		return summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
	public Date getCreatedTime() {
		return createdTime;
	}
	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}
	public Integer getCreatedBy() {
		return createdBy;
	}
	public void setCreatedBy(Integer createdBy) {
		this.createdBy = createdBy;
	}
	public Date getUpdatedTime() {
		return updatedTime;
	}
	public void setUpdatedTime(Date updatedTime) {
		this.updatedTime = updatedTime;
	}
	public Integer getUpdatedBy() {
		return updatedBy;
	}
	public void setUpdatedBy(Integer updatedBy) {
		this.updatedBy = updatedBy;
	}
	public Integer getId() {
		return id;
	}
	public QuestionOption(Integer questionId, Integer optionNo, Integer isCorrectOption,
			String content, byte[] contentWord,String summary,Date createdTime, Integer createdBy, Date updatedTime,
			Integer updatedBy) {
		super();
		this.questionId = questionId;
		this.optionNo = optionNo;
		this.isCorrectOption = isCorrectOption;
		this.content = content;
		this.contentWord=contentWord;
		this.summary=summary;
		this.createdTime = createdTime;
		this.createdBy = createdBy;
		this.updatedTime = updatedTime;
		this.updatedBy = updatedBy;
	}
	public QuestionOption(Integer questionId, Integer optionNo, Integer isCorrectOption,
			String content, String summary, Date createdTime, Integer createdBy,
			Date updatedTime, Integer updatedBy) {
		super();
		this.questionId = questionId;
		this.optionNo = optionNo;
		this.isCorrectOption = isCorrectOption;
		this.content = content;
		this.summary = summary;
		this.createdTime = createdTime;
		this.createdBy = createdBy;
		this.updatedTime = updatedTime;
		this.updatedBy = updatedBy;
		this.setContentWord(new byte[0]);
	}
	
	public QuestionOption(Integer id,Integer questionId, Integer optionNo, Integer isCorrectOption,
			String content, String summary, Date createdTime, Integer createdBy,
			Date updatedTime, Integer updatedBy) {
		super();
		this.id=id;
		this.questionId = questionId;
		this.optionNo = optionNo;
		this.isCorrectOption = isCorrectOption;
		this.content = content;
		this.summary = summary;
		this.createdTime = createdTime;
		this.createdBy = createdBy;
		this.updatedTime = updatedTime;
		this.updatedBy = updatedBy;
		this.setContentWord(new byte[0]);
	}
	
	public QuestionOption() {
		super();
		// TODO Auto-generated constructor stub
	}
	public void setOptionNoString(String str) {
		//do nothing
	}
	public String getOptionNoString() {
		char c = 'A';
		c += optionNo;
		return c + "";
	}
}
