wangwei vor 6 Jahren
Ursprung
Commit
882173408f

+ 13 - 0
.gitignore

@@ -0,0 +1,13 @@
+.project
+.classpath
+.settings
+target/
+.idea/
+*.iml
+*test/
+# Package Files #
+*.jar
+logs/
+.springBeans
+
+

+ 106 - 0
src/main/java/cn/com/qmth/examcloud/question/core/DefaultQuestion.java

@@ -0,0 +1,106 @@
+package cn.com.qmth.examcloud.question.core;
+
+import java.util.List;
+
+/**
+ * 题<完整题>
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class DefaultQuestion implements Question {
+
+	private static final long serialVersionUID = 195811114083691548L;
+
+	/**
+	 * 题ID
+	 */
+	private String id;
+
+	/**
+	 * 题结构体
+	 */
+	private String body;
+
+	/**
+	 * 版本号
+	 */
+	private String version;
+
+	/**
+	 * 题型
+	 */
+	private QuestionType questionType;
+
+	/**
+	 * 主版本
+	 */
+	private QuestionStructure masterVersion;
+
+	/**
+	 * 分支版本
+	 */
+	private List<QuestionStructure> branchVersionList;
+
+	@Override
+	public String getId() {
+		return id;
+	}
+
+	@Override
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	@Override
+	public String getBody() {
+		return body;
+	}
+
+	@Override
+	public void setBody(String body) {
+		this.body = body;
+	}
+
+	@Override
+	public String getVersion() {
+		return version;
+	}
+
+	@Override
+	public void setVersion(String version) {
+		this.version = version;
+	}
+
+	@Override
+	public QuestionType getQuestionType() {
+		return questionType;
+	}
+
+	@Override
+	public void setQuestionType(QuestionType questionType) {
+		this.questionType = questionType;
+	}
+
+	@Override
+	public QuestionStructure getMasterVersion() {
+		return masterVersion;
+	}
+
+	@Override
+	public void setMasterVersion(QuestionStructure masterVersion) {
+		this.masterVersion = masterVersion;
+	}
+
+	@Override
+	public List<QuestionStructure> getBranchVersionList() {
+		return branchVersionList;
+	}
+
+	@Override
+	public void setBranchVersionList(List<QuestionStructure> branchVersionList) {
+		this.branchVersionList = branchVersionList;
+	}
+
+}

+ 29 - 0
src/main/java/cn/com/qmth/examcloud/question/core/DefaultQuestionOption.java

@@ -0,0 +1,29 @@
+package cn.com.qmth.examcloud.question.core;
+
+/**
+ * 选择题选项
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class DefaultQuestionOption implements QuestionOption {
+
+	private static final long serialVersionUID = 8258548156850194710L;
+
+	/**
+	 * 选项体
+	 */
+	private String body;
+
+	@Override
+	public String getBody() {
+		return body;
+	}
+
+	@Override
+	public void setBody(String body) {
+		this.body = body;
+	}
+
+}

+ 62 - 0
src/main/java/cn/com/qmth/examcloud/question/core/DefaultQuestionStructure.java

@@ -0,0 +1,62 @@
+package cn.com.qmth.examcloud.question.core;
+
+import java.util.List;
+
+/**
+ * 题结构<完整题机构>
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class DefaultQuestionStructure implements QuestionStructure {
+
+	private static final long serialVersionUID = 4744728219699873386L;
+
+	/**
+	 * 题结构体
+	 */
+	private String body;
+
+	/**
+	 * 版本号
+	 */
+	private String version;
+
+	/**
+	 * 体单元集合
+	 */
+	private List<QuestionUnit> questionUnitList;
+
+	@Override
+
+	public String getBody() {
+		return body;
+	}
+
+	@Override
+	public void setBody(String body) {
+		this.body = body;
+	}
+
+	@Override
+	public String getVersion() {
+		return version;
+	}
+
+	@Override
+	public void setVersion(String version) {
+		this.version = version;
+	}
+
+	@Override
+	public List<QuestionUnit> getQuestionUnitList() {
+		return questionUnitList;
+	}
+
+	@Override
+	public void setQuestionUnitList(List<QuestionUnit> questionUnitList) {
+		this.questionUnitList = questionUnitList;
+	}
+
+}

+ 61 - 0
src/main/java/cn/com/qmth/examcloud/question/core/DefaultQuestionUnit.java

