|
@@ -688,16 +688,18 @@ public abstract class ExportPaperAbstractService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void getBodyAndOptionAudioFile(ComputerTestQuestion question,Sections bodySections,String jsonDirectoryPath){
|
|
|
|
|
|
+ private void getBodyAndOptionAudioFile(ComputerTestQuestion computerTestQuestion,Sections bodySections,String jsonDirectoryPath){
|
|
List<Section> sectionList = bodySections.getSections();
|
|
List<Section> sectionList = bodySections.getSections();
|
|
for(Section section:sectionList){
|
|
for(Section section:sectionList){
|
|
List<Block> blocks = section.getBlocks();
|
|
List<Block> blocks = section.getBlocks();
|
|
for(Block block:blocks){
|
|
for(Block block:blocks){
|
|
if("audio".equals(block.getType())){
|
|
if("audio".equals(block.getType())){
|
|
- PaperDetailUnit paperDetailUnit = paperDetailUnitRepo.findById(question.getId());
|
|
|
|
|
|
+ PaperDetailUnit paperDetailUnit = paperDetailUnitRepo.findById(computerTestQuestion.getId());
|
|
QuestionAudio audio = questionAudioService.findByQuestionIdAndFileName(paperDetailUnit.getQuestion().getId(),block.getValue());
|
|
QuestionAudio audio = questionAudioService.findByQuestionIdAndFileName(paperDetailUnit.getQuestion().getId(),block.getValue());
|
|
if(audio!=null){
|
|
if(audio!=null){
|
|
FileDisposeUtil.saveUrlAs(downloadUrl+audio.getFileUrl(),jsonDirectoryPath+File.separator+block.getValue());
|
|
FileDisposeUtil.saveUrlAs(downloadUrl+audio.getFileUrl(),jsonDirectoryPath+File.separator+block.getValue());
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -714,11 +716,12 @@ public abstract class ExportPaperAbstractService {
|
|
List<ComputerTestPaper> computerTestPapers = new ArrayList<ComputerTestPaper>();
|
|
List<ComputerTestPaper> computerTestPapers = new ArrayList<ComputerTestPaper>();
|
|
//循环得到试卷
|
|
//循环得到试卷
|
|
for(ExamPaper examPaper:examPapers){
|
|
for(ExamPaper examPaper:examPapers){
|
|
|
|
+
|
|
Paper paper = examPaper.getPaper();
|
|
Paper paper = examPaper.getPaper();
|
|
//得到所有旧对象的大题对象
|
|
//得到所有旧对象的大题对象
|
|
List<PaperDetail> paperDetails = paperService.findPaperDetailsById(paper.getId());
|
|
List<PaperDetail> paperDetails = paperService.findPaperDetailsById(paper.getId());
|
|
//通过 paper 对象 ,生成新的 ComputerTestPaper 对象
|
|
//通过 paper 对象 ,生成新的 ComputerTestPaper 对象
|
|
- ComputerTestPaper computerTestPaper = new ComputerTestPaper(paper);
|
|
|
|
|
|
+ ComputerTestPaper computerTestPaper = new ComputerTestPaper(paper,examPaper.getGroupCode());
|
|
List<ComputerTestPaperDetail> details = new ArrayList<ComputerTestPaperDetail>();
|
|
List<ComputerTestPaperDetail> details = new ArrayList<ComputerTestPaperDetail>();
|
|
//遍历所有旧大题对象,得到小题对象的集合
|
|
//遍历所有旧大题对象,得到小题对象的集合
|
|
for(PaperDetail paperDetail:paperDetails){
|
|
for(PaperDetail paperDetail:paperDetails){
|