|
@@ -8,6 +8,7 @@ import com.qmth.cqb.paper.model.PaperSearchInfo;
|
|
import com.qmth.cqb.paper.service.PaperService;
|
|
import com.qmth.cqb.paper.service.PaperService;
|
|
import com.qmth.cqb.question.model.Question;
|
|
import com.qmth.cqb.question.model.Question;
|
|
|
|
|
|
|
|
+import cn.com.qmth.examcloud.common.dto.question.enums.QuesStructType;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
@@ -16,6 +17,7 @@ import java.util.Set;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Stream;
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
@@ -169,8 +171,7 @@ public class PaperController {
|
|
@PathVariable String courseCode,
|
|
@PathVariable String courseCode,
|
|
@PathVariable String groupCode,
|
|
@PathVariable String groupCode,
|
|
@PathVariable String paperId){
|
|
@PathVariable String paperId){
|
|
- paperService.joinToExamPaper(Long.parseLong(examId),
|
|
|
|
- courseCode, groupCode, paperId);
|
|
|
|
|
|
+ paperService.joinToExamPaper(Long.parseLong(examId),courseCode, groupCode, paperId);
|
|
return new ResponseEntity(HttpStatus.OK);
|
|
return new ResponseEntity(HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -189,8 +190,7 @@ public class PaperController {
|
|
@PathVariable String groupCode,
|
|
@PathVariable String groupCode,
|
|
@PathVariable String paperId){
|
|
@PathVariable String paperId){
|
|
|
|
|
|
- paperService.releaseExamPaper(Long.parseLong(examId),
|
|
|
|
- courseCode, groupCode, paperId);
|
|
|
|
|
|
+ paperService.releaseExamPaper(Long.parseLong(examId),courseCode, groupCode, paperId);
|
|
return new ResponseEntity(HttpStatus.OK);
|
|
return new ResponseEntity(HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -221,7 +221,7 @@ public class PaperController {
|
|
@PathVariable String courseCode,
|
|
@PathVariable String courseCode,
|
|
@PathVariable String groupCode){
|
|
@PathVariable String groupCode){
|
|
paperService.deletGroupCode(Long.parseLong(examId), courseCode, groupCode);
|
|
paperService.deletGroupCode(Long.parseLong(examId), courseCode, groupCode);
|
|
- return new ResponseEntity(HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity(HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -268,4 +268,42 @@ public class PaperController {
|
|
public ResponseEntity getPaperNamesByQuesId(@PathVariable String questionId){
|
|
public ResponseEntity getPaperNamesByQuesId(@PathVariable String questionId){
|
|
return new ResponseEntity(paperService.getPaperNamesByQuestionId(questionId),HttpStatus.OK);
|
|
return new ResponseEntity(paperService.getPaperNamesByQuestionId(questionId),HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据试题获取试卷名称
|
|
|
|
+ * @param
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value="查询用于选题的试题列表",notes="查询用于选题的试题列表")
|
|
|
|
+ @GetMapping(value = "/paper/listQuestion/{paperId}/{curPage}/{pageSize}")
|
|
|
|
+ public ResponseEntity listQuestionforSelect(@PathVariable String paperId,
|
|
|
|
+ @PathVariable int curPage,
|
|
|
|
+ @PathVariable int pageSize,
|
|
|
|
+ @RequestParam(name = "quesType") String quesType){
|
|
|
|
+ if(StringUtils.isNotEmpty(quesType)){
|
|
|
|
+ return new ResponseEntity(paperService.listQuestionforSelect(paperId,curPage,pageSize,QuesStructType.valueOf(quesType)),HttpStatus.OK);
|
|
|
|
+ } else {
|
|
|
|
+ return new ResponseEntity(paperService.listQuestionforSelect(paperId,curPage,pageSize,null),HttpStatus.OK);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ *
|
|
|
|
+ * 向试卷中某道大题插入多道试题(已存在的试题)
|
|
|
|
+ *
|
|
|
|
+ * @param paperId
|
|
|
|
+ * @param paperDetailId
|
|
|
|
+ * @param question
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "向导入试卷中的新增试题", notes = "向导入试卷中的新增试题")
|
|
|
|
+ @PostMapping(value = "/paper/selectQuestions/{paperId}/{paperDetailId}")
|
|
|
|
+ public ResponseEntity selectQuestionsToPaper(@PathVariable String paperId,
|
|
|
|
+ @PathVariable String paperDetailId,
|
|
|
|
+ @RequestBody List<Question> questions) {
|
|
|
|
+ return new ResponseEntity(paperService.selectQuestionsToPaper(paperId, paperDetailId, questions), HttpStatus.OK);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|