diff --git a/src/main/java/com/subsidy/controller/ExerciseDictController.java b/src/main/java/com/subsidy/controller/ExerciseDictController.java index bbf5b36..e79a973 100644 --- a/src/main/java/com/subsidy/controller/ExerciseDictController.java +++ b/src/main/java/com/subsidy/controller/ExerciseDictController.java @@ -16,10 +16,8 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.CachePut; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; /** *
@@ -74,4 +72,17 @@ public class ExerciseDictController {
return ResponseData.generateCreatedResponse(0,exerciseDictService.getPaperExercise(getPaperExerciseDTO));
}
+ @PostMapping("judge")
+ @ApiOperation("判断题 file ")
+ public ResponseVO judge(@RequestParam("file") MultipartFile file,Long paperId,Long courseId){
+ return ResponseData.generateCreatedResponse(0,exerciseDictService.judge(file,paperId,courseId));
+ }
+
+ @PostMapping("select")
+ @ApiOperation("选择题 file")
+ public ResponseVO select(@RequestParam("file") MultipartFile file,Long paperId,Long courseId){
+ return ResponseData.generateCreatedResponse(0,exerciseDictService.select(file,paperId,courseId));
+ }
+
+
}
diff --git a/src/main/java/com/subsidy/dto/exercise/JudgeDTO.java b/src/main/java/com/subsidy/dto/exercise/JudgeDTO.java
new file mode 100644
index 0000000..53c0d4b
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/exercise/JudgeDTO.java
@@ -0,0 +1,22 @@
+package com.subsidy.dto.exercise;
+
+import com.subsidy.util.excel.ExcelColumnUtil;
+import lombok.Data;
+
+@Data
+public class JudgeDTO {
+
+ @ExcelColumnUtil(value = "序号", col = 1)
+ private Integer id;
+
+ @ExcelColumnUtil(value = "题目", col = 2)
+ private String title;
+
+ @ExcelColumnUtil(value = "题目类型", col = 3)
+ private String exerciseType;
+
+ @ExcelColumnUtil(value = "答案(填“是”或者“否”)", col = 4)
+ private String answer;
+
+
+}
diff --git a/src/main/java/com/subsidy/dto/exercise/SelectDTO.java b/src/main/java/com/subsidy/dto/exercise/SelectDTO.java
new file mode 100644
index 0000000..df42473
--- /dev/null
+++ b/src/main/java/com/subsidy/dto/exercise/SelectDTO.java
@@ -0,0 +1,34 @@
+package com.subsidy.dto.exercise;
+
+import com.subsidy.util.excel.ExcelColumnUtil;
+import lombok.Data;
+
+@Data
+public class SelectDTO {
+
+ @ExcelColumnUtil(value = "序号", col = 1)
+ private Integer id;
+
+ @ExcelColumnUtil(value = "题目", col = 2)
+ private String title;
+
+ @ExcelColumnUtil(value = "题目类型", col = 3)
+ private String exerciseType;
+
+ @ExcelColumnUtil(value = "选项A", col = 4)
+ private String answerA;
+
+ @ExcelColumnUtil(value = "选项B", col = 5)
+ private String answerB;
+
+ @ExcelColumnUtil(value = "选项C", col = 6)
+ private String answerC;
+
+ @ExcelColumnUtil(value = "选项D", col = 7)
+ private String answerD;
+
+ @ExcelColumnUtil(value = "正确答案(多选的答案用英文逗号隔开)", col = 8)
+ private String rightAnswer;
+
+
+}
diff --git a/src/main/java/com/subsidy/model/RenshejuHistoryDO.java b/src/main/java/com/subsidy/model/RenshejuHistoryDO.java
index d6a1567..4b499c4 100644
--- a/src/main/java/com/subsidy/model/RenshejuHistoryDO.java
+++ b/src/main/java/com/subsidy/model/RenshejuHistoryDO.java
@@ -40,5 +40,9 @@ public class RenshejuHistoryDO extends BaseModel {
*/
private Object outputParam;
+ /**
+ * 备注
+ */
+ private String remarkNote;
}
diff --git a/src/main/java/com/subsidy/service/ExerciseDictService.java b/src/main/java/com/subsidy/service/ExerciseDictService.java
index 44a7f5f..b8e8368 100644
--- a/src/main/java/com/subsidy/service/ExerciseDictService.java
+++ b/src/main/java/com/subsidy/service/ExerciseDictService.java
@@ -8,6 +8,7 @@ import com.subsidy.model.CourseDictDO;
import com.subsidy.model.ExerciseDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.course.ExerciseVO;
+import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@@ -30,4 +31,8 @@ public interface ExerciseDictService extends IService "+s.getTitle()+" "+s.getTitle()+" ");
+ exerciseDictDO.setOrderNo(s.getId());
+ exerciseDictDO.setExerciseType(s.getExerciseType());
+ //选项
+ StringBuffer items = new StringBuffer();
+ items.append("[");
+ items.append("{\"label\":\" ").append(s.getAnswerA()).append(" ").append(s.getAnswerB()).append(" ").append(s.getAnswerC()).append(" ").append(s.getAnswerD()).append("