| | |
| | | TrueFalse(3, "判断题"), |
| | | GapFilling(4, "填空题"), |
| | | ShortAnswer(5, "简答题"), |
| | | Calculation(6,"计算题"); |
| | | int code; |
| | | Audio(6,"语音题"), |
| | | Calculate(7,"计算题"), |
| | | Analysis(8,"分析题"); |
| | | |
| | | Integer code; |
| | | String name; |
| | | |
| | | QuestionTypeEnum(int code, String name) { |
| | | QuestionTypeEnum(Integer code, String name) { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | public int getCode() { |
| | | public Integer getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | public static Integer get(String text){ |
| | | if("".equals(text) || text == null){ |
| | | return null; |
| | | } |
| | | QuestionTypeEnum[] enums = QuestionTypeEnum.values(); |
| | | for (QuestionTypeEnum anEnum : enums) { |
| | | if(anEnum.getName().equals(text)){ |
| | | return anEnum.getCode(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |