|
@@ -95,31 +95,29 @@ public class SxsfExportPaperService extends ExportPaperAbstractService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public void uploadFile(ExtractConfig extractConfig,String paperId,ExportStructure exportStructure,AccessUser accessUser) throws Exception{
|
|
|
PaperExp paperExp = initExportPaper(paperId);
|
|
|
if (paperExp!=null) {
|
|
|
String currNum = CommonUtils.getCurNum();
|
|
|
List<PaperDetailExp> objectiveDetails = paperExp.getObjectiveDetails();
|
|
|
- if(exportStructure==null||exportStructure.getExportType()==ExportType.NORMAL){
|
|
|
- List<QuestionTypeNum> questionTypeNums = new ArrayList<QuestionTypeNum>();
|
|
|
- if(exportStructure!=null){
|
|
|
- questionTypeNums = exportStructure.getQuestionTypeNums();
|
|
|
- }
|
|
|
- //检查客观题的数量是否大于试卷导出设置中的客观题数量
|
|
|
- if(questionTypeNums.size()>0){
|
|
|
- checkObjectiveDetailsNum(paperExp,objectiveDetails,questionTypeNums);
|
|
|
- }
|
|
|
+ //没有试卷结构导出设置
|
|
|
+ if(exportStructure==null){
|
|
|
+ //上传试卷
|
|
|
+ uploadPaperWord(paperExp,extractConfig,paperId,accessUser,currNum);
|
|
|
+ //上传答案
|
|
|
+ uploadAnswerWord(paperExp,extractConfig,paperId,accessUser,currNum);
|
|
|
+ }else if(exportStructure!=null&&exportStructure.getExportType()==ExportType.NORMAL){
|
|
|
+ List<QuestionTypeNum> questionTypeNums = exportStructure.getQuestionTypeNums();
|
|
|
+ //检查试卷中客观题的数量是否大于试卷导出设置中的设置的数量
|
|
|
+ checkObjectiveDetailsNum(paperExp,objectiveDetails,questionTypeNums);
|
|
|
//上传试卷
|
|
|
uploadPaperWord(paperExp,extractConfig,paperId,accessUser,currNum);
|
|
|
//上传答案
|
|
|
uploadAnswerWord(paperExp,extractConfig,paperId,accessUser,currNum);
|
|
|
- //上传试卷结构
|
|
|
- if(questionTypeNums.size()>0){
|
|
|
- uploadPaperStructure(paperExp,extractConfig,paperId,accessUser,currNum,questionTypeNums);
|
|
|
- }
|
|
|
- }else if(exportStructure.getExportType()==ExportType.ONLINE){
|
|
|
+ //上传试卷结构 不能在上传试卷和答案之前
|
|
|
+ uploadPaperStructure(paperExp,extractConfig,paperId,accessUser,currNum,questionTypeNums);
|
|
|
+ }else if(exportStructure!=null&&exportStructure.getExportType()==ExportType.ONLINE){
|
|
|
//上传机考JSON文件
|
|
|
uploadComputerTestFile(extractConfig,accessUser);
|
|
|
}
|