diff --git a/servers/boe-server-all/src/main/java/com/xboe/module/exam/api/ExamQuestionApi.java b/servers/boe-server-all/src/main/java/com/xboe/module/exam/api/ExamQuestionApi.java index e9eb6b59..fc6a2fb7 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/module/exam/api/ExamQuestionApi.java +++ b/servers/boe-server-all/src/main/java/com/xboe/module/exam/api/ExamQuestionApi.java @@ -312,14 +312,19 @@ public class ExamQuestionApi extends ApiBaseController { if(row1.getCell(1).getStringCellValue().equals("多选题")){ examQuestion.setType(2); } - if(row1.getCell(2).getStringCellValue().equals("中")){ - examQuestion.setDifficulty(2f); - }else if(row1.getCell(2).getStringCellValue().equals("难")){ - examQuestion.setDifficulty(3f); - } else if(row1.getCell(2).getStringCellValue().equals("易")){ - examQuestion.setDifficulty(1f); - }else if(row1.getCell(2).getStringCellValue().equals("")){ + + if (row1.getCell(2).getStringCellValue() == null || row1.getCell(2).getStringCellValue().equals("")){ examQuestion.setDifficulty(null); + }else{ + if( row1.getCell(2).getStringCellValue().equals("中")){ + examQuestion.setDifficulty(2f); + }else if(row1.getCell(2).getStringCellValue().equals("难")){ + examQuestion.setDifficulty(3f); + } else if(row1.getCell(2).getStringCellValue().equals("易")){ + examQuestion.setDifficulty(1f); + }else if(row1.getCell(2).getStringCellValue().equals("")){ + examQuestion.setDifficulty(null); + } } Cell cell = row1.getCell(3); cell.setCellType(CellType.STRING);