package com.ynfy.buss.exam.question.enums;


/**
 * 题目类型
 *
 * @author bool
 * @date 2019-10-30 13:11
 */
public enum QuestionType {

    RADIO(1, "单选题"),
    MULTI(2, "多选题"),
    JUDGE(3, "判断题"),
    SIMPLE(4, "简答题"),
    BLANK(5, "填空题");

    private Integer code;

    private String value;

    QuestionType(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static QuestionType getByCode(Integer code) {
        for (QuestionType questionType : values()) {
            if (questionType.getCode().equals(code)) {
                return questionType;
            }
        }
        return null;
    }

}
