|
@@ -27,6 +27,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
import cn.com.qmth.examcloud.common.dto.question.PaperDto;
|
|
|
+import cn.com.qmth.examcloud.common.dto.question.QuestionDto;
|
|
|
import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
|
import cn.com.qmth.examcloud.common.util.ErrorMsg;
|
|
|
|
|
@@ -102,11 +103,11 @@ public class ExtractConfigController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "抽取试卷", notes = "抽取试卷")
|
|
|
+ @ApiOperation(value = "抽取考试试卷", notes = "抽取考试试卷")
|
|
|
@GetMapping(value = "/extract/{exam_id}/{course_code}/{group_code}")
|
|
|
public ResponseEntity extract(@PathVariable Long exam_id, @PathVariable String course_code,@PathVariable String group_code) {
|
|
|
try{
|
|
|
- Map<String, Object> returnMap = extractConfigService.extract(exam_id, course_code, group_code);
|
|
|
+ Map<String, Object> returnMap = extractConfigService.extractExamPaper(exam_id, course_code, group_code);
|
|
|
if(returnMap.get("errorMsg")==null){
|
|
|
PaperDto paperDto = (PaperDto) returnMap.get("paperDto");
|
|
|
return new ResponseEntity<PaperDto>(paperDto, HttpStatus.OK);
|
|
@@ -121,14 +122,16 @@ public class ExtractConfigController {
|
|
|
|
|
|
@ApiOperation(value = "抽取单个试题", notes = "抽取单个试题")
|
|
|
@GetMapping(value = "/extractQues/{paperDetailUnitId}")
|
|
|
- public ResponseEntity extractQuestion(@PathVariable String paperDetailUnitId) {
|
|
|
- Map<String, Object> quesMap = new HashMap<String, Object>();
|
|
|
- quesMap = extractConfigService.getQuestionById(paperDetailUnitId);
|
|
|
- if (quesMap.get("msg").equals("success")) {
|
|
|
- return new ResponseEntity(quesMap.get("quesDto"), HttpStatus.OK);
|
|
|
- } else {
|
|
|
- return new ResponseEntity(quesMap.get("msg"), HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
- }
|
|
|
+ public ResponseEntity<Object> extractQuestion(@PathVariable String paperDetailUnitId){
|
|
|
+ try{
|
|
|
+ QuestionDto questionDto = extractConfigService.extractExamQuestion(paperDetailUnitId);
|
|
|
+ return new ResponseEntity<Object>(questionDto,HttpStatus.OK);
|
|
|
+ }catch(Exception e){
|
|
|
+ logger.error("抽题失败",e);
|
|
|
+ e.printStackTrace();
|
|
|
+ return new ResponseEntity<Object>("抽题失败:"+e.getMessage(),HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "判断试卷中的题是否都为客观题(单选、多选、判断),包括套题中的小题",
|