Sfoglia il codice sorgente

取消判断是否考过试

aaa 3 anni fa
parent
commit
d8d0f1886e

+ 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())