|
@@ -1,5 +1,6 @@
|
|
|
package com.qmth.cqb.paper.service.export;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -7,6 +8,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.common.dto.question.enums.QuesStructType;
|
|
|
import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
|
|
|
|
import com.qmth.cqb.paper.dto.PaperDetailExp;
|
|
@@ -74,5 +76,29 @@ public class SxsfExportPaperService extends ExportPaperAbstractService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void setExpTitle(PaperDetailExp paperDetailExp) {
|
|
|
+ String title = "";
|
|
|
+ String totalScore = BigDecimal.valueOf(paperDetailExp.getScore()).stripTrailingZeros().toPlainString();
|
|
|
+ QuesStructType type = paperDetailExp.getPaperDetailUnits().get(0).getQuestionType();
|
|
|
+ String questionScore = checkPaperDetailUnitScore(paperDetailExp);
|
|
|
+ String scoreString = questionScore==null?"":"每小题"+questionScore+"分";
|
|
|
+ if (type == QuesStructType.SINGLE_ANSWER_QUESTION) {
|
|
|
+ paperDetailExp.setName("单项选择题");
|
|
|
+ title = "(本大题共" + paperDetailExp.getUnitCount() + "小题,"
|
|
|
+ + scoreString + "共" + totalScore + "分)。"
|
|
|
+ + "在每小题列出的四个备选中只有一个符合题目要求的,请将其选出并将“答题卡”的相应代码涂黑,错涂、多涂或未涂均无分";
|
|
|
+ } else if (type == QuesStructType.BOOL_ANSWER_QUESTION) {
|
|
|
+ paperDetailExp.setName("判断题");
|
|
|
+ title = "(本大题共" + paperDetailExp.getUnitCount() + "小题,"+ scoreString + "共" + totalScore+ "分。正确的填涂A、错误填涂B。错涂、多涂或未涂均无分)";
|
|
|
+ } else if (type == QuesStructType.FILL_BLANK_QUESTION) {
|
|
|
+ paperDetailExp.setName("填空题");
|
|
|
+ title = "(本大题共"+paperDetailExp.getUnitCount()+"小题,共"+totalScore + "分)";
|
|
|
+ } else {
|
|
|
+ title = "(本大题共"+paperDetailExp.getUnitCount()+"小题,"+scoreString+"共"+totalScore+"分)";
|
|
|
+ }
|
|
|
+ paperDetailExp.setTitle(title);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|