修改题目回显接口逻辑

master
xiaoCJ 4 months ago
parent 014ac3b232
commit 409c68b0d4

@ -56,9 +56,6 @@ public class TheoryTestController {
} catch (IOException e) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "服务器异常,请联系管理员");
}
for (int i = 0; i < list.size(); i++) {
list.get(i).setSource(String.valueOf(i + 1));
}
return new ResultEntity<>(HttpStatus.OK, "开始考试、客观题列表查询成功", list);
}

@ -491,18 +491,20 @@ public class TheoryTestServiceImpl implements TheoryTestService {
return objectiveQuestionList;
} else { //在两个小时内 返回最近的一条试卷
String singleIds = stuTheoryExam.getSingleIds();
String multipleIds = stuTheoryExam.getMultipleIds(); //todo 测试考试中心只有单选题的考试 是否会报错
String multipleIds = stuTheoryExam.getMultipleIds();
String judgeIds = stuTheoryExam.getJudgeIds();
List<String> singleIdList = Arrays.asList(singleIds.substring(1, singleIds.length() - 1).split(", "));
List<String> singleIdList = Arrays.asList(singleIds.split(", "));
System.out.println(Collections.singletonList(singleIdList).size());
List<ObjectiveQuestionWithBLOBs> returnQuestionList = new ArrayList<>();
if (StringUtils.isNotBlank(multipleIds)) {
List<String> multipleIdList = Arrays.asList(multipleIds.substring(1, multipleIds.length() - 1).split(", "));
List<String> multipleIdList = Arrays.asList(multipleIds.split(", "));
List<ObjectiveQuestionWithBLOBs> mulQuestionList = selectBatchByIdList(multipleIdList);
returnQuestionList.addAll(mulQuestionList);
}
if (StringUtils.isNotBlank(judgeIds)) {
List<String> judgeIdList = Arrays.asList(judgeIds.substring(1, judgeIds.length() - 1).split(", "));
List<String> judgeIdList = Arrays.asList(judgeIds.split(", "));
List<ObjectiveQuestionWithBLOBs> judgeQuestionList = selectBatchByIdList(judgeIdList);
returnQuestionList.addAll(judgeQuestionList);
}
@ -741,10 +743,9 @@ public class TheoryTestServiceImpl implements TheoryTestService {
if (ids == null || ids.length() <= 2) {
return Collections.emptyList();
}
return Arrays.asList(ids.substring(1, ids.length() - 1).split(", "));
return Arrays.asList(ids.split(", "));
}
//
// @Override
// public List<ObjectiveQuestionWithBLOBs> selectErrors(String userId, String schoolId) {

Loading…
Cancel
Save