Quellcode durchsuchen

Merge branch 'master' of http://git.qmth.com.cn/ExamCloud-2/examcloud-core-examwork.git

wangwei vor 7 Jahren
Ursprung
Commit
300609939c

+ 6 - 2
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/ExamStudentController.java

@@ -361,8 +361,12 @@ public class ExamStudentController extends ControllerSupport {
 		examStudent.setFinished(finished);
 		// 进入考试时,判断考试次数是否小于考试信息(ecs_exam)中的考试次数,如果是,考试次数加一
 		long examTimes = examStudent.getExam().getExamTimes();
-		if (examTimes > examStudent.getNormalExamTimes()) {
-			examStudent.setNormalExamTimes(examStudent.getNormalExamTimes() + 1);
+		Integer normalTimes = examStudent.getNormalExamTimes();
+		if(normalTimes == null){
+			normalTimes = 0;
+		}
+		if (examTimes > normalTimes) {
+			examStudent.setNormalExamTimes(normalTimes.intValue() + 1);
 		}
 		return new ResponseEntity<ExamStudent>(examStudentRepo.save(examStudent), HttpStatus.OK);
 	}