deason 6 жил өмнө
parent
commit
3fab9aaba1

+ 10 - 0
examcloud-core-print-dao/src/main/java/cn/com/qmth/examcloud/core/print/entity/ExamQuestionStructure.java

@@ -7,6 +7,8 @@
 
 package cn.com.qmth.examcloud.core.print.entity;
 
+import cn.com.qmth.examcloud.core.print.enums.QuesStructType;
+
 import java.io.Serializable;
 
 /**
@@ -25,6 +27,14 @@ public class ExamQuestionStructure implements Serializable {
      */
     private Integer total;
 
+    public String getTypeName() {
+        QuesStructType type = QuesStructType.getByName(questionType);
+        if (type != null) {
+            return type.getTitle();
+        }
+        return null;
+    }
+
     public String getQuestionType() {
         return questionType;
     }

+ 58 - 0
examcloud-core-print-dao/src/main/java/cn/com/qmth/examcloud/core/print/enums/QuesStructType.java

@@ -0,0 +1,58 @@
+/*
+ * *************************************************
+ * Copyright (c) 2018 QMTH. All Rights Reserved.
+ * Created by Deason on 2018-10-30 11:39:43.
+ * *************************************************
+ */
+
+package cn.com.qmth.examcloud.core.print.enums;
+
+public enum QuesStructType {
+    SINGLE_ANSWER_QUESTION(1L, "单选", true, false),
+    MULTIPLE_ANSWER_QUESTION(2L, "多选", true, false),
+    BOOL_ANSWER_QUESTION(3L, "判断", true, false),
+    FILL_BLANK_QUESTION(4L, "填空", false, false),
+    TEXT_ANSWER_QUESTION(5L, "问答", false, false),
+    NESTED_ANSWER_QUESTION(6L, "套题", false, true);
+
+    private Long id;
+    private String title;
+    private boolean objective;//是否是客观题
+    private boolean combline;//是否是组合题
+
+    public static QuesStructType getByName(String name) {
+        if (name == null) {
+            return null;
+        }
+        for (QuesStructType type : QuesStructType.values()) {
+            if (type.name().equals(name)) {
+                return type;
+            }
+        }
+        return null;
+    }
+
+    QuesStructType(Long id, String title, boolean objective, boolean combline) {
+        this.id = id;
+        this.title = title;
+        this.objective = objective;
+        this.combline = combline;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public boolean isObjective() {
+        return objective;
+    }
+
+    public boolean isCombline() {
+        return combline;
+    }
+
+}