소스 검색

题库取题方法修改

小么熊🐻 3 년 전
부모
커밋
65615f8268
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      jpcj-service/src/main/java/com/miaxis/question/service/impl/QuestionInfoServiceImpl.java

+ 4 - 2
jpcj-service/src/main/java/com/miaxis/question/service/impl/QuestionInfoServiceImpl.java

@@ -177,9 +177,11 @@ public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, Que
         //全题库
         List<QuestionInfo> allList = new ArrayList<QuestionInfo>();
         int error = 0;
-        while (allList.size() != total && error < 10) {
-            System.out.println("error:" + error);
+        while (allList.size() != total) {
             allList = new ArrayList<QuestionInfo>();
+            if(error >= 10) {
+                return allList;
+            }
             //判断题
             List<QuestionInfo> judgeList = new ArrayList<QuestionInfo>();
             //选择题