package com.qmth.teachcloud.common.enums.scan;

public enum ConditionType {

    FILL_SUSPECT("填涂识别嫌疑", false),
    // ABSENT_FILL("缺考已填涂"),
    // BREACH_FILL("违纪已填涂"),
    QUESTION_SINGLE_EXCEED("单选题多填涂", false),
//    QUESTION_SINGLE_BLANK("单选题空选题数大于", true),
//    QUESTION_MULTI_BLANK("多选题空选题数大于", true),

    QUESTION_BLANK("客观题空选", false),
//    SELECTIVE_EXCEED("选做题填涂超过", true),
//    SELECTIVE_BLANK("选做题空选题数大于", true),
//    PAPER_TYPE_EXCEED("卷型多填涂", false),
//    PAPER_TYPE_BLANK("卷型空选", false),
    ;

    private String name;

    private boolean needValue;

    ConditionType(String name, boolean needValue) {
        this.name = name;
        this.needValue = needValue;
    }

    public String getName() {
        return name;
    }

    public boolean isNeedValue() {
        return needValue;
    }

    public static ConditionType getByName(String name) {
        for (ConditionType r : ConditionType.values()) {
            if (r.getName().equals(name)) {
                return r;
            }
        }
        return null;
    }

    public static ConditionType findByCode(String code) {
        for (ConditionType r : ConditionType.values()) {
            if (r.toString().equalsIgnoreCase(code)) {
                return r;
            }
        }
        return null;
    }

}
