Sfoglia il codice sorgente

fixbug已调用试卷分数修改

xiatian 3 anni fa
parent
commit
dfa2c65c88

+ 6 - 3
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/PaperDetailUnitServiceImpl.java

@@ -269,19 +269,22 @@ public class PaperDetailUnitServiceImpl implements PaperDetailUnitService {
 
                     Question sub = baseQuestion.getSubQuestions().get(index - 1);
                     if (updateQuestion.getId().equals(sub.getId())) {
+                    	if(updateQuestion.getScore().doubleValue()!=baseUnit.getSubScoreList().get(index - 1).doubleValue()) {
+                    		throw new StatusException("500", "试卷已调用,不能修改分数");
+                    	}
                         checkUpdate(updateQuestion, sub);
 
                     }
                 }
             }
         } else {
+        	if(updateUnit.getScore().doubleValue()!=baseUnit.getScore().doubleValue()) {
+        		throw new StatusException("500", "试卷已调用,不能修改分数");
+        	}
         	checkUpdate(updateQuestion, baseQuestion);
         }
     }
     private void checkUpdate(Question update,Question base) {
-    	if(update.getScore().doubleValue()!=base.getScore().doubleValue()) {
-    		throw new StatusException("500", "试卷已调用,不能修改分数");
-    	}
     	if(QuesStructType.SINGLE_ANSWER_QUESTION.equals(base.getQuestionType())
     			||QuesStructType.MULTIPLE_ANSWER_QUESTION.equals(base.getQuestionType())){
 	    	if(update.getQuesOptions().size()!=base.getQuesOptions().size()) {