Browse Source

1111111111

chenken 7 năm trước cách đây
mục cha
commit
49bc4847f2

+ 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);
 	}