Bläddra i källkod

导入添加属性校验

weiwenhai 7 år sedan
förälder
incheckning
f319e51f14

+ 168 - 153
cqb-paper/src/main/java/com/qmth/cqb/paper/model/ImportPaperMsg.java

@@ -1,153 +1,168 @@
-package com.qmth.cqb.paper.model;
-/**
- * @author  	chenken
- * @date    	2017年6月8日 下午2:46:09
- * @company 	QMTH
- * @description ImportPaperMsg.java
- */
-public class ImportPaperMsg {
-	/**
-	 * [试题分类]
-	 */
-	public static final String questionClassify_word = "[试题分类]";
-	/**
-	 * [题型]
-	 */
-	public static final String questionType_word = "[题型]";
-	/**
-	 * [小题型]
-	 */
-    public static final String subQuestionType_word = "[小题型]";
-    /**
-	 * [试题编号]
-	 */
-    public static final String questionNo_word = "[试题编号]";
-    /**
-	 * [命题人]
-	 */
-    public static final String question_creator = "[命题人]";
-    /**
-	 * [题干]
-	 */
-    public static final String questionBody_word = "[题干]";
-    /**
-	 * [选项]
-	 */
-    public static final String option_word = "[选项]";
-    /**
-	 * [答案]
-	 */
-    public static final String answer_word = "[答案]";
-    /**
-	 * [属性]
-	 */
-    public static final String attribute_word = "[属性]";
-    /**
-	 * [适用年级]
-	 */
-    public static final String grade_word = "[适用年级]";
-    /**
-	 * [测评项目]
-	 */
-    public static final String course_word = "[测评项目]";
-    /**
-     * [分数]
-     */
-    public static final String score_word = "[分数]";
-    /**
-	 * [小题分数]
-	 */
-    public static final String subQuesScore_word = "[小题分数]";
-    /**
-	 * [解析]
-	 */
-    public static final String analyze_word = "[解析]";
-    /**
-     *[题目数量]
-     */
-    public static final String questionNum_word = "[题目数量]";
-    /**
-	 *[题组数量]
-	 */
-    public static final String subQuestionNum_word = "[题组数量]";
-    /**
-	 * 套题
-	 */
-    public static final String nestedQuestion_word = "套题";
-    /**
-	 * [大题名称]
-	 */
-    public static final String questionName_word = "[大题名称]";
-    /**
-     * 单选
-     */
-    public static final String singleSelection = "单选";
-    /**
-     * 多选
-     */
-    public static final String multipleSelection = "多选";
-    /**
-     * [
-     */
-    public static final String left_bracket = "[";
-    /**
-     * ]
-     */
-    public static final String right_bracket = "]";
-    /**
-     * 题干为空或格式不正确
-     */
-    public static final String errMsg_01 = "题干为空或格式不正确";
-    /**
-     * 小题型为空或格式不正确\n
-     */
-    public static final String errMsg_02 = "小题型为空或格式不正确\n";
-    /**
-     * 题干为空或格式不正确,必须以数字.开头\n
-     */
-    public static final String errMsg_03 = "题干为空或格式不正确,必须以数字.开头\n";
-    /**
-     * 试题分类为空或格式不正确\n
-     */
-    public static final String errMsg_04 = "试题分类为空或格式不正确\n";
-    /**
-     * 题型为空或格式不正确\n
-     */
-    public static final String errMsg_05 = "题型为空或格式不正确\n";
-    /**
-     * 大题名称为空或格式不正确\n
-     */
-    public static final String errMsg_06 = "大题名称为空或格式不正确\n";
-    /**
-     * 题目数量为空或格式不正确\n
-     */
-    public static final String errMsg_07 = "题目数量为空或格式不正确\n";
-    /**
-     * 分数为空或格式不正确\n
-     */
-    public static final String errMsg_08 = "分数为空或格式不正确\n";
-    /**
-     * 题型必须是单选、多选、判断、填空、问答、套题中的一种\n
-     */
-    public static final String errMsg_09 = "题型必须是单选、多选、判断、填空、问答、套题中的一种\n";
-    /**
-     * 题干不能包含有序列
-     */
-    public static final String errMsg_10 = "题干不能包含有自动编号";
-    /**
-     * 选项不能包含有序列
-     */
-    public static final String errMsg_11 = "选项不能包含有自动编号";
-    /**
-     * 一般校验
-     */
-    public static final String errMsg_12 = "格式错误,请仔细检查(题干必须有题号、选项必须有选项号、答案必须存在且格式正确)";
-
-    /**
-     * 选项排列顺序
-     */
-    public static final String errMsg_13 = "选项序号有误,必须从A开始且按字母顺序排列(ABCDEF)";
-    
-    
-}
-
+package com.qmth.cqb.paper.model;
+/**
+ * @author  	chenken
+ * @date    	2017年6月8日 下午2:46:09
+ * @company 	QMTH
+ * @description ImportPaperMsg.java
+ */
+public class ImportPaperMsg {
+	/**
+	 * [试题分类]
+	 */
+	public static final String questionClassify_word = "[试题分类]";
+	/**
+	 * [题型]
+	 */
+	public static final String questionType_word = "[题型]";
+	/**
+	 * [小题型]
+	 */
+    public static final String subQuestionType_word = "[小题型]";
+    /**
+	 * [试题编号]
+	 */
+    public static final String questionNo_word = "[试题编号]";
+    /**
+	 * [命题人]
+	 */
+    public static final String question_creator = "[命题人]";
+    /**
+	 * [题干]
+	 */
+    public static final String questionBody_word = "[题干]";
+    /**
+	 * [选项]
+	 */
+    public static final String option_word = "[选项]";
+    /**
+	 * [答案]
+	 */
+    public static final String answer_word = "[答案]";
+    /**
+	 * [属性]
+	 */
+    public static final String attribute_word = "[属性]";
+    /**
+	 * [适用年级]
+	 */
+    public static final String grade_word = "[适用年级]";
+    /**
+	 * [测评项目]
+	 */
+    public static final String course_word = "[测评项目]";
+    /**
+     * [分数]
+     */
+    public static final String score_word = "[分数]";
+    /**
+	 * [小题分数]
+	 */
+    public static final String subQuesScore_word = "[小题分数]";
+    /**
+	 * [解析]
+	 */
+    public static final String analyze_word = "[解析]";
+    /**
+     *[题目数量]
+     */
+    public static final String questionNum_word = "[题目数量]";
+    /**
+	 *[题组数量]
+	 */
+    public static final String subQuestionNum_word = "[题组数量]";
+    /**
+	 * 套题
+	 */
+    public static final String nestedQuestion_word = "套题";
+    /**
+	 * [大题名称]
+	 */
+    public static final String questionName_word = "[大题名称]";
+    /**
+     * 单选
+     */
+    public static final String singleSelection = "单选";
+    /**
+     * 多选
+     */
+    public static final String multipleSelection = "多选";
+    /**
+     * [
+     */
+    public static final String left_bracket = "[";
+    /**
+     * ]
+     */
+    public static final String right_bracket = "]";
+    /**
+     * 题干为空或格式不正确
+     */
+    public static final String errMsg_01 = "题干为空或格式不正确";
+    /**
+     * 小题型为空或格式不正确\n
+     */
+    public static final String errMsg_02 = "小题型为空或格式不正确\n";
+    /**
+     * 题干为空或格式不正确,必须以数字.开头\n
+     */
+    public static final String errMsg_03 = "题干为空或格式不正确,必须以数字.开头\n";
+    /**
+     * 试题分类为空或格式不正确\n
+     */
+    public static final String errMsg_04 = "试题分类为空或格式不正确\n";
+    /**
+     * 题型为空或格式不正确\n
+     */
+    public static final String errMsg_05 = "题型为空或格式不正确\n";
+    /**
+     * 大题名称为空或格式不正确\n
+     */
+    public static final String errMsg_06 = "大题名称为空或格式不正确\n";
+    /**
+     * 题目数量为空或格式不正确\n
+     */
+    public static final String errMsg_07 = "题目数量为空或格式不正确\n";
+    /**
+     * 分数为空或格式不正确\n
+     */
+    public static final String errMsg_08 = "分数为空或格式不正确\n";
+    /**
+     * 题型必须是单选、多选、判断、填空、问答、套题中的一种\n
+     */
+    public static final String errMsg_09 = "题型必须是单选、多选、判断、填空、问答、套题中的一种\n";
+    /**
+     * 题干不能包含有序列
+     */
+    public static final String errMsg_10 = "题干不能包含有自动编号";
+    /**
+     * 选项不能包含有序列
+     */
+    public static final String errMsg_11 = "选项不能包含有自动编号";
+    /**
+     * 一般校验
+     */
+    public static final String errMsg_12 = "格式错误,请仔细检查(题干必须有题号、选项必须有选项号、答案必须存在且格式正确)";
+
+    /**
+     * 选项排列顺序
+     */
+    public static final String errMsg_13 = "选项序号有误,必须从A开始且按字母顺序排列(ABCDEF)";
+    
+    /**
+     * [一级属性]
+     */
+    public static final String first_property = "[一级属性]";
+    /**
+     * [二级属性]
+     */
+    public static final String second_property = "[二级属性]";
+    /**
+     * [难度]
+     */
+    public static final String difficulty = "[难度]";
+    /**
+     * [公开度]
+     */
+    public static final String publicity = "[公开度]";
+}
+

