|
|
|
@ -55,25 +55,23 @@ public class TheoryTestServiceImpl implements ITheoryTestService {
|
|
|
|
|
List<SysObjectiveQuestion> objectiveQuestionList = GenerateTest(userId);
|
|
|
|
|
return objectiveQuestionList;
|
|
|
|
|
} else { //在两个小时内 返回最近的一条试卷
|
|
|
|
|
List<SysObjectiveQuestion> returnQuestionList = new ArrayList();
|
|
|
|
|
String singleIds = stuTheoryExam.getSingleIds();
|
|
|
|
|
String multipleIds = stuTheoryExam.getMultipleIds();
|
|
|
|
|
String judgeIds = stuTheoryExam.getJudgeIds();
|
|
|
|
|
List<String> singleIdList = Arrays.asList(singleIds.substring(1, singleIds.length() - 1).split(", "));
|
|
|
|
|
for (int i = 0; i < singleIdList.size(); i++) {
|
|
|
|
|
SysObjectiveQuestion objectiveQuestion = objectiveQuestionMapper.selectByPrimaryKey(singleIdList.get(i));
|
|
|
|
|
returnQuestionList.add(objectiveQuestion);
|
|
|
|
|
}
|
|
|
|
|
List<String> multipleIdList = Arrays.asList(multipleIds.substring(1, multipleIds.length() - 1).split(", "));
|
|
|
|
|
for (int i = 0; i < multipleIdList.size(); i++) {
|
|
|
|
|
SysObjectiveQuestion objectiveQuestion = objectiveQuestionMapper.selectByPrimaryKey(multipleIdList.get(i));
|
|
|
|
|
returnQuestionList.add(objectiveQuestion);
|
|
|
|
|
}
|
|
|
|
|
List<String> judgeIdList = Arrays.asList(judgeIds.substring(1, judgeIds.length() - 1).split(", "));
|
|
|
|
|
for (int i = 0; i < judgeIdList.size(); i++) {
|
|
|
|
|
SysObjectiveQuestion objectiveQuestion = objectiveQuestionMapper.selectByPrimaryKey(judgeIdList.get(i));
|
|
|
|
|
List<String> singleIdList = Arrays.asList(singleIds.substring(1, singleIds.length() - 1).split(","));
|
|
|
|
|
List<String> multipleIdList = Arrays.asList(multipleIds.substring(1, multipleIds.length() - 1).split(","));
|
|
|
|
|
List<String> judgeIdList = Arrays.asList(judgeIds.substring(1, judgeIds.length() - 1).split(","));
|
|
|
|
|
List<String> idlist=new ArrayList<>();
|
|
|
|
|
idlist.addAll(singleIdList);
|
|
|
|
|
idlist.addAll(multipleIdList);
|
|
|
|
|
idlist.addAll(judgeIdList);
|
|
|
|
|
List<SysObjectiveQuestion> returnQuestionList = new ArrayList();
|
|
|
|
|
for (int i = 0; i < idlist.size(); i++) {
|
|
|
|
|
SysObjectiveQuestion objectiveQuestion = objectiveQuestionMapper.selectByPrimaryKey(idlist.get(i));
|
|
|
|
|
returnQuestionList.add(objectiveQuestion);
|
|
|
|
|
}
|
|
|
|
|
// List<SysObjectiveQuestion> returnQuestionList = objectiveQuestionMapper.selectBatchByIdList(idlist);
|
|
|
|
|
|
|
|
|
|
return returnQuestionList;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -204,7 +202,7 @@ public class TheoryTestServiceImpl implements ITheoryTestService {
|
|
|
|
|
} else {
|
|
|
|
|
StuErrorWithBLOBs stuError = stuErrors.get(0);
|
|
|
|
|
if (stuError.getSingleIds()!=null) {
|
|
|
|
|
List<String> stringList = Arrays.asList(stuError.getSingleIds().substring(1, stuError.getSingleIds().length() - 1).split(", "));
|
|
|
|
|
List<String> stringList = Arrays.asList(stuError.getSingleIds().substring(1, stuError.getSingleIds().length() - 1).split(","));
|
|
|
|
|
List<String> singleErrorIds = theoryTestDto.getSingleErrorIds();
|
|
|
|
|
|
|
|
|
|
List<String> combinedList = new ArrayList<>(stringList);
|
|
|
|
@ -216,7 +214,7 @@ public class TheoryTestServiceImpl implements ITheoryTestService {
|
|
|
|
|
stuError.setSingleIds(String.valueOf(theoryTestDto.getSingleErrorIds()));
|
|
|
|
|
}
|
|
|
|
|
if (stuError.getMultipleIds()!=null) {
|
|
|
|
|
List<String> stringList = Arrays.asList(stuError.getMultipleIds().substring(1, stuError.getMultipleIds().length() - 1).split(", "));
|
|
|
|
|
List<String> stringList = Arrays.asList(stuError.getMultipleIds().substring(1, stuError.getMultipleIds().length() - 1).split(","));
|
|
|
|
|
List<String> multipleErrorIds = theoryTestDto.getMultipleErrorIds();
|
|
|
|
|
|
|
|
|
|
List<String> combinedList = new ArrayList<>(stringList);
|
|
|
|
@ -228,7 +226,7 @@ public class TheoryTestServiceImpl implements ITheoryTestService {
|
|
|
|
|
stuError.setMultipleIds(String.valueOf(theoryTestDto.getMultipleErrorIds()));
|
|
|
|
|
}
|
|
|
|
|
if (stuError.getJudgeIds()!=null) {
|
|
|
|
|
List<String> stringList = Arrays.asList(stuError.getJudgeIds().substring(1, stuError.getJudgeIds().length() - 1).split(", "));
|
|
|
|
|
List<String> stringList = Arrays.asList(stuError.getJudgeIds().substring(1, stuError.getJudgeIds().length() - 1).split(","));
|
|
|
|
|
List<String> judgeErrorIds = theoryTestDto.getJudgeErrorIds();
|
|
|
|
|
List<String> combinedList = new ArrayList<>(stringList);
|
|
|
|
|
combinedList.addAll(judgeErrorIds);
|
|
|
|
@ -256,7 +254,7 @@ public class TheoryTestServiceImpl implements ITheoryTestService {
|
|
|
|
|
StuErrorWithBLOBs stuError = stuErrors.get(0);
|
|
|
|
|
String singleIds = stuError.getSingleIds();
|
|
|
|
|
if (!singleIds.isEmpty()) {
|
|
|
|
|
List<String> singleIdList = Arrays.asList(singleIds.substring(1, singleIds.length() - 1).split(", "));
|
|
|
|
|
List<String> singleIdList = Arrays.asList(singleIds.substring(1, singleIds.length() - 1).split(","));
|
|
|
|
|
for (int i = 0; i < singleIdList.size(); i++) {
|
|
|
|
|
SysObjectiveQuestion objectiveQuestion = objectiveQuestionMapper.selectByPrimaryKey(singleIdList.get(i));
|
|
|
|
|
objectiveQuestionList.add(objectiveQuestion);
|
|
|
|
@ -264,7 +262,7 @@ public class TheoryTestServiceImpl implements ITheoryTestService {
|
|
|
|
|
}
|
|
|
|
|
String multipleIds = stuError.getMultipleIds();
|
|
|
|
|
if (!multipleIds.isEmpty()) {
|
|
|
|
|
List<String> stringList = Arrays.asList(multipleIds.substring(1, multipleIds.length() - 1).split(", "));
|
|
|
|
|
List<String> stringList = Arrays.asList(multipleIds.substring(1, multipleIds.length() - 1).split(","));
|
|
|
|
|
for (int i = 0; i < stringList.size(); i++) {
|
|
|
|
|
SysObjectiveQuestion objectiveQuestion = objectiveQuestionMapper.selectByPrimaryKey(stringList.get(i));
|
|
|
|
|
objectiveQuestionList.add(objectiveQuestion);
|
|
|
|
@ -272,7 +270,7 @@ public class TheoryTestServiceImpl implements ITheoryTestService {
|
|
|
|
|
}
|
|
|
|
|
String judgeIds = stuError.getJudgeIds();
|
|
|
|
|
if (!judgeIds.isEmpty()) {
|
|
|
|
|
List<String> stringList = Arrays.asList(judgeIds.substring(1, judgeIds.length() - 1).split(", "));
|
|
|
|
|
List<String> stringList = Arrays.asList(judgeIds.substring(1, judgeIds.length() - 1).split(","));
|
|
|
|
|
for (int i = 0; i < stringList.size(); i++) {
|
|
|
|
|
SysObjectiveQuestion objectiveQuestion = objectiveQuestionMapper.selectByPrimaryKey(stringList.get(i));
|
|
|
|
|
objectiveQuestionList.add(objectiveQuestion);
|
|
|
|
@ -292,7 +290,7 @@ public class TheoryTestServiceImpl implements ITheoryTestService {
|
|
|
|
|
}
|
|
|
|
|
StuErrorWithBLOBs error = stuErrors.get(0);
|
|
|
|
|
if (Constant.OBJECTIVE_TYPE_SINGLE.equals(type)) {
|
|
|
|
|
List<String> stringList = Arrays.asList(error.getSingleIds().substring(1, stuErrors.get(0).getSingleIds().length() - 1).split(", "));
|
|
|
|
|
List<String> stringList = Arrays.asList(error.getSingleIds().substring(1, stuErrors.get(0).getSingleIds().length() - 1).split(","));
|
|
|
|
|
Set<String> set = new LinkedHashSet<>(stringList);
|
|
|
|
|
set.remove(objectiveQuestionId);
|
|
|
|
|
if(set.isEmpty()){
|
|
|
|
@ -303,7 +301,7 @@ public class TheoryTestServiceImpl implements ITheoryTestService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (Constant.OBJECTIVE_TYPE_Many.equals(type)) {
|
|
|
|
|
Set<String> set = new LinkedHashSet<>(Arrays.asList(error.getMultipleIds().substring(1, error.getMultipleIds().length() - 1).split(", ")));
|
|
|
|
|
Set<String> set = new LinkedHashSet<>(Arrays.asList(error.getMultipleIds().substring(1, error.getMultipleIds().length() - 1).split(",")));
|
|
|
|
|
set.remove(objectiveQuestionId);
|
|
|
|
|
if(set.isEmpty()){
|
|
|
|
|
error.setMultipleIds(null);
|
|
|
|
@ -313,7 +311,7 @@ public class TheoryTestServiceImpl implements ITheoryTestService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(Constant.OBJECTIVE_TYPE_JUDGE.equals(type)){
|
|
|
|
|
Set<String> set = new LinkedHashSet<>(Arrays.asList(error.getJudgeIds().substring(1, error.getJudgeIds().length() - 1).split(", ")));
|
|
|
|
|
Set<String> set = new LinkedHashSet<>(Arrays.asList(error.getJudgeIds().substring(1, error.getJudgeIds().length() - 1).split(",")));
|
|
|
|
|
set.remove(objectiveQuestionId);
|
|
|
|
|
if(set.isEmpty()){
|
|
|
|
|
error.setJudgeIds(null);
|
|
|
|
@ -341,18 +339,18 @@ public class TheoryTestServiceImpl implements ITheoryTestService {
|
|
|
|
|
StuTheoryExamWithBLOBs theoryExam = theoryExamMapper.selectByPrimaryKey(theoryExamId);
|
|
|
|
|
String singleIds = theoryExam.getSingleIds();
|
|
|
|
|
ArrayList<String> idsList = new ArrayList<>();
|
|
|
|
|
List<String> singleIdList = Arrays.asList(singleIds.substring(1, singleIds.length() - 1).split(", "));
|
|
|
|
|
List<String> singleIdList = Arrays.asList(singleIds.substring(1, singleIds.length() - 1).split(","));
|
|
|
|
|
String multipleIds = theoryExam.getMultipleIds();
|
|
|
|
|
List<String> multipleIdList = Arrays.asList(multipleIds.substring(1, multipleIds.length() - 1).split(", "));
|
|
|
|
|
List<String> multipleIdList = Arrays.asList(multipleIds.substring(1, multipleIds.length() - 1).split(","));
|
|
|
|
|
String judgeIds = theoryExam.getJudgeIds();
|
|
|
|
|
List<String> judgeIdList = Arrays.asList(judgeIds.substring(1, judgeIds.length() - 1).split(", "));
|
|
|
|
|
List<String> judgeIdList = Arrays.asList(judgeIds.substring(1, judgeIds.length() - 1).split(","));
|
|
|
|
|
idsList.addAll(singleIdList);
|
|
|
|
|
idsList.addAll(multipleIdList);
|
|
|
|
|
idsList.addAll(judgeIdList);
|
|
|
|
|
ArrayList<String> answerList = new ArrayList<>();
|
|
|
|
|
List<String> singleStuAnswer =Arrays.asList(theoryExam.getSingleStuAnswer().substring(1, theoryExam.getSingleStuAnswer().length() - 1).split(", "));
|
|
|
|
|
List<String> multipleStuAnswer = Arrays.asList(theoryExam.getMultipleStuAnswer().substring(1, theoryExam.getMultipleStuAnswer().length() - 1).split(", "));
|
|
|
|
|
List<String> judgeStuAnswer = Arrays.asList(theoryExam.getJudgeStuAnswer().substring(1, theoryExam.getJudgeStuAnswer().length() - 1).split(", "));
|
|
|
|
|
List<String> singleStuAnswer =Arrays.asList(theoryExam.getSingleStuAnswer().substring(1, theoryExam.getSingleStuAnswer().length() - 1).split(","));
|
|
|
|
|
List<String> multipleStuAnswer = Arrays.asList(theoryExam.getMultipleStuAnswer().substring(1, theoryExam.getMultipleStuAnswer().length() - 1).split(","));
|
|
|
|
|
List<String> judgeStuAnswer = Arrays.asList(theoryExam.getJudgeStuAnswer().substring(1, theoryExam.getJudgeStuAnswer().length() - 1).split(","));
|
|
|
|
|
answerList.addAll(singleStuAnswer);
|
|
|
|
|
answerList.addAll(multipleStuAnswer);
|
|
|
|
|
answerList.addAll(judgeStuAnswer);
|
|
|
|
|