Browse Source

merge from release_v4.1.3

deason 2 years ago
parent
commit
3c18fff4f1

+ 30 - 47
examcloud-question-commons/src/main/java/cn/com/qmth/examcloud/question/commons/core/question/QuestionType.java

@@ -9,52 +9,35 @@ package cn.com.qmth.examcloud.question.commons.core.question;
  */
 public enum QuestionType {
 
-	/**
-	 * 单选题
-	 */
-	SINGLE_CHOICE("单选题"),
-
-	/**
-	 * 多选题
-	 */
-	MULTIPLE_CHOICE("多选题"),
-
-	/**
-	 * 填空题
-	 */
-	FILL_UP("填空题"),
-
-	/**
-	 * 问答题
-	 */
-	ESSAY("问答题"),
-
-	/**
-	 * 判断题
-	 */
-	TRUE_OR_FALSE("判断题");
-
-	// ===========================================================================
-
-	/**
-	 * 描述
-	 */
-	private String desc;
-
-	/**
-	 * 构造函数
-	 *
-	 * @param desc
-	 */
-	private QuestionType(String desc) {
-		this.desc = desc;
-	}
-
-	/**
-	 * @return the desc
-	 */
-	public String getDesc() {
-		return desc;
-	}
+    SINGLE_CHOICE("单选题"),
+
+    MULTIPLE_CHOICE("多选题"),
+
+    FILL_UP("填空题"),
+
+    ESSAY("问答题"),
+
+    TRUE_OR_FALSE("判断题");
+
+    private String desc;
+
+    QuestionType(String desc) {
+        this.desc = desc;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    /**
+     * 是否为客观题
+     */
+    public static boolean isObjective(QuestionType type) {
+        if (type == null) {
+            return false;
+        }
+
+        return SINGLE_CHOICE == type || MULTIPLE_CHOICE == type || TRUE_OR_FALSE == type;
+    }
 
 }