Forráskód Böngészése

修复套题小题分的bug

宋悦 7 éve
szülő
commit
8bc09acf2b

+ 33 - 23
cqb-paper/src/main/java/com/qmth/cqb/paper/service/export/ExportPaperAbstractService.java

@@ -234,23 +234,24 @@ public abstract class ExportPaperAbstractService {
 	
 	/**
 	 * 下载试卷
-	 * @param id
-	 * @param response
+	 * @param paperId
+	 * @param zipFileName
 	 * @throws Exception
 	 */
 	public abstract void downloadPaper(String paperId,String zipFileName)throws Exception;
 	/**
 	 * 下载答案
 	 * @param paperId
-	 * @param response
+	 * @param zipFileName
 	 * @throws Exception
 	 */
 	public abstract void downloadPaperAnswer(String paperId,String zipFileName)throws Exception;
 	/**
 	 * 上传试卷相关文件
-	 * @param orgName
-	 * @param examName
+	 * @param extractConfig
 	 * @param paperId
+	 * @param exportStructure
+	 * @param accessUser
 	 * @throws Exception
 	 */
     public abstract void uploadFile(ExtractConfig extractConfig,String paperId,ExportStructure exportStructure,AccessUser accessUser)  throws Exception;
@@ -424,7 +425,6 @@ public abstract class ExportPaperAbstractService {
     /**
 	 * 给小题选项进行排序
 	 * @param paperDetails
-	 * @param startIndxt
 	 * @throws Exception
 	 */
 	public void setUnitExpNumber(List<PaperDetailExp> paperDetails) throws Exception {
@@ -478,17 +478,17 @@ public abstract class ExportPaperAbstractService {
         List<Object> pList = body.getContent();
         int index = 0;
         for(Object pObj:pList){
-            if(index < pList.size()-1){
-                break;
+            if(index == pList.size()-1){
+				P p = (P) pObj;
+				List<Object> pContent = p.getContent();
+				R run = new R();
+				Text text = new Text();
+				text.setValue("("+scores+"分)");
+				run.getContent().add(text);
+				pContent.add(run);
+
             }
-            P p = (P) pObj;
-            List<Object> pContent = p.getContent();
-            R run = new R();
-            Text text = new Text();
-            text.setValue("("+scores+"分)");
-            run.getContent().add(text);
-            pContent.add(run);
-            index++;
+			index++;
         }
         StringBuffer pWordMl = new StringBuffer();
         for(Object pObj:pList){
@@ -654,8 +654,8 @@ public abstract class ExportPaperAbstractService {
    	
     /**
      * 创建机考文件,并打包上传至又拍云
-     * @param paperId
-     * @param currNum
+     * @param extractConfig
+     * @param accessUser
      * @throws IOException 
      */
     protected void uploadComputerTestFile(ExtractConfig extractConfig,AccessUser accessUser) throws IOException{
@@ -735,7 +735,11 @@ public abstract class ExportPaperAbstractService {
 		}
     }
     
-    private void getBodyAndOptionAudioFile(ComputerTestQuestion computerTestQuestion,Sections bodySections,String jsonDirectoryPath,ComputerTestPaper computerTestPaper,String examId){
+    private void getBodyAndOptionAudioFile(ComputerTestQuestion computerTestQuestion,
+										   Sections bodySections,
+										   String jsonDirectoryPath,
+										   ComputerTestPaper computerTestPaper,
+										   String examId){
     	List<Section> sectionList = bodySections.getSections();
 		for(Section section:sectionList){
 			List<Block> blocks = section.getBlocks();
@@ -764,13 +768,19 @@ public abstract class ExportPaperAbstractService {
     
 	/**
      * 生成试卷或答案Word,上传至又拍云
-     * @param orgName
-     * @param dataMap
+     * @param paperExp
      * @param extractConfig
-     * @param paperId
      * @param accessUser
+     * @param currNum
+     * @param template
+	 * @param examFileType
      */
-    protected void uploadPaperOrAnswerFile(PaperExp paperExp,ExtractConfig extractConfig,AccessUser accessUser,String currNum,Template template,ExamFileType examFileType){
+    protected void uploadPaperOrAnswerFile(PaperExp paperExp,
+										   ExtractConfig extractConfig,
+										   AccessUser accessUser,
+										   String currNum,
+										   Template template,
+										   ExamFileType examFileType){
     	String paperfileName = currNum+examFileType.name()+DOCX_SUFFIX;
     	try {
 			DocxProcessUtil.exportWord(paperExp,paperfileName,template);

+ 1 - 8
cqb-paper/src/main/java/com/qmth/cqb/paper/service/export/InitPaperExpService.java

@@ -257,14 +257,7 @@ public  class InitPaperExpService {
 			Double totalScore = 0.0;
 			//所有小题分数相加,得到大题分数
 			for(PaperDetailUnitExp paperDetailUnitExp:paperDetailUnitExps){
-				if(paperDetailUnitExp.getQuestionType() == QuesStructType.NESTED_ANSWER_QUESTION){
-					List<Question> subQuestions = paperDetailUnitExp.getQuestion().getSubQuestions();
-					for(Question question:subQuestions){
-						totalScore += question.getScore();
-					}
-				}else{
-					totalScore += paperDetailUnitExp.getScore();
-				}
+				totalScore += paperDetailUnitExp.getScore();
 			}
 			paperDetailExp.setScore(totalScore);
 		}