Merge remote-tracking branch 'java-servse-yx/zcwy0912-llf' into zcwy0912-llf

This commit is contained in:
zhaolongfei
2024-10-21 11:07:47 +08:00
2 changed files with 23 additions and 18 deletions

View File

@@ -354,7 +354,6 @@ public class AloneExamApi extends ApiBaseController {
if(StringUtils.isBlank(paperJson)) { if(StringUtils.isBlank(paperJson)) {
return badRequest("此考试无试卷内容,考试已经过期或试卷已被删除"); return badRequest("此考试无试卷内容,考试已经过期或试卷已被删除");
} }
}
try { try {
List<TestQuestionVo> qlist=this.randomQuestion(examTest, paperJson); List<TestQuestionVo> qlist=this.randomQuestion(examTest, paperJson);
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
@@ -366,6 +365,7 @@ public class AloneExamApi extends ApiBaseController {
log.error("生成试卷解析生成json错误",e); log.error("生成试卷解析生成json错误",e);
return error("生成考试试卷解析错误",e.getMessage(),map); return error("生成考试试卷解析错误",e.getMessage(),map);
} }
}
map.put("paper", paperJson); map.put("paper", paperJson);
long end=System.currentTimeMillis(); long end=System.currentTimeMillis();
log.info("开始考试用时="+(end-start)+" ms"); log.info("开始考试用时="+(end-start)+" ms");

View File

@@ -312,6 +312,10 @@ public class ExamQuestionApi extends ApiBaseController {
if(row1.getCell(1).getStringCellValue().equals("多选题")){ if(row1.getCell(1).getStringCellValue().equals("多选题")){
examQuestion.setType(2); examQuestion.setType(2);
} }
log.debug("row1.getCell(2) = " + row1.getCell(2));
if (row1.getCell(2)==null ||row1.getCell(2).getStringCellValue() == null || row1.getCell(2).getStringCellValue().equals("")){
examQuestion.setDifficulty(null);
}else{
if( row1.getCell(2).getStringCellValue().equals("")){ if( row1.getCell(2).getStringCellValue().equals("")){
examQuestion.setDifficulty(2f); examQuestion.setDifficulty(2f);
}else if(row1.getCell(2).getStringCellValue().equals("")){ }else if(row1.getCell(2).getStringCellValue().equals("")){
@@ -321,6 +325,7 @@ public class ExamQuestionApi extends ApiBaseController {
}else if(row1.getCell(2).getStringCellValue().equals("")){ }else if(row1.getCell(2).getStringCellValue().equals("")){
examQuestion.setDifficulty(null); examQuestion.setDifficulty(null);
} }
}
Cell cell = row1.getCell(3); Cell cell = row1.getCell(3);
cell.setCellType(CellType.STRING); cell.setCellType(CellType.STRING);