From effb45c6d0b33b78ae213aaf1d64f81e9b1ae822 Mon Sep 17 00:00:00 2001 From: Wangxxz <980548574@qq.com> Date: Mon, 30 Sep 2024 11:51:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xboe/module/exam/api/ExamQuestionApi.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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);