package com.qxgmat.data.constants.enums;

/**
 * Created by gaojie on 2017/11/19.
 */
public enum QuestionGroup {
    VERBAL("verbal", "语文"),
    QUANT("quant", "数学"),
    IR("ir", "综合推理"),
    AWA("awa", "作文");

    final static public String message = "考试结构：学科";

    public String key;
    public String title;
    private QuestionGroup(String key, String title){
        this.key = key;
        this.title = title;
    }

    public static QuestionGroup ValueOf(String name){
        if (name == null) return null;
        return QuestionGroup.valueOf(name.toUpperCase());
    }

    /**
     * 通过题型获取到学科
     * @param type
     * @return
     */
    public static QuestionGroup FromType(QuestionType type){
        switch(type){
            case SC:
            case RC:
            case CR:
                return VERBAL;
            case PS:
            case DS:
                return QUANT;
            case IR:
                return IR;
            case AWA:
                return AWA;
            default:
                return null;
        }
    }
}