@@ -0,0 +1,61 @@
+package cn.com.qmth.examcloud.question.core;
+
+import java.util.List;
+
+/**
+ * 题单元<最小作答单元>
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class DefaultQuestionUnit implements QuestionUnit {
+
+	private static final long serialVersionUID = 3092731472173574671L;
+
+	/**
+	 * 题干
+	 */
+	private String body;
+
+	/**
+	 * 选项集合
+	 */
+	private List<QuestionOption> questionOptionList;
+
+	/**
+	 * 正确答案
+	 */
+	private String[] rightAnswer;
+
+	@Override
+	public String getBody() {
+		return body;
+	}
+
+	@Override
+	public void setBody(String body) {
+		this.body = body;
+	}
+
+	@Override
+	public List<QuestionOption> getQuestionOptionList() {
+		return questionOptionList;
+	}
+
+	@Override
+	public void setQuestionOptionList(List<QuestionOption> questionOptionList) {
+		this.questionOptionList = questionOptionList;
+	}
+
+	@Override
+	public String[] getRightAnswer() {
+		return rightAnswer;
+	}
+
+	@Override
+	public void setRightAnswer(String[] rightAnswer) {
+		this.rightAnswer = rightAnswer;
+	}
+
+}

+ 39 - 0
src/main/java/cn/com/qmth/examcloud/question/core/Question.java

@@ -0,0 +1,39 @@
+package cn.com.qmth.examcloud.question.core;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 题<完整题>
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public interface Question extends Serializable {
+
+	public String getId();
+
+	public void setId(String id);
+
+	public String getBody();
+
+	public void setBody(String body);
+
+	public String getVersion();
+
+	public void setVersion(String version);
+
+	public QuestionType getQuestionType();
+
+	public void setQuestionType(QuestionType questionType);
+
+	public QuestionStructure getMasterVersion();
+
+	public void setMasterVersion(QuestionStructure masterVersion);
+
+	public List<QuestionStructure> getBranchVersionList();
+
+	public void setBranchVersionList(List<QuestionStructure> branchVersionList);
+
+}

+ 30 - 0
src/main/java/cn/com/qmth/examcloud/question/core/QuestionOption.java

@@ -0,0 +1,30 @@
+package cn.com.qmth.examcloud.question.core;
+
+import java.io.Serializable;
+
+/**
+ * 选择题选项接口
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public interface QuestionOption extends Serializable {
+
+	/**
+	 * 获取选项体
+	 *
+	 * @author WANGWEI
+	 * @return
+	 */
+	public String getBody();
+
+	/**
+	 * 设置选项体
+	 *
+	 * @author WANGWEI
+	 * @param body
+	 */
+	public void setBody(String body);
+
+}

+ 63 - 0
src/main/java/cn/com/qmth/examcloud/question/core/QuestionStructure.java

@@ -0,0 +1,63 @@
+package cn.com.qmth.examcloud.question.core;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 题结构<完整题机构>
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public interface QuestionStructure extends Serializable {
+
+	/**
+	 * 获取结构体
+	 *
+	 * @author WANGWEI
+	 * @return
+	 */
+	public String getBody();
+
+	/**
+	 * 设置结构体
+	 *
+	 * @author WANGWEI
+	 * @param body
+	 */
+	public void setBody(String body);
+
+	/**
+	 * 获取版本
+	 *
+	 * @author WANGWEI
+	 * @return
+	 */
+	public String getVersion();
+
+	/**
+	 * 设置版本
+	 *
+	 * @author WANGWEI
+	 * @param version
+	 */
+	public void setVersion(String version);
+
+	/**
+	 * 获取题单元集
+	 *
+	 * @author WANGWEI
+	 * @return
+	 */
+	public List<QuestionUnit> getQuestionUnitList();
+
+	/**
+	 * 设置题单元集
+	 *
+	 * @author WANGWEI
+	 * @param questionUnitList
+	 */
+	public void setQuestionUnitList(List<QuestionUnit> questionUnitList);
+
+}

+ 60 - 0
src/main/java/cn/com/qmth/examcloud/question/core/QuestionType.java

@@ -0,0 +1,60 @@
+package cn.com.qmth.examcloud.question.core;
+
+/**
+ * 题型
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+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;
+	}
+
+}

+ 63 - 0
src/main/java/cn/com/qmth/examcloud/question/core/QuestionUnit.java

@@ -0,0 +1,63 @@
+package cn.com.qmth.examcloud.question.core;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 题单元接口<最小作答单元>
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public interface QuestionUnit extends Serializable {
+
+	/**
+	 * 获取题干
+	 *
+	 * @author WANGWEI
+	 * @return
+	 */
+	public String getBody();
+
+	/**
+	 * 设置题干
+	 *
+	 * @author WANGWEI
+	 * @param body
+	 */
+	public void setBody(String body);
+
+	/**
+	 * 获取选项集
+	 *
+	 * @author WANGWEI
+	 * @return
+	 */
+	public List<QuestionOption> getQuestionOptionList();
+
+	/**
+	 * 设置选项集
+	 *
+	 * @author WANGWEI
+	 * @param questionOptionList
+	 */
+	public void setQuestionOptionList(List<QuestionOption> questionOptionList);
+
+	/**
+	 * 获取正确答案
+	 *
+	 * @author WANGWEI
+	 * @return
+	 */
+	public String[] getRightAnswer();
+
+	/**
+	 * 设置正确答案
+	 *
+	 * @author WANGWEI
+	 * @param rightAnswer
+	 */
+	public void setRightAnswer(String[] rightAnswer);
+
+}