+ 123 - 117
cqb-paper/src/main/java/com/qmth/cqb/paper/model/Property.java

@@ -1,117 +1,123 @@
-package com.qmth.cqb.paper.model;
-
-import java.io.Serializable;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
-
-import com.qmth.cqb.paper.dto.PropertyDto;
-/**
- * @describle  属性 
- * @author weiwenhai
- * @date   2017.11.6
- */
-@Entity
-@Table(name = "ecs_ques_property")
-public class Property implements Serializable{
-
-	private static final long serialVersionUID = -417218505125002677L;
-	
-	@Id
-	@GeneratedValue
-	private Long id;
-	
-	@NotNull
-	private String name;
-	
-	@NotNull
-	private Long parentId;
-	
-	@NotNull
-	private Integer number;//序号
-	
-	@NotNull
-	private Long coursePropertyId;
-	
-	private String remark;
-	
-	@NotNull
-	private Long orgId;
-	
-	public Property(){
-		
-	}
-	
-	public Property(PropertyDto propertyDto){
-		this.id = propertyDto.getId();
-		this.name = propertyDto.getName();
-		this.parentId = propertyDto.getParentId();
-		this.number = propertyDto.getNumber();
-		this.coursePropertyId = propertyDto.getCoursePropertyId();
-		this.remark = propertyDto.getRemark();
-	}
-
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public Long getParentId() {
-		return parentId;
-	}
-
-	public void setParentId(Long parentId) {
-		this.parentId = parentId;
-	}
-
-	public Integer getNumber() {
-		return number;
-	}
-
-	public void setNumber(Integer number) {
-		this.number = number;
-	}
-
-	public Long getCoursePropertyId() {
-		return coursePropertyId;
-	}
-
-	public void setCoursePropertyId(Long coursePropertyId) {
-		this.coursePropertyId = coursePropertyId;
-	}
-
-	public String getRemark() {
-		return remark;
-	}
-
-	public void setRemark(String remark) {
-		this.remark = remark;
-	}
-
-	public Long getOrgId() {
-		return orgId;
-	}
-
-	public void setOrgId(Long orgId) {
-		this.orgId = orgId;
-	}
-
-	public static long getSerialversionuid() {
-		return serialVersionUID;
-	}
-	
-}
+package com.qmth.cqb.paper.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+
+import com.qmth.cqb.paper.dto.PropertyDto;
+/**
+ * @describle  属性 
+ * @author weiwenhai
+ * @date   2017.11.6
+ */
+@Entity
+@Table(name = "ecs_ques_property")
+public class Property implements Serializable{
+
+	private static final long serialVersionUID = -417218505125002677L;
+	
+	@Id
+	@GeneratedValue
+	private Long id;
+	
+	@NotNull
+	private String name;
+	
+	@NotNull
+	private Long parentId;
+	
+	@NotNull
+	private Integer number;//序号
+	
+	@NotNull
+	private Long coursePropertyId;
+	
+	private String remark;
+	
+	@NotNull
+	private Long orgId;
+	
+	public Property(){
+		
+	}
+	
+	public Property(PropertyDto propertyDto){
+		this.id = propertyDto.getId();
+		this.name = propertyDto.getName();
+		this.parentId = propertyDto.getParentId();
+		this.number = propertyDto.getNumber();
+		this.coursePropertyId = propertyDto.getCoursePropertyId();
+		this.remark = propertyDto.getRemark();
+	}
+	
+	public Property(String name,Long parentId,Long coursePropertyId){
+		this.name = name;
+		this.parentId = parentId;
+		this.coursePropertyId = coursePropertyId;
+	}
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Long getParentId() {
+		return parentId;
+	}
+
+	public void setParentId(Long parentId) {
+		this.parentId = parentId;
+	}
+
+	public Integer getNumber() {
+		return number;
+	}
+
+	public void setNumber(Integer number) {
+		this.number = number;
+	}
+
+	public Long getCoursePropertyId() {
+		return coursePropertyId;
+	}
+
+	public void setCoursePropertyId(Long coursePropertyId) {
+		this.coursePropertyId = coursePropertyId;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public Long getOrgId() {
+		return orgId;
+	}
+
+	public void setOrgId(Long orgId) {
+		this.orgId = orgId;
+	}
+
+	public static long getSerialversionuid() {
+		return serialVersionUID;
+	}
+	
+}

+ 229 - 20
cqb-paper/src/main/java/com/qmth/cqb/paper/service/ImportPaperService.java

@@ -11,6 +11,8 @@ import java.util.Map;
 import java.util.UUID;
 import java.util.regex.Pattern;
 
+import com.netflix.infix.lang.infix.antlr.EventFilterParser.boolean_expr_return;
+import com.netflix.infix.lang.infix.antlr.EventFilterParser.null_predicate_return;
 import com.qmth.cqb.base.dao.CourseRepo;
 import com.qmth.cqb.base.model.Course;
 import com.qmth.cqb.question.dao.QuesPkgPathRepo;
@@ -26,20 +28,26 @@ import org.docx4j.wml.P;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Example;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.commons.CommonsMultipartFile;
 
 import com.google.gson.Gson;
+import com.qmth.cqb.paper.dao.CoursePropertyRepo;
 import com.qmth.cqb.paper.dao.PaperDetailRepo;
 import com.qmth.cqb.paper.dao.PaperDetailUnitRepo;
 import com.qmth.cqb.paper.dao.PaperRepo;
+import com.qmth.cqb.paper.dao.PropertyRepo;
+import com.qmth.cqb.paper.model.CourseProperty;
 import com.qmth.cqb.paper.model.ImportPaperCheck;
 import com.qmth.cqb.paper.model.ImportPaperMsg;
 import com.qmth.cqb.paper.model.Paper;
 import com.qmth.cqb.paper.model.PaperDetail;
 import com.qmth.cqb.paper.model.PaperDetailUnit;
+import com.qmth.cqb.paper.model.Property;
 import com.qmth.cqb.question.dao.QuesRepo;
 import com.qmth.cqb.question.model.QuesOption;
+import com.qmth.cqb.question.model.QuesProperty;
 import com.qmth.cqb.question.model.Question;
 import com.qmth.cqb.question.model.QuestionType;
 import com.qmth.cqb.question.service.QuesService;
@@ -91,6 +99,12 @@ public class ImportPaperService {
     @Autowired
     QuesPkgPathRepo quesPkgPathRepo;
     
+    @Autowired
+    CoursePropertyRepo coursePropertyRepo;
+    
+    @Autowired
+    PropertyRepo propertyRepo;
+    
     /**
      * 获取上传文件
      *
@@ -264,16 +278,16 @@ public class ImportPaperService {
                             tmpWordMlPackage);
                     // 处理尾信息
                     processQuesTail(pList, importPaperCheck.index, subQuesNum, question, paperDetailUnit,
-                            importPaperCheck, tmpWordMlPackage, false);
+                            importPaperCheck, tmpWordMlPackage, false,paper);
                     // 处理选择题的option--chenken 20170425
                     processSelectOption(question);
                 } else if (importPaperCheck.quesType.equals(ImportPaperMsg.nestedQuestion_word)) {
                     // 处理套题
-                    processNestedQues(pList, importPaperCheck.index,question, paperDetailUnit, importPaperCheck,tmpWordMlPackage);
+                    processNestedQues(pList, importPaperCheck.index,question, paperDetailUnit, importPaperCheck,tmpWordMlPackage,paper);
                 } else {
                     // 处理其他题型
                     processQuesBody(pList, importPaperCheck.index, subQuesNum,question, importPaperCheck, tmpWordMlPackage);
-                    processQuesTail(pList, importPaperCheck.index, subQuesNum, question, paperDetailUnit,importPaperCheck, tmpWordMlPackage, false);
+                    processQuesTail(pList, importPaperCheck.index, subQuesNum, question, paperDetailUnit,importPaperCheck, tmpWordMlPackage, false,paper);
                 }
                 // 设置WordMlPackage二进制数据
                 byte[] pkgByte = getZipResource(wordMLPackage,question);
@@ -652,11 +666,21 @@ public class ImportPaperService {
      */
     public void processQuesTail(List<Object> pList, int index, int subQuesNum, Question question,
             PaperDetailUnit paperDetailUnit, ImportPaperCheck importPaperCheck, WordprocessingMLPackage wordMLPackage,
-            boolean isNested) throws Exception {
+            boolean isNested,Paper paper) throws Exception {
 
         StringBuilder answerWordML = new StringBuilder("");
         StringBuilder answerHTML = new StringBuilder("");
-        String quesScore = "";
+        String quesScore = null;
+        //定义一级属性
+        String firstProperty = null;
+        //定义二级级属性
+        String secondProperty = null;
+        //定义难度
+        Double difficulty = null;
+        //定义公开度
+        Boolean publicity = null;
+        //定义试题属性集合
+        List<QuesProperty> quesProperties = new ArrayList<QuesProperty>();
         // Map<String, String> quesParams = new HashMap<String, String>();
         int i = 0;
         // 是否刚刚检测到答案内容
@@ -693,7 +717,40 @@ public class ImportPaperService {
                 // 检测到分数开始段落
                 quesScore = getContent(tmpText, ImportPaperMsg.subQuesScore_word);
                 answerStart = false;
-            } else if (isHeader(tmpText) || tmpText.matches("^\\d{1,}\\.[\\s\\S]*")) {
+            }
+            //-------------------------------------------------------------------------------------------------------
+            else if (tmpText.startsWith(ImportPaperMsg.first_property)) {
+                // 检测到一级属性开始段落
+            	firstProperty = getContent(tmpText, ImportPaperMsg.first_property);
+            	if(StringUtils.isBlank(firstProperty)){
+            		firstProperty = "";
+            	}
+                answerStart = false;
+            }
+            else if (tmpText.startsWith(ImportPaperMsg.second_property)) {
+            	// 检测到二级属性开始段落
+            	secondProperty = getContent(tmpText, ImportPaperMsg.second_property);
+            	if(StringUtils.isBlank(secondProperty)){
+            		secondProperty = "";
+            	}
+            	answerStart = false;
+			}
+            else if (tmpText.startsWith(ImportPaperMsg.difficulty)) {
+            	// 检测到难度开始段落
+            	String dif = getContent(tmpText, ImportPaperMsg.difficulty);
+            	checkDiffculty(difficulty,dif,importPaperCheck,subQuesNum);
+            	question.setDifficulty(difficulty);
+            	answerStart = false;
+			}
+            else if (tmpText.startsWith(ImportPaperMsg.publicity)) {
+            	// 检测到公安度开始段落
+            	String pub = getContent(tmpText, ImportPaperMsg.publicity);
+            	checkPublicity(publicity,pub,importPaperCheck,subQuesNum);
+            	question.setPublicity(publicity);
+            	answerStart = false;
+			}
+            //*******************************************************************************************************
+            else if (isHeader(tmpText) || tmpText.matches("^\\d{1,}\\.[\\s\\S]*")) {
                 // 检测到其他特殊段落或下一题直接退出
                 break;
             } else if (answerStart) {
@@ -719,9 +776,113 @@ public class ImportPaperService {
         if (!isNested && quesScore.matches("^\\d+(\\.\\d+)?$")) {
             paperDetailUnit.setScore(Double.parseDouble(quesScore));
         }
+        //校验小题尾信息是否含有"一节属性","二级属性","难度","公开"
+        checkAttributeIsFull(firstProperty,secondProperty,difficulty,publicity,importPaperCheck,subQuesNum);
+        //试题一级属性与二级属性校验
+        checkProperty(firstProperty,secondProperty,importPaperCheck,subQuesNum,paper,quesProperties);
+        question.setQuesProperties(quesProperties);
     }
 
-    /**
+    private void checkProperty(String firstProperty, String secondProperty,
+    		ImportPaperCheck importPaperCheck, int subQuesNum,Paper paper, List<QuesProperty> quesProperties) throws Exception{
+		//一级属性为空,二级属性有值
+		if(StringUtils.isBlank(firstProperty) && StringUtils.isNotBlank(secondProperty)){
+			importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题一级属性值为空,请检查");
+    		throw new PaperException(importPaperCheck.errorInfo);
+		}
+		//一级属性,二级属性都有值
+		else if(StringUtils.isNotBlank(firstProperty) && StringUtils.isNotBlank(secondProperty)){
+			//根据课程查询所有课程属性树
+			List<CourseProperty> courseProperties = coursePropertyRepo.findByCourseId(Long.parseLong(paper.getCourse().getId()));
+			for(CourseProperty courseProperty:courseProperties){
+				//查询一级属性是否存在
+				Property propertyParent = new Property(firstProperty,0l,courseProperty.getId());
+				//存在一级属性
+				List<Property> propertieParents = propertyRepo.findAll(Example.of(propertyParent));
+				if(propertieParents != null || propertieParents.size()>0){
+					for(Property proParent:propertieParents){
+						Property propertySon = new Property(secondProperty,proParent.getId(),courseProperty.getId());
+						//查询二级属性
+						List<Property> propertieSons = propertyRepo.findAll(Example.of(propertySon));
+						//存在二级属性
+						if(propertieSons!=null && propertieSons.size()>0){
+							for(Property proSon:propertieSons){
+								//根据二级查询一级
+								Property prParent = propertyRepo.findOne(proSon.getParentId());
+								//保存一级和二级属性
+								QuesProperty quesProperty = new QuesProperty(prParent, proSon);
+								quesProperties.add(quesProperty);
+							}
+						}else{
+							importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题二级属性值不存在,请检查");
+				    		throw new PaperException(importPaperCheck.errorInfo);
+						}
+					}
+				}else{
+					importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题一级属性值不存在,请检查");
+		    		throw new PaperException(importPaperCheck.errorInfo);
+				}
+			}
+		}
+		//一级属性有值,二级属性为空
+		else {
+			//根据课程查询所有课程属性树
+			List<CourseProperty> courseProperties = coursePropertyRepo.findByCourseId(Long.parseLong(paper.getCourse().getId()));
+			for(CourseProperty courseProperty:courseProperties){
+				//查询一级属性
+				Property propertyParent = new Property(firstProperty,0l,courseProperty.getId());
+				List<Property> propertieParents = propertyRepo.findAll(Example.of(propertyParent));
+				//存在一级属性
+				if(propertieParents!=null && propertieParents.size()>0){
+					for(Property proParent:propertieParents){
+						//根据一级属性查询二级属性
+						List<Property> proSons = propertyRepo.findByParentIdOrderByNumber(proParent.getId());
+						//存在二级属性,报错
+						if(proSons!=null && proSons.size()>0){
+							importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题二级属性值为空,请检查");
+				    		throw new PaperException(importPaperCheck.errorInfo);
+						}else {
+							//保存试题属性
+							QuesProperty quesProperty = new QuesProperty(proParent, null);
+							quesProperties.add(quesProperty);
+						}
+					}
+				}else {
+					importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题一级属性值不存在,请检查");
+		    		throw new PaperException(importPaperCheck.errorInfo);
+				}
+			}
+		}
+	}
+
+	/**
+     * 校验小题尾信息是否含有"一节属性","二级属性","难度","公开"
+     * @param firstProperty
+     * @param secondProperty
+     * @param difficulty
+     * @param publicity
+     */
+    private void checkAttributeIsFull(String firstProperty,String secondProperty, Double difficulty, 
+    		Boolean publicity,ImportPaperCheck importPaperCheck,int subQuesNum) throws Exception{
+    	if(firstProperty == null){
+    		importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题一级属性缺失,请检查");
+    		throw new PaperException(importPaperCheck.errorInfo);
+    	}
+    	if(secondProperty == null){
+    		importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题二级属性缺失,请检查");
+    		throw new PaperException(importPaperCheck.errorInfo);
+    	}
+    	if(difficulty == null){
+    		importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题难度缺失,请检查");
+    		throw new PaperException(importPaperCheck.errorInfo);
+    	}
+    	if(publicity == null){
+    		importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题公开性缺失,请检查");
+    		throw new PaperException(importPaperCheck.errorInfo);
+    	}
+	}
+
+	/**
      * 处理选择题option信息
      * 
      * @param question
@@ -753,7 +914,7 @@ public class ImportPaperService {
      * @throws Exception
      */
     public void processNestedQues(List<Object> pList, int index,Question question, PaperDetailUnit paperDetailUnit,
-            ImportPaperCheck importPaperCheck, WordprocessingMLPackage wordMLPackage) throws Exception {
+            ImportPaperCheck importPaperCheck, WordprocessingMLPackage wordMLPackage,Paper paper) throws Exception {
         // 题型
         String nestedQuesType = "";
         // 设置套题题干
@@ -792,13 +953,13 @@ public class ImportPaperService {
                     // 处理选项
                     processQuesOption(pList, importPaperCheck.index, subQuesNum, subQues, importPaperCheck,wordMLPackage);
                     // 处理尾信息
-                    processQuesTail(pList, importPaperCheck.index, subQuesNum, subQues, paperDetailUnit,importPaperCheck, wordMLPackage, true);
+                    processQuesTail(pList, importPaperCheck.index, subQuesNum, subQues, paperDetailUnit,importPaperCheck, wordMLPackage, true,paper);
                     // 处理选择题的option--chenken 20170426
                     processSelectOption(subQues);
                 } else {
                     // 处理其他题型
                     processQuesBody(pList, importPaperCheck.index, subQuesNum, subQues, importPaperCheck, wordMLPackage);
-                    processQuesTail(pList, importPaperCheck.index, subQuesNum, subQues, paperDetailUnit,importPaperCheck, wordMLPackage, true);
+                    processQuesTail(pList, importPaperCheck.index, subQuesNum, subQues, paperDetailUnit,importPaperCheck, wordMLPackage, true,paper);
                 }
                 subQuesList.add(subQues);
                 i = importPaperCheck.index - 1;
@@ -1060,6 +1221,52 @@ public class ImportPaperService {
             }
         }
     }
+    
+    /**
+     * 校验试题难度
+     * @param difficulty
+     * @param tmpText
+     * @param importPaperCheck
+     * @param subQuesNum
+     * @throws Exception
+     */
+    private void checkDiffculty(Double difficulty,String tmpText,ImportPaperCheck importPaperCheck,int subQuesNum)throws Exception{
+    	if(StringUtils.isBlank(tmpText)){
+    		//如果为空,默认难度0.5
+    		difficulty = 0.5;
+    	}else if(!isInteger(tmpText) || (Double.parseDouble(tmpText)<1) || (Double.parseDouble(tmpText)>10)){
+    		//如果不是整数,或者在1到10之间,就报错
+    		importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,试题难度只能是1到10之间整数");
+    		throw new PaperException(importPaperCheck.errorInfo);
+    	}else {
+    		difficulty = Double.parseDouble(tmpText)%10;
+		}
+    }
+    
+   /**
+    * 校验试题公开度
+    * @param publicity
+    * @param tmpText
+    * @param importPaperCheck
+    * @param subQuesNum
+    * @throws Exception
+    */
+    private void checkPublicity(Boolean publicity,String tmpText,ImportPaperCheck importPaperCheck,int subQuesNum)throws Exception{
+    	if(StringUtils.isBlank(tmpText)){
+    		//如果为空,默认是公开
+    		publicity = true;
+    	}else if(!tmpText.equals("公开") || !tmpText.equals("非公开")){
+    		//如果不是公开和非公开,就报错
+    		importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,试题公开度只能是公开和非公开");
+    		throw new PaperException(importPaperCheck.errorInfo);
+    	}else {
+    		if(tmpText.equals("非公开")){
+    			publicity = false;
+    		}else {
+    			publicity = true;
+			}
+		}
+    }
 
     /**
      * 校验客观题答案完整性
@@ -1208,15 +1415,17 @@ public class ImportPaperService {
 	}
 
 	public static void main(String[] args){
-        try {
-            File file = new File("/Users/songyue/Downloads/行政组织学A卷.docx");
-            File outFile = new File("/Users/songyue/Downloads/行政组织学A1卷.docx");
-            WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(file);
-            DocxProcessUtil.initPkgImage(wordMLPackage);
-            wordMLPackage.save(outFile);
-        } catch (Docx4JException e) {
-            e.printStackTrace();
-        }finally {
-        }
+		String s1 = null;
+		String s2 = " ";
+		boolean b = false;
+		if(s2 == null){
+			b = true;
+		}
+		System.out.println(b);
     }
+	
+	public static boolean isInteger(String str) { 
+		Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");  
+    	return pattern.matcher(str).matches();
+	}
 }

+ 35 - 30
cqb-question-resource/pom.xml

@@ -1,30 +1,35 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>comm-ques-bank</artifactId>
-        <groupId>com.qmth.cqb</groupId>
-        <version>0.1.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>cqb-question-resource</artifactId>
-
-    <name>cqb-question-resource</name>
-
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>com.qmth.cqb</groupId>
-            <artifactId>cqb-comm-utils</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.qmth.cqb</groupId>
-            <artifactId>cqb-base</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-</project>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>comm-ques-bank</artifactId>
+        <groupId>com.qmth.cqb</groupId>
+        <version>0.1.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>cqb-question-resource</artifactId>
+
+    <name>cqb-question-resource</name>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.qmth.cqb</groupId>
+            <artifactId>cqb-comm-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.qmth.cqb</groupId>
+            <artifactId>cqb-base</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.qmth.cqb</groupId>
+            <artifactId>cqb-paper</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>

+ 43 - 0
cqb-question-resource/src/main/java/com/qmth/cqb/question/model/QuesProperty.java

@@ -0,0 +1,43 @@
+package com.qmth.cqb.question.model;
+
+import java.io.Serializable;
+
+import com.qmth.cqb.paper.model.Property;
+public class QuesProperty implements Serializable{
+
+	private static final long serialVersionUID = -2303143377325064933L;
+
+	private Property firstProperty;//一级属性
+	
+	private Property secondProperty;//二级属性
+	
+	public QuesProperty(){
+		
+	}
+	
+	public QuesProperty(Property firstProperty,Property secondProperty){
+		this.firstProperty = firstProperty;
+		this.secondProperty = secondProperty;
+	}
+
+	public Property getFirstProperty() {
+		return firstProperty;
+	}
+
+	public void setFirstProperty(Property firstProperty) {
+		this.firstProperty = firstProperty;
+	}
+
+	public Property getSecondProperty() {
+		return secondProperty;
+	}
+
+	public void setSecondProperty(Property secondProperty) {
+		this.secondProperty = secondProperty;
+	}
+
+	public static long getSerialversionuid() {
+		return serialVersionUID;
+	}
+	
+}

+ 366 - 332
cqb-question-resource/src/main/java/com/qmth/cqb/question/model/Question.java

@@ -1,332 +1,366 @@
-package com.qmth.cqb.question.model;
-
-import java.io.Serializable;
-import java.util.List;
-import java.util.Map;
-
-import com.qmth.cqb.base.model.Course;
-import com.qmth.cqb.base.model.Specialty;
-
-import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
-import org.springframework.data.annotation.Id;
-
-import com.qmth.cqb.utils.word.DocxProcessUtil;
-
-import cn.com.qmth.examcloud.common.dto.question.enums.QuesStructType;
-
-/**
- * Created by songyue on 16/12/27.
- */
-public class Question implements Serializable {
-
-    private static final long serialVersionUID = -493414992043982866L;
-
-    @Id
-    private String id;
-
-    private String quesBody;// 题干,默认为html
-
-    private String quesBodyWord;// 题干word
-    /**
-     * 试题wordpkg对象序列化数据
-     */
-//    private byte[] quesPkg;
-
-    /**
-     * 试题pkg路径Id
-     */
-    private String quesPkgPathId;
-
-    private String quesAnswer;// 答案,默认为html
-
-    private String quesAnswerWord;// 答案word
-
-    private String quesAnswerAnalysis;// 答案解析,默认为html
-
-    private String quesAnswerAnalysisWord;// 答案word解析
-
-    private List<QuesOption> quesOptions;// 试题选项
-
-    private List<QuesResource> quesResource;// 试题resource(试题资源库集合,适用于多媒体介质试题)
-
-    private QuesStructType questionType;// 试题结构类型
-
-    private String createTime;// 创建时间
-
-    private String updateTime;// 更新时间
-
-    private List<Question> subQuestions;// 子题目,用于套题
-
-    private Double score;// 预设分值
-
-    @Deprecated
-    private String courseNo;// 课程CODE
-
-    @Deprecated
-    private String courseName;// 课程名称
-
-    @Deprecated
-    private String courseLevel;//课程层次
-
-    @Deprecated
-    private String courseMajor;//课程专业
-
-    private Course course;
-
-    private String orgId; // 机构ID
-
-    private Map<String, String> quesParams;// 试题属性
-    /**
-     * 是否包含音频
-     */
-    private Boolean hasAudio;
-
-    private List<QuestionAudio> questionAudios;
-
-    private String quesName;//来源大题
-    
-    private Integer number;
-    
-    private Specialty specialty;
-    
-    public static long getSerialVersionUID() {
-        return serialVersionUID;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getQuesBody() {
-        return quesBody;
-    }
-
-    public void setQuesBody(String quesBody) {
-        this.quesBody = quesBody;
-    }
-
-    public String getQuesBodyWord() {
-        return quesBodyWord;
-    }
-
-    public void setQuesBodyWord(String quesBodyWord) {
-        this.quesBodyWord = quesBodyWord;
-    }
-
-    public String getQuesAnswer() {
-        return quesAnswer;
-    }
-
-    public void setQuesAnswer(String quesAnswer) {
-        this.quesAnswer = quesAnswer;
-    }
-
-    public String getQuesAnswerWord() {
-        return quesAnswerWord;
-    }
-
-    public void setQuesAnswerWord(String quesAnswerWord) {
-        this.quesAnswerWord = quesAnswerWord;
-    }
-
-    public String getQuesAnswerAnalysis() {
-        return quesAnswerAnalysis;
-    }
-
-    public void setQuesAnswerAnalysis(String quesAnswerAnalysis) {
-        this.quesAnswerAnalysis = quesAnswerAnalysis;
-    }
-
-    public String getQuesAnswerAnalysisWord() {
-        return quesAnswerAnalysisWord;
-    }
-
-    public void setQuesAnswerAnalysisWord(String quesAnswerAnalysisWord) {
-        this.quesAnswerAnalysisWord = quesAnswerAnalysisWord;
-    }
-
-    public List<QuesOption> getQuesOptions() {
-        return quesOptions;
-    }
-
-    public void setQuesOptions(List<QuesOption> quesOptions) {
-        this.quesOptions = quesOptions;
-    }
-
-    public List<QuesResource> getQuesResource() {
-        return quesResource;
-    }
-
-    public void setQuesResource(List<QuesResource> quesResource) {
-        this.quesResource = quesResource;
-    }
-
-    public QuesStructType getQuestionType() {
-        return questionType;
-    }
-
-    public void setQuestionType(QuesStructType questionType) {
-        this.questionType = questionType;
-    }
-
-    public String getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(String createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(String updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public List<Question> getSubQuestions() {
-        return subQuestions;
-    }
-
-    public void setSubQuestions(List<Question> subQuestions) {
-        this.subQuestions = subQuestions;
-    }
-
-    public Map<String, String> getQuesParams() {
-        return quesParams;
-    }
-
-    public void setQuesParams(Map<String, String> quesParams) {
-        this.quesParams = quesParams;
-    }
-
-//    public byte[] getQuesPkg() {
-//        return quesPkg;
-//    }
-//
-//    public WordprocessingMLPackage getPkgObj() {
-//        if (this.quesPkg != null && this.quesPkg.length > 0) {
-//            return DocxProcessUtil.getPkg(this.quesPkg);
-//        } else {
-//            return null;
-//        }
-//
-//    }
-//
-//    public void setQuesPkg(byte[] quesPkg) {
-//        this.quesPkg = quesPkg;
-//    }
-
-    public Double getScore() {
-        return score;
-    }
-
-    public void setScore(Double score) {
-        this.score = score;
-    }
-
-    public Question() {
-
-    }
-
-    public String getCourseNo() {
-        return courseNo;
-    }
-
-    public void setCourseNo(String courseNo) {
-        this.courseNo = courseNo;
-    }
-
-    public String getCourseName() {
-        return courseName;
-    }
-
-    public void setCourseName(String courseName) {
-        this.courseName = courseName;
-    }
-
-    public String getOrgId() {
-        return orgId;
-    }
-
-    public void setOrgId(String orgId) {
-        this.orgId = orgId;
-    }
-
-    public String getCourseLevel() {
-        return courseLevel;
-    }
-
-    public void setCourseLevel(String courseLevel) {
-        this.courseLevel = courseLevel;
-    }
-
-    public String getCourseMajor() {
-        return courseMajor;
-    }
-
-    public void setCourseMajor(String courseMajor) {
-        this.courseMajor = courseMajor;
-    }
-
-	public Boolean getHasAudio() {
-		return hasAudio;
-	}
-
-	public void setHasAudio(Boolean hasAudio) {
-		this.hasAudio = hasAudio;
-	}
-
-	public List<QuestionAudio> getQuestionAudios() {
-		return questionAudios;
-	}
-
-	public void setQuestionAudios(List<QuestionAudio> questionAudios) {
-		this.questionAudios = questionAudios;
-	}
-
-    public Course getCourse() {
-        return course;
-    }
-
-    public void setCourse(Course course) {
-        this.course = course;
-    }
-
-    public String getQuesName() {
-        return quesName;
-    }
-
-    public void setQuesName(String quesName) {
-        this.quesName = quesName;
-    }
-
-	public Integer getNumber() {
-		return number;
-	}
-
-	public void setNumber(Integer number) {
-		this.number = number;
-	}
-
-	public Specialty getSpecialty() {
-		return specialty;
-	}
-
-	public void setSpecialty(Specialty specialty) {
-		this.specialty = specialty;
-	}
-
-    public String getQuesPkgPathId() {
-        return quesPkgPathId;
-    }
-
-    public void setQuesPkgPathId(String quesPkgPathId) {
-        this.quesPkgPathId = quesPkgPathId;
-    }
-}
+package com.qmth.cqb.question.model;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+import com.qmth.cqb.base.model.Course;
+import com.qmth.cqb.base.model.Specialty;
+
+import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
+import org.springframework.data.annotation.Id;
+
+import com.qmth.cqb.utils.word.DocxProcessUtil;
+
+import cn.com.qmth.examcloud.common.dto.question.enums.QuesStructType;
+
+/**
+ * Created by songyue on 16/12/27.
+ */
+public class Question implements Serializable {
+
+    private static final long serialVersionUID = -493414992043982866L;
+
+    @Id
+    private String id;
+
+    private String quesBody;// 题干,默认为html
+
+    private String quesBodyWord;// 题干word
+    /**
+     * 试题wordpkg对象序列化数据
+     */
+//    private byte[] quesPkg;
+
+    /**
+     * 试题pkg路径Id
+     */
+    private String quesPkgPathId;
+
+    private String quesAnswer;// 答案,默认为html
+
+    private String quesAnswerWord;// 答案word
+
+    private String quesAnswerAnalysis;// 答案解析,默认为html
+
+    private String quesAnswerAnalysisWord;// 答案word解析
+
+    private List<QuesOption> quesOptions;// 试题选项
+
+    private List<QuesResource> quesResource;// 试题resource(试题资源库集合,适用于多媒体介质试题)
+
+    private QuesStructType questionType;// 试题结构类型
+
+    private String createTime;// 创建时间
+
+    private String updateTime;// 更新时间
+
+    private List<Question> subQuestions;// 子题目,用于套题
+
+    private Double score;// 预设分值
+
+    @Deprecated
+    private String courseNo;// 课程CODE
+
+    @Deprecated
+    private String courseName;// 课程名称
+
+    @Deprecated
+    private String courseLevel;//课程层次
+
+    @Deprecated
+    private String courseMajor;//课程专业
+
+    private Course course;
+
+    private String orgId; // 机构ID
+
+    private Map<String, String> quesParams;// 试题属性
+    /**
+     * 是否包含音频
+     */
+    private Boolean hasAudio;
+
+    private List<QuestionAudio> questionAudios;
+
+    private String quesName;//来源大题
+    
+    private Integer number;
+    
+    private Specialty specialty;
+    
+    /**
+     * 试题属性
+     */
+    private List<QuesProperty> quesProperties;//关联多组属性
+    
+    private Double difficulty; //难度
+    
+    private Boolean publicity; //公开度
+    
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getQuesBody() {
+        return quesBody;
+    }
+
+    public void setQuesBody(String quesBody) {
+        this.quesBody = quesBody;
+    }
+
+    public String getQuesBodyWord() {
+        return quesBodyWord;
+    }
+
+    public void setQuesBodyWord(String quesBodyWord) {
+        this.quesBodyWord = quesBodyWord;
+    }
+
+    public String getQuesAnswer() {
+        return quesAnswer;
+    }
+
+    public void setQuesAnswer(String quesAnswer) {
+        this.quesAnswer = quesAnswer;
+    }
+
+    public String getQuesAnswerWord() {
+        return quesAnswerWord;
+    }
+
+    public void setQuesAnswerWord(String quesAnswerWord) {
+        this.quesAnswerWord = quesAnswerWord;
+    }
+
+    public String getQuesAnswerAnalysis() {
+        return quesAnswerAnalysis;
+    }
+
+    public void setQuesAnswerAnalysis(String quesAnswerAnalysis) {
+        this.quesAnswerAnalysis = quesAnswerAnalysis;
+    }
+
+    public String getQuesAnswerAnalysisWord() {
+        return quesAnswerAnalysisWord;
+    }
+
+    public void setQuesAnswerAnalysisWord(String quesAnswerAnalysisWord) {
+        this.quesAnswerAnalysisWord = quesAnswerAnalysisWord;
+    }
+
+    public List<QuesOption> getQuesOptions() {
+        return quesOptions;
+    }
+
+    public void setQuesOptions(List<QuesOption> quesOptions) {
+        this.quesOptions = quesOptions;
+    }
+
+    public List<QuesResource> getQuesResource() {
+        return quesResource;
+    }
+
+    public void setQuesResource(List<QuesResource> quesResource) {
+        this.quesResource = quesResource;
+    }
+
+    public QuesStructType getQuestionType() {
+        return questionType;
+    }
+
+    public void setQuestionType(QuesStructType questionType) {
+        this.questionType = questionType;
+    }
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(String updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public List<Question> getSubQuestions() {
+        return subQuestions;
+    }
+
+    public void setSubQuestions(List<Question> subQuestions) {
+        this.subQuestions = subQuestions;
+    }
+
+    public Map<String, String> getQuesParams() {
+        return quesParams;
+    }
+
+    public void setQuesParams(Map<String, String> quesParams) {
+        this.quesParams = quesParams;
+    }
+
+//    public byte[] getQuesPkg() {
+//        return quesPkg;
+//    }
+//
+//    public WordprocessingMLPackage getPkgObj() {
+//        if (this.quesPkg != null && this.quesPkg.length > 0) {
+//            return DocxProcessUtil.getPkg(this.quesPkg);
+//        } else {
+//            return null;
+//        }
+//
+//    }
+//
+//    public void setQuesPkg(byte[] quesPkg) {
+//        this.quesPkg = quesPkg;
+//    }
+
+    public Double getScore() {
+        return score;
+    }
+
+    public void setScore(Double score) {
+        this.score = score;
+    }
+
+    public Question() {
+
+    }
+
+    public String getCourseNo() {
+        return courseNo;
+    }
+
+    public void setCourseNo(String courseNo) {
+        this.courseNo = courseNo;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public String getOrgId() {
+        return orgId;
+    }
+
+    public void setOrgId(String orgId) {
+        this.orgId = orgId;
+    }
+
+    public String getCourseLevel() {
+        return courseLevel;
+    }
+
+    public void setCourseLevel(String courseLevel) {
+        this.courseLevel = courseLevel;
+    }
+
+    public String getCourseMajor() {
+        return courseMajor;
+    }
+
+    public void setCourseMajor(String courseMajor) {
+        this.courseMajor = courseMajor;
+    }
+
+	public Boolean getHasAudio() {
+		return hasAudio;
+	}
+
+	public void setHasAudio(Boolean hasAudio) {
+		this.hasAudio = hasAudio;
+	}
+
+	public List<QuestionAudio> getQuestionAudios() {
+		return questionAudios;
+	}
+
+	public void setQuestionAudios(List<QuestionAudio> questionAudios) {
+		this.questionAudios = questionAudios;
+	}
+
+    public Course getCourse() {
+        return course;
+    }
+
+    public void setCourse(Course course) {
+        this.course = course;
+    }
+
+    public String getQuesName() {
+        return quesName;
+    }
+
+    public void setQuesName(String quesName) {
+        this.quesName = quesName;
+    }
+
+	public Integer getNumber() {
+		return number;
+	}
+
+	public void setNumber(Integer number) {
+		this.number = number;
+	}
+
+	public Specialty getSpecialty() {
+		return specialty;
+	}
+
+	public void setSpecialty(Specialty specialty) {
+		this.specialty = specialty;
+	}
+
+    public String getQuesPkgPathId() {
+        return quesPkgPathId;
+    }
+
+    public void setQuesPkgPathId(String quesPkgPathId) {
+        this.quesPkgPathId = quesPkgPathId;
+    }
+
+	public Double getDifficulty() {
+		return difficulty;
+	}
+
+	public void setDifficulty(Double difficulty) {
+		this.difficulty = difficulty;
+	}
+
+	public Boolean getPublicity() {
+		return publicity;
+	}
+
+	public void setPublicity(Boolean publicity) {
+		this.publicity = publicity;
+	}
+
+	public List<QuesProperty> getQuesProperties() {
+		return quesProperties;
+	}
+
+	public void setQuesProperties(List<QuesProperty> quesProperties) {
+		this.quesProperties = quesProperties;
+	}
+    
+}