|
@@ -1036,10 +1036,10 @@ public abstract class ExportPaperAbstractService {
|
|
for(ComputerTestPaperDetail detail:details){
|
|
for(ComputerTestPaperDetail detail:details){
|
|
List<ComputerTestQuestion> questions = detail.getQuestions();
|
|
List<ComputerTestQuestion> questions = detail.getQuestions();
|
|
for(ComputerTestQuestion computerTestQuestion:questions){
|
|
for(ComputerTestQuestion computerTestQuestion:questions){
|
|
- getBodyAndOptionAudioFile(computerTestQuestion,computerTestQuestion.getBody(),jsonDirectoryPath,computerTestPaper,examId);
|
|
|
|
|
|
+ getBodyAndOptionAudioFile(computerTestQuestion,computerTestQuestion.getBody(),jsonDirectoryPath,computerTestPaper,examId,detail,null,1);
|
|
List<ComputerTestOption> options = computerTestQuestion.getOptions();
|
|
List<ComputerTestOption> options = computerTestQuestion.getOptions();
|
|
for(ComputerTestOption option:options){
|
|
for(ComputerTestOption option:options){
|
|
- getBodyAndOptionAudioFile(computerTestQuestion,option.getBody(),jsonDirectoryPath,computerTestPaper,examId);
|
|
|
|
|
|
+ getBodyAndOptionAudioFile(computerTestQuestion,option.getBody(),jsonDirectoryPath,computerTestPaper,examId,detail,option,2);
|
|
}
|
|
}
|
|
//子题音频处理
|
|
//子题音频处理
|
|
//List<ComputerTestQuestion> subQuestions = question.getSubQuestions();
|
|
//List<ComputerTestQuestion> subQuestions = question.getSubQuestions();
|
|
@@ -1051,8 +1051,13 @@ public abstract class ExportPaperAbstractService {
|
|
Sections bodySections,
|
|
Sections bodySections,
|
|
String jsonDirectoryPath,
|
|
String jsonDirectoryPath,
|
|
ComputerTestPaper computerTestPaper,
|
|
ComputerTestPaper computerTestPaper,
|
|
- String examId){
|
|
|
|
|
|
+ String examId,
|
|
|
|
+ ComputerTestPaperDetail detail,
|
|
|
|
+ ComputerTestOption option,
|
|
|
|
+ int number){
|
|
List<Section> sectionList = bodySections.getSections();
|
|
List<Section> sectionList = bodySections.getSections();
|
|
|
|
+ int bNum = 1;
|
|
|
|
+ int oNum = 1;
|
|
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){
|
|
@@ -1060,7 +1065,7 @@ public abstract class ExportPaperAbstractService {
|
|
computerTestPaper.setHasVideo(1);
|
|
computerTestPaper.setHasVideo(1);
|
|
PaperDetailUnit paperDetailUnit = paperDetailUnitRepo.findById(computerTestQuestion.getId());
|
|
PaperDetailUnit paperDetailUnit = paperDetailUnitRepo.findById(computerTestQuestion.getId());
|
|
QuestionAudio audio = questionAudioService.findAudioById(block.getValue());
|
|
QuestionAudio audio = questionAudioService.findAudioById(block.getValue());
|
|
- block.setValue(block.getValue()+"."+audio.getFileSuffixes());
|
|
|
|
|
|
+ //block.setValue(block.getValue()+"."+audio.getFileSuffixes());
|
|
if(audio!=null){
|
|
if(audio!=null){
|
|
AudioTimeConfig audioTime = new AudioTimeConfig();
|
|
AudioTimeConfig audioTime = new AudioTimeConfig();
|
|
audioTime.setCourseCode(computerTestPaper.getCourseCode());
|
|
audioTime.setCourseCode(computerTestPaper.getCourseCode());
|
|
@@ -1069,9 +1074,25 @@ public abstract class ExportPaperAbstractService {
|
|
audioTime.setPaperDetailUnit(paperDetailUnit);
|
|
audioTime.setPaperDetailUnit(paperDetailUnit);
|
|
AudioTimeConfig audioTimeConfig = audioTimeConfigRepo.findOne(Example.of(audioTime));
|
|
AudioTimeConfig audioTimeConfig = audioTimeConfigRepo.findOne(Example.of(audioTime));
|
|
if(audioTimeConfig!=null){
|
|
if(audioTimeConfig!=null){
|
|
- block.setPlayTime(audioTimeConfig.getPlayTime());
|
|
|
|
|
|
+ if(audioTimeConfig.getPlayTime() == null){
|
|
|
|
+ block.setPlayTime(-1);
|
|
|
|
+ }else {
|
|
|
|
+ block.setPlayTime(audioTimeConfig.getPlayTime());
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ block.setPlayTime(-1);
|
|
|
|
+ }
|
|
|
|
+ String audioFileName = "";
|
|
|
|
+ if(number == 1){
|
|
|
|
+ audioFileName = audio.getId() + "_" + detail.getNumber() + "_" + computerTestQuestion.getNumber()
|
|
|
|
+ + "_1_" + bNum + "." + audio.getFileSuffixes();
|
|
|
|
+ bNum++;
|
|
|
|
+ }else {
|
|
|
|
+ audioFileName = audio.getId() + "_" + detail.getNumber() + "_" + computerTestQuestion.getNumber()
|
|
|
|
+ + "_2_" + option.getNumber() + oNum + "." + audio.getFileSuffixes();
|
|
|
|
+ oNum++;
|
|
}
|
|
}
|
|
- FileDisposeUtil.saveUrlAs(downloadUrl+audio.getFileUrl(),jsonDirectoryPath+File.separator+block.getValue());
|
|
|
|
|
|
+ FileDisposeUtil.saveUrlAs(downloadUrl+audio.getFileUrl(),jsonDirectoryPath+File.separator+audioFileName);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|