Browse Source

阅卷端接口修改2

weiwenhai 7 năm trước cách đây
mục cha
commit
332a965afb

+ 8 - 4
cqb-paper/src/main/java/com/qmth/cqb/paper/service/impl/ExtractConfigServiceImpl.java

@@ -971,6 +971,8 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
 		Paper paper = paperRepo.findOne(paperId);
 		//2.定义html字符串
 		StringBuffer answerHtml = new StringBuffer("<p style=\"text-align:center;font-size:20px;font-weight:bold\">"+paper.getCourse().getName()+"("+paper.getCourse().getCode()+")"+"</p>");
+		//添加考试说明
+		answerHtml.append("<p>考试说明:</p>" + paper.getExamRemark());
 		//3.通过试卷获取考试端试卷结构
 		PaperDto paperDto = getPaperDtoByPaper(paper,paper.getId());
 		//4.获取试卷所有大题,并且循环
@@ -1003,7 +1005,9 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
 					answerHtml.append(answer);
 				}
 				//7.如果为套题
-				if(paperDetailUnitDto.getSubQuestions()!=null && paperDetailUnitDto.getSubQuestions().size()>0){
+				else if(paperDetailUnitDto.getSubQuestions()!=null && paperDetailUnitDto.getSubQuestions().size()>0){
+					//添加主题干
+					String BigBody = startWithP(paperDetailUnitDto.getQuesBody(),-1);
 					List<SubQuestionDto> subQuestionDtos = paperDetailUnitDto.getSubQuestions();
 					for(SubQuestionDto subQuestionDto:subQuestionDtos){
 						//如果子题为单选或者多选
@@ -1047,13 +1051,13 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
 			if(s.startsWith("<p>")){
 				s = s.replaceAll("<p>","<p style=\"margin-left:40px;\">").replaceFirst("<p style=\"margin-left:40px;\">", "<p style=\"margin-left:20px;\">" + "答案:");
 			}else{
-				s = "<p style=\"margin-left:20px;\">" +  "答案:" + s + "</p>";
+				s = "<p style=\"margin-left:20px;backgroud-color:red;\">" +  "答案:" + s + "</p>";
 			}
 		}else {
 			if(s.startsWith("<p>")){
-				s = s.replaceAll("<p>","<p style=\"margin-left:40px;\">").replaceFirst("<p style=\"margin-left:40px;\">", "<p style=\"margin-left:20px;\">" + number + ".");
+				s = s.replaceAll("<p>","<p style=\"margin-left:40px;\">").replaceFirst("<p style=\"margin-left:40px;\">", "<p style=\"margin-left:20px;\">" + CommonUtils.getOptionNum(number) + ".");
 			}else{
-				s = "<p style=\"margin-left:20px;\">" + number + "." + s + "</p>";
+				s = "<p style=\"margin-left:20px;\">" + CommonUtils.getOptionNum(number) + "." + s + "</p>";
 			}
 		}
 		return s;