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