|
@@ -0,0 +1,77 @@
|
|
|
+package cn.com.qmth.export;
|
|
|
+
|
|
|
+public enum QuesStructType {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 单选
|
|
|
+ */
|
|
|
+ SINGLE_ANSWER_QUESTION(1, "单选", true, false),
|
|
|
+ /**
|
|
|
+ * 多选
|
|
|
+ */
|
|
|
+ MULTIPLE_ANSWER_QUESTION(2, "多选", true, false),
|
|
|
+ /**
|
|
|
+ * 判断
|
|
|
+ */
|
|
|
+ BOOL_ANSWER_QUESTION(3, "判断", true, false),
|
|
|
+ /**
|
|
|
+ * 填空
|
|
|
+ */
|
|
|
+ FILL_BLANK_QUESTION(4, "填空", false, false),
|
|
|
+ /**
|
|
|
+ * 问答
|
|
|
+ */
|
|
|
+ TEXT_ANSWER_QUESTION(5, "问答", false, false),
|
|
|
+ /**
|
|
|
+ * 套题
|
|
|
+ */
|
|
|
+ NESTED_ANSWER_QUESTION(6, "套题", false, true);
|
|
|
+
|
|
|
+ private Integer id;
|
|
|
+ private String name;
|
|
|
+ private boolean objective;//是否是客观题
|
|
|
+ private boolean combline;//是否是组合题
|
|
|
+
|
|
|
+ QuesStructType(Integer id, String name, boolean objective, boolean combline) {
|
|
|
+ this.id = id;
|
|
|
+ this.name = name;
|
|
|
+ this.objective = objective;
|
|
|
+ this.combline = combline;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过ID获取试题类型
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static QuesStructType getQuesStructTypeById(Integer id) {
|
|
|
+ for (QuesStructType type : QuesStructType.values()) {
|
|
|
+ if (id.equals(type.getId())) {
|
|
|
+ return type;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Integer getId() {
|
|
|
+ return id;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getName() {
|
|
|
+ return name;
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isObjective() {
|
|
|
+ return objective;
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isCombline() {
|
|
|
+ return combline;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String toString() {
|
|
|
+ return getName();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|