Переглянути джерело

Revert "抽题模板缓存结构小题信息改为hash"

This reverts commit d6d8c4ecff13cba54fefac19be3d94be982db7f1.
xiatian 1 рік тому
батько
коміт
2009726cb2

+ 0 - 14
examcloud-core-questions-base/src/main/java/cn/com/qmth/examcloud/core/questions/base/enums/QuestionDifficulty.java

@@ -1,7 +1,5 @@
 package cn.com.qmth.examcloud.core.questions.base.enums;
 
-import org.apache.commons.lang3.StringUtils;
-
 public enum QuestionDifficulty {
 	HARD("难"), MEDIUM("中"), EASY("易");
 
@@ -14,17 +12,5 @@ public enum QuestionDifficulty {
 	public String getName() {
 		return name;
 	}
-	
-	public static QuestionDifficulty getByName(String name) {
-		if(StringUtils.isBlank(name)) {
-			return null;
-		}
-		for(QuestionDifficulty e:QuestionDifficulty.values()) {
-			if(name.equals(e.getName())) {
-				return e;
-			}
-		}
-		return null;
-	}
 
 }

+ 1 - 6
examcloud-core-questions-dao/src/main/java/cn/com/qmth/examcloud/core/questions/dao/entity/PaperStruct.java

@@ -15,12 +15,7 @@ import java.util.Map;
 
 public class PaperStruct extends IdBase {
 
-    /**
-	 * 
-	 */
-	private static final long serialVersionUID = -1195997869648753373L;
-
-	@Indexed(unique = true)
+    @Indexed(unique = true)
     private String name;// 试卷结构名称
 
     private Double totalScore;// 总分

+ 2 - 2
examcloud-core-questions-dao/src/main/java/cn/com/qmth/examcloud/core/questions/dao/entity/RandomPaperQuestion.java

@@ -18,8 +18,8 @@ public class RandomPaperQuestion extends MongoBaseEntity {
 	private String randomPaperId;
 
 	private Long courseId;
-//	 精确结构:大题号-结构序号(1开始)-公开/非公开-难度  |  示例:1-1-true-HARD
-//	  蓝图结构:大题号-一级属性id-二级属性id-公开/非公开-难度  |  示例:1-1-60efd3e85d030a52bb08b1e8-60efd3e85d030a52bb08b1e9-true-HARD
+//	 精确结构:大题号-结构序号(1开始)-公开/非公开-难度  |  示例:1-1-true-
+//	  蓝图结构:大题号-一级属性id-二级属性id-公开/非公开-难度  |  示例:1-1-60efd3e85d030a52bb08b1e8-60efd3e85d030a52bb08b1e9-true-
 	private String key;
 
 	private String questionId;

+ 3 - 4
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/bean/randompaper/StructQuestionCheckDto.java

@@ -4,7 +4,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import cn.com.qmth.examcloud.core.questions.base.enums.QuestionDifficulty;
 import cn.com.qmth.examcloud.core.questions.dao.entity.PaperDetailStruct;
 import cn.com.qmth.examcloud.core.questions.dao.entity.dto.CoursePropertyNumberDto;
 import cn.com.qmth.examcloud.core.questions.dao.entity.dto.PaperDetailUnitStructDto;
@@ -12,7 +11,7 @@ import cn.com.qmth.examcloud.core.questions.dao.entity.dto.PaperDetailUnitStruct
 public class StructQuestionCheckDto {
 	private Set<String> usedQuesIds = new HashSet<>();
 	private Boolean pub;
-	private QuestionDifficulty difficulty;
+	private String difficulty;
 	private PaperDetailUnitStructDto us;
 	private Integer index;
 	private Integer detailNumber;
@@ -72,11 +71,11 @@ public class StructQuestionCheckDto {
 		this.pub = pub;
 	}
 
-	public QuestionDifficulty getDifficulty() {
+	public String getDifficulty() {
 		return difficulty;
 	}
 
-	public void setDifficulty(QuestionDifficulty difficulty) {
+	public void setDifficulty(String difficulty) {
 		this.difficulty = difficulty;
 	}
 

+ 8 - 14
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/cache/RandomPaperCache.java

@@ -1,19 +1,21 @@
 package cn.com.qmth.examcloud.core.questions.service.cache;
 
+import java.util.List;
 import java.util.Map;
 
+import cn.com.qmth.examcloud.core.questions.dao.entity.RandomPaperQuestion;
+
 public class RandomPaperCache {
-	private String id;
 	private String name;
 
 	private String paperStructId;
 
 	/**
-	 * key描述 精确结构:大题号-结构序号(1开始)-公开/非公开-难度 | 示例:1-1-true-HARD
+	 * key描述 精确结构:大题号-结构序号(1开始)-公开/非公开-难度 | 示例:1-1-true-
 	 * 蓝图结构:大题号-一级属性id-二级属性id-公开/非公开-难度 |
-	 * 示例:1-1-60efd3e85d030a52bb08b1e8-60efd3e85d030a52bb08b1e9-true-HARD
+	 * 示例:1-1-60efd3e85d030a52bb08b1e8-60efd3e85d030a52bb08b1e9-true-
 	 */
-	private Map<String, Integer> questionMap;
+	private Map<String, List<RandomPaperQuestion>> questionMap;
 
 	public String getPaperStructId() {
 		return paperStructId;
@@ -23,11 +25,11 @@ public class RandomPaperCache {
 		this.paperStructId = paperStructId;
 	}
 
-	public Map<String, Integer> getQuestionMap() {
+	public Map<String, List<RandomPaperQuestion>> getQuestionMap() {
 		return questionMap;
 	}
 
-	public void setQuestionMap(Map<String, Integer> questionMap) {
+	public void setQuestionMap(Map<String, List<RandomPaperQuestion>> questionMap) {
 		this.questionMap = questionMap;
 	}
 
@@ -39,12 +41,4 @@ public class RandomPaperCache {
 		this.name = name;
 	}
 
-	public String getId() {
-		return id;
-	}
-
-	public void setId(String id) {
-		this.id = id;
-	}
-
 }