|
@@ -75,6 +75,7 @@ public class GenPaperService {
|
|
String msg = "";
|
|
String msg = "";
|
|
Map<String, Object> paperMsgMap = new HashMap<String, Object>();
|
|
Map<String, Object> paperMsgMap = new HashMap<String, Object>();
|
|
LinkedList<Question> questions = new LinkedList<Question>();
|
|
LinkedList<Question> questions = new LinkedList<Question>();
|
|
|
|
+ //查询试卷结构
|
|
PaperStruct paperStruct = paperStructRepo.findOne(genPaperDto.getPaperStructId());
|
|
PaperStruct paperStruct = paperStructRepo.findOne(genPaperDto.getPaperStructId());
|
|
PaperContext paperContext = new PaperContext(paperStruct, genPaperDto.getConditions());
|
|
PaperContext paperContext = new PaperContext(paperStruct, genPaperDto.getConditions());
|
|
List<UnitContext> unitContexts = new LinkedList<UnitContext>();
|
|
List<UnitContext> unitContexts = new LinkedList<UnitContext>();
|
|
@@ -87,10 +88,17 @@ public class GenPaperService {
|
|
List<PaperDetailUnit> unitList = unitRepo.findByPaperOrderByNumber(oldPaper);
|
|
List<PaperDetailUnit> unitList = unitRepo.findByPaperOrderByNumber(oldPaper);
|
|
for (PaperDetailUnit unit : unitList) {
|
|
for (PaperDetailUnit unit : unitList) {
|
|
Question question = unit.getQuestion();
|
|
Question question = unit.getQuestion();
|
|
- question.setQuesName(unit.getPaperDetail().getName());
|
|
|
|
|
|
+ //根据questionId查询题库中大题来源
|
|
|
|
+ List<PaperDetailUnit> units = unitRepo.findByQuestion(question);
|
|
|
|
+ for(PaperDetailUnit oldUnit:units){
|
|
|
|
+ Paper paper = oldUnit.getPaper();
|
|
|
|
+ if(paper.getPaperType() == PaperType.IMPORT){
|
|
|
|
+ question.setQuesName(oldUnit.getPaperDetail().getName());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
questions.add(question);
|
|
questions.add(question);
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
Collections.shuffle(questions);
|
|
Collections.shuffle(questions);
|
|
int maxLoopCount = questions.size() * 2;
|
|
int maxLoopCount = questions.size() * 2;
|