Explorar o código

Merge branch 'master' of http://120.77.221.199:3000/public/JingTieXueTang

qilikuacha %!s(int64=3) %!d(string=hai) anos
pai
achega
337523554d
Modificáronse 1 ficheiros con 7 adicións e 7 borrados
  1. 7 7
      src/main/java/com/jtxt/demo/service/ExamServiceImpl.java

+ 7 - 7
src/main/java/com/jtxt/demo/service/ExamServiceImpl.java

@@ -124,18 +124,18 @@ public class ExamServiceImpl implements ExamService {
 
     @Override
     public List<String> startExam(Exam exam, User user) {
-        ExamHistory examHistoryInDb = examHistoryRepository.findByUserIdAndExamId(user.getUserName(), exam.getId());
-        if (examHistoryInDb != null) {
-            if (examHistoryInDb.getEndTime() != null) {
-                return null; // exam has been finished.
-            }
-        } else {
+//        ExamHistory examHistoryInDb = examHistoryRepository.findByUserIdAndExamId(user.getUserName(), exam.getId());
+//        if (examHistoryInDb != null) {
+//            if (examHistoryInDb.getEndTime() != null) {
+//                return null; // exam has been finished.
+//            }
+//        } else {
             ExamHistory examHistory = new ExamHistory();
             examHistory.setExamId(exam.getId());
             examHistory.setStartTime(LocalDateTime.now(CHINA_ZONE));
             examHistory.setUserId(user.getUserName());
             examHistoryRepository.insert(examHistory);
-        }
+//        }
         return examToQuestionRepository
                 .findAllByExamId(exam.getId()).stream()
                 .map(x -> x.getQuestionId())