浏览代码

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

qilikuacha 3 年之前
父节点
当前提交
337523554d
共有 1 个文件被更改,包括 7 次插入7 次删除
  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())