|
@@ -90,13 +90,43 @@ public class SydxExportPaperService extends ExportPaperAbstractService{
|
|
|
DocxProcessUtil.processDownload(fileNames, response);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void uploadFile(ExtractConfig extractConfig,String paperId,ExportStructure exportStructure,AccessUser accessUser) throws Exception{
|
|
|
+ PaperExp exportPaperExp = initExportSydxPaper(paperId);
|
|
|
+ PaperExp exportPaperStructureExp = initExportPaper(paperId);
|
|
|
+ if (exportPaperExp!=null&&exportPaperStructureExp!=null) {
|
|
|
+ String currNum = CommonUtils.getCurNum();
|
|
|
+ List<PaperDetailExp> objectiveDetails = exportPaperStructureExp.getObjectiveDetails();
|
|
|
+ //没有试卷结构导出设置
|
|
|
+ if(exportStructure==null){
|
|
|
+ //上传试卷
|
|
|
+ uploadPaperOrAnswerFile(exportPaperExp,extractConfig,accessUser,currNum,SYDX_TEMPLATE_PAPER,ExamFileType.PAPER);
|
|
|
+ //上传答案----石油大学无答案模板
|
|
|
+ //uploadAnswerWord(paperExp,extractConfig,paperId,accessUser,currNum);
|
|
|
+ }else if(exportStructure!=null&&exportStructure.getExportType()==ExportType.NORMAL){
|
|
|
+ List<QuestionTypeNum> questionTypeNums = exportStructure.getQuestionTypeNums();
|
|
|
+ //检查试卷中客观题的数量是否大于试卷导出设置中的设置的数量
|
|
|
+ checkObjectiveDetailsNum(exportPaperStructureExp,objectiveDetails,questionTypeNums);
|
|
|
+ //上传试卷
|
|
|
+ uploadPaperOrAnswerFile(exportPaperExp,extractConfig,accessUser,currNum,SYDX_TEMPLATE_PAPER,ExamFileType.PAPER);
|
|
|
+ //上传答案----石油大学无答案模板
|
|
|
+ //uploadAnswerWord(paperExp,extractConfig,paperId,accessUser,currNum);
|
|
|
+ //上传试卷结构 不能在上传试卷和答案之前
|
|
|
+ uploadPaperStructure(exportPaperStructureExp,extractConfig,accessUser,currNum,questionTypeNums);
|
|
|
+ }else if(exportStructure!=null&&exportStructure.getExportType()==ExportType.ONLINE){
|
|
|
+ //上传机考JSON文件
|
|
|
+ uploadComputerTestFile(extractConfig,accessUser);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 初始化导出石油大学试卷DTO
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
- public PaperExp initExportSydxPaper(String id) throws Exception{
|
|
|
+ private PaperExp initExportSydxPaper(String id) throws Exception{
|
|
|
//获取paper
|
|
|
Paper paper = paperRepo.findOne(id);
|
|
|
paperService.formatPaper(paper,null);
|
|
@@ -318,34 +348,4 @@ public class SydxExportPaperService extends ExportPaperAbstractService{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void uploadFile(ExtractConfig extractConfig,String paperId,ExportStructure exportStructure,AccessUser accessUser) throws Exception{
|
|
|
- PaperExp exportPaperExp = initExportSydxPaper(paperId);
|
|
|
- PaperExp exportPaperStructureExp = initExportPaper(paperId);
|
|
|
- if (exportPaperExp!=null&&exportPaperStructureExp!=null) {
|
|
|
- String currNum = CommonUtils.getCurNum();
|
|
|
- List<PaperDetailExp> objectiveDetails = exportPaperStructureExp.getObjectiveDetails();
|
|
|
- //没有试卷结构导出设置
|
|
|
- if(exportStructure==null){
|
|
|
- //上传试卷
|
|
|
- uploadPaperOrAnswerFile(exportPaperExp,extractConfig,accessUser,currNum,SYDX_TEMPLATE_PAPER,ExamFileType.PAPER);
|
|
|
- //上传答案----石油大学无答案模板
|
|
|
- //uploadAnswerWord(paperExp,extractConfig,paperId,accessUser,currNum);
|
|
|
- }else if(exportStructure!=null&&exportStructure.getExportType()==ExportType.NORMAL){
|
|
|
- List<QuestionTypeNum> questionTypeNums = exportStructure.getQuestionTypeNums();
|
|
|
- //检查试卷中客观题的数量是否大于试卷导出设置中的设置的数量
|
|
|
- checkObjectiveDetailsNum(exportPaperStructureExp,objectiveDetails,questionTypeNums);
|
|
|
- //上传试卷
|
|
|
- uploadPaperOrAnswerFile(exportPaperExp,extractConfig,accessUser,currNum,SYDX_TEMPLATE_PAPER,ExamFileType.PAPER);
|
|
|
- //上传答案----石油大学无答案模板
|
|
|
- //uploadAnswerWord(paperExp,extractConfig,paperId,accessUser,currNum);
|
|
|
- //上传试卷结构 不能在上传试卷和答案之前
|
|
|
- uploadPaperStructure(exportPaperStructureExp,extractConfig,accessUser,currNum,questionTypeNums);
|
|
|
- }else if(exportStructure!=null&&exportStructure.getExportType()==ExportType.ONLINE){
|
|
|
- //上传机考JSON文件
|
|
|
- uploadComputerTestFile(extractConfig,accessUser);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
}
|