| | |
| | | List<ExamSubjectChoicesVO> radioRandomSubjectList = examPaperService.queryRandomSubjectList(radio,25); |
| | | List<ExamSubjectChoicesVO> checkboxRandomSubjectList = examPaperService.queryRandomSubjectList(checkbox,10); |
| | | List<ExamSubjectChoicesVO> judgeRandomSubjectList = examPaperService.queryRandomSubjectList(judge,20); |
| | | List<ExamSubjectChoicesVO> sortRandomSubjectList = examPaperService.queryRandomSubjectList(sort,5); |
| | | // List<ExamSubjectChoicesVO> sortRandomSubjectList = examPaperService.queryRandomSubjectList(sort,5); |
| | | |
| | | //合并集合数据 |
| | | choicesVOList.addAll(radioRandomSubjectList); |
| | | choicesVOList.addAll(checkboxRandomSubjectList); |
| | | choicesVOList.addAll(judgeRandomSubjectList); |
| | | choicesVOList.addAll(sortRandomSubjectList); |
| | | // choicesVOList.addAll(sortRandomSubjectList); |
| | | |
| | | //取出考试id |
| | | List<Long> longList = choicesVOList.stream().map(ExamSubjectChoicesVO::getId).collect(Collectors.toList()); |
| | |
| | | simulateExamRecord.setStatus(1); |
| | | //新增模拟考试记录信息 |
| | | boolean status = this.save(simulateExamRecord); |
| | | |
| | | ExamSubjectChoices examSubjectChoices = new ExamSubjectChoices(); |
| | | examSubjectChoices.setId(choicesVOList.get(0).getId()); |
| | | ExamSubjectChoicesVO examSubjectChoicesVO = examSubjectChoicesService.selectExamSubjectChoicesInfo(examSubjectChoices); |
| | | if (status){ |
| | | map.put("simulateExamRecord",simulateExamRecord); |
| | | map.put("examSubjectInfo",choicesVOList); |
| | | map.put("examSubjectChoicesVO",examSubjectChoicesVO); |
| | | //返回信息 |
| | | return map; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 考试暂停后继续,1查询所有的答题信息,2查询所有的已答信息 3其他信息 |
| | | * @param simulateExamRecord 必须包含 模拟考试id,id_card_no, type 1: 继续考试 2: 放弃之前的考试,重新生成题目考试 |
| | | * @param simulateExamRecord 必须包含 模拟考试id,, type 1: 继续考试 2: 放弃之前的考试,重新生成题目考试 |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | //其他信息 |
| | | SimulateExamRecord simulateExamRecord1 = this.getById(simulateExamRecord.getId()); |
| | | List<String> list = Arrays.asList(simulateExamRecord1.getSubjectIds().split(",")); |
| | | List<Long> list1 = new ArrayList<>(); |
| | | //装换为Long 类型,不然返回的题目顺序会乱 |
| | | for (String s : list) { |
| | | list1.add(Long.parseLong(s)); |
| | | } |
| | | |
| | | //修改信息,修改回考试中的状态 |
| | | simulateExamRecord1.setStatus(2); |
| | | simulateExamRecord1.setStatus(1); |
| | | this.updateById(simulateExamRecord1); |
| | | |
| | | //1.查询当前人员当前模拟考试的考试题目信息 |
| | | List<ExamSubjectChoicesVO> examSubjectChoicesVOSList = baseMapper.getSimulateExamRefreshList(list); |
| | | List<ExamSubjectChoicesVO> examSubjectChoicesVOSList = baseMapper.getSimulateExamRefreshList(list1); |
| | | |
| | | //2.查询当前人员已答的题目信息 |
| | | SimulateExamAnswerRecord simulateExamAnswerRecord = new SimulateExamAnswerRecord(); |
| | |
| | | //去获取题目 |
| | | return insertSimulateExamRecord(simulateExamRecord1); |
| | | } |
| | | |
| | | } |
| | | return null; |
| | | } |