|
@@ -1,226 +1,226 @@
|
|
|
-package com.qmth.cqb.paper.web;
|
|
|
-
|
|
|
-
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.slf4j.Logger;
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.data.domain.Page;
|
|
|
-import org.springframework.http.HttpStatus;
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
-import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-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;
|
|
|
-
|
|
|
-import com.qmth.cqb.paper.dto.ExportPaperInfoModel;
|
|
|
-import com.qmth.cqb.paper.model.ExtractConfig;
|
|
|
-import com.qmth.cqb.paper.service.ExtractConfigFileService;
|
|
|
-import com.qmth.cqb.paper.service.ExtractConfigService;
|
|
|
-import com.qmth.cqb.utils.enums.ExportWay;
|
|
|
-
|
|
|
-
|
|
|
-/**
|
|
|
- *
|
|
|
- * @author chenken
|
|
|
- * @date 2017年4月14日 下午6:05:37
|
|
|
- * @company QMTH
|
|
|
- * @description 调卷规则控制器
|
|
|
- */
|
|
|
-@Controller
|
|
|
-@RequestMapping("${api_cqb}/")
|
|
|
-public class ExtractConfigController {
|
|
|
- private static final Logger logger = LoggerFactory.getLogger(ExtractConfigController.class);
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ExtractConfigService extractConfigService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ExtractConfigFileService extractConfigFileService;
|
|
|
-
|
|
|
- @ApiOperation(value = "根据考试ID和课程ID获取调卷规则", notes = "根据考试ID和课程ID获取调卷规则")
|
|
|
- @GetMapping(value = "/findPageExtractConfig/{currentPage}/{pageSize}")
|
|
|
- public ResponseEntity findPageExtractConfig(@PathVariable int currentPage,
|
|
|
- @PathVariable int pageSize,
|
|
|
- @RequestParam("examId") Long examId,
|
|
|
- @RequestParam("courseNo") String courseNo){
|
|
|
- try{
|
|
|
- Page<ExtractConfig> extractConfigPageList = extractConfigService.findPageExtractConfig(currentPage,pageSize,examId,courseNo);
|
|
|
- return new ResponseEntity<Page<ExtractConfig>>(extractConfigPageList,HttpStatus.OK);
|
|
|
- }catch(Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- return new ResponseEntity<Object>(new ErrorMsg(e.getMessage()),HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "根据考试ID和课程ID获取调卷规则", notes = "根据考试ID和课程ID获取调卷规则")
|
|
|
- @GetMapping(value = "/extractConfig/{examId}/{courseCode}")
|
|
|
- public ResponseEntity<ExtractConfig> findExtractConfig(@PathVariable Long examId,@PathVariable String courseCode){
|
|
|
- ExtractConfig condition = new ExtractConfig();
|
|
|
- condition.setExamId(examId);
|
|
|
- condition.setCourseCode(courseCode);
|
|
|
- ExtractConfig extractConfig = extractConfigService.findConfig(condition);
|
|
|
- return new ResponseEntity<ExtractConfig>(extractConfig,HttpStatus.OK);
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "根据ID获取调卷规则", notes = "根据ID获取调卷规则")
|
|
|
- @GetMapping(value = "/extractConfig/{id}")
|
|
|
- public ResponseEntity<ExtractConfig> findExtractConfigById(@PathVariable String id){
|
|
|
- ExtractConfig extractConfig = extractConfigService.findConfigById(id);
|
|
|
- return new ResponseEntity<ExtractConfig>(extractConfig,HttpStatus.OK);
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "保存调卷规则", notes = "保存调卷规则")
|
|
|
- @PutMapping(value = "/extractConfig/{isbuildFile}")
|
|
|
- public ResponseEntity<Object> saveExtractConfig(HttpServletRequest request,@PathVariable Integer isbuildFile,@RequestBody ExtractConfig extractConfig){
|
|
|
- try{
|
|
|
- AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
|
|
|
- extractConfig.setOrgId(accessUser.getRootOrgId()+"");
|
|
|
- extractConfig.setOrgName(accessUser.getRootOrgName());
|
|
|
- extractConfigFileService.saveExtractConfigAndBuildPaperFile(extractConfig,isbuildFile,accessUser);
|
|
|
- return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
- }catch(Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- return new ResponseEntity<Object>(new ErrorMsg(e.getMessage()),HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @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.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);
|
|
|
- }else{
|
|
|
- return new ResponseEntity<String>(returnMap.get("errorMsg")+"", HttpStatus.OK);
|
|
|
- }
|
|
|
- }catch(Exception e){
|
|
|
- logger.error("抽卷失败",e);
|
|
|
- return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "抽取单个试题", notes = "抽取单个试题")
|
|
|
- @GetMapping(value = "/extractQues/{examId}/{courseCode}/{groupCode}/{paperDetailUnitId}")
|
|
|
- public ResponseEntity<Object> extractQuestion(@PathVariable String examId,
|
|
|
- @PathVariable String courseCode,
|
|
|
- @PathVariable String groupCode,
|
|
|
- @PathVariable String paperDetailUnitId){
|
|
|
- try{
|
|
|
- QuestionDto questionDto = extractConfigService.extractExamQuestion(examId,courseCode,groupCode,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 = "判断试卷中的题是否都为客观题(单选、多选、判断),包括套题中的小题",
|
|
|
- notes = "判断试卷中的题是否都为客观题(单选、多选、判断),包括套题中的小题")
|
|
|
- @GetMapping(value = "/checkObjective/{paperId}")
|
|
|
- public ResponseEntity<Map<String, Object>> checkIsAllObjectiveQuestion(@PathVariable String paperId){
|
|
|
- Map<String, Object> quesMap = new HashMap<String, Object>();
|
|
|
- try{
|
|
|
- if(StringUtils.isBlank(paperId)){
|
|
|
- quesMap.put("message","paperId不能为空");
|
|
|
- return new ResponseEntity<Map<String, Object>>(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
- }
|
|
|
- boolean result = extractConfigService.checkIsAllQbjectiveQuestion(paperId);
|
|
|
- quesMap.put("result", result);
|
|
|
- quesMap.put("message", result?"全为客观题":"不全为客观题");
|
|
|
- return new ResponseEntity<Map<String, Object>>(quesMap, HttpStatus.OK);
|
|
|
- }catch(Exception e){
|
|
|
- logger.error("调用checkIsAllQbjectiveQuestion失败",e);
|
|
|
- quesMap.put("result","error");
|
|
|
- quesMap.put("message","调用失败");
|
|
|
- return new ResponseEntity<Map<String, Object>>(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "导出单张考试试卷、答案、试卷结构", notes = "导出单张考试试卷、答案、试卷结构")
|
|
|
- @GetMapping(value = "/exportSingleExamPaperInfo/{exportWay}/{examId}/{courseId}/{exportContentList}")
|
|
|
- public void exportSingleExamPaperInfo(HttpServletResponse response,
|
|
|
- @PathVariable String exportWay,
|
|
|
- @PathVariable String examId,
|
|
|
- @PathVariable String courseId,
|
|
|
- @PathVariable String exportContentList){
|
|
|
- ExportPaperInfoModel exportModel = new ExportPaperInfoModel();
|
|
|
- exportModel.setExportWay(ExportWay.strToEnum(exportWay));
|
|
|
- exportModel.setExamId(examId);
|
|
|
- exportModel.setCourseId(courseId);
|
|
|
- String[] exportContentArray = exportContentList.split(",");
|
|
|
- List<String> list = new ArrayList<String>();
|
|
|
- for(int i = 0;i<exportContentArray.length;i++){
|
|
|
- list.add(exportContentArray[i]);
|
|
|
- }
|
|
|
- exportModel.setExportContentList(list);
|
|
|
- try {
|
|
|
- extractConfigFileService.exportExamPaperInfo(exportModel,response);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "导出试卷文件前校验", notes = "导出试卷文件前校验")
|
|
|
- @GetMapping(value = "/exportBatchExamPaperInfoCheck/{exportWay}/{examId}")
|
|
|
- public ResponseEntity<String> exportExamPaperInfoCheck(HttpServletResponse response,
|
|
|
- @PathVariable String exportWay,
|
|
|
- @PathVariable String examId){
|
|
|
- ExportPaperInfoModel exportModel = new ExportPaperInfoModel();
|
|
|
- exportModel.setExportWay(ExportWay.strToEnum(exportWay));
|
|
|
- exportModel.setExamId(examId);
|
|
|
- try {
|
|
|
- extractConfigFileService.exportExamPaperInfoCheck(exportModel,response);
|
|
|
- return new ResponseEntity<String>(HttpStatus.OK);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- return new ResponseEntity<String>(e.getMessage(),HttpStatus.OK);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @ApiOperation(value = "导出整个考试下所有 课程的试卷、答案、试卷结构", notes = "导出整个考试下所有 课程的试卷、答案、试卷结构")
|
|
|
- @GetMapping(value = "/exportBatchExamPaperInfo/{exportWay}/{examId}/{exportContentList}")
|
|
|
- public void exportBatchExamPaperInfo(HttpServletResponse response,
|
|
|
- @PathVariable String exportWay,
|
|
|
- @PathVariable String examId,
|
|
|
- @PathVariable String exportContentList){
|
|
|
- ExportPaperInfoModel exportModel = new ExportPaperInfoModel();
|
|
|
- exportModel.setExportWay(ExportWay.strToEnum(exportWay));
|
|
|
- exportModel.setExamId(examId);
|
|
|
- String[] exportContentArray = exportContentList.split(",");
|
|
|
- List<String> list = new ArrayList<String>();
|
|
|
- for(int i = 0;i<exportContentArray.length;i++){
|
|
|
- list.add(exportContentArray[i]);
|
|
|
- }
|
|
|
- exportModel.setExportContentList(list);
|
|
|
- try {
|
|
|
- extractConfigFileService.exportExamPaperInfo(exportModel,response);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
+package com.qmth.cqb.paper.web;
|
|
|
+
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+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;
|
|
|
+
|
|
|
+import com.qmth.cqb.paper.dto.ExportPaperInfoModel;
|
|
|
+import com.qmth.cqb.paper.model.ExtractConfig;
|
|
|
+import com.qmth.cqb.paper.service.ExtractConfigFileService;
|
|
|
+import com.qmth.cqb.paper.service.ExtractConfigService;
|
|
|
+import com.qmth.cqb.utils.enums.ExportWay;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @author chenken
|
|
|
+ * @date 2017年4月14日 下午6:05:37
|
|
|
+ * @company QMTH
|
|
|
+ * @description 调卷规则控制器
|
|
|
+ */
|
|
|
+@Controller
|
|
|
+@RequestMapping("${api_cqb}/")
|
|
|
+public class ExtractConfigController {
|
|
|
+ private static final Logger logger = LoggerFactory.getLogger(ExtractConfigController.class);
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ExtractConfigService extractConfigService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ExtractConfigFileService extractConfigFileService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "根据考试ID和课程ID获取调卷规则", notes = "根据考试ID和课程ID获取调卷规则")
|
|
|
+ @GetMapping(value = "/findPageExtractConfig/{currentPage}/{pageSize}")
|
|
|
+ public ResponseEntity findPageExtractConfig(@PathVariable int currentPage,
|
|
|
+ @PathVariable int pageSize,
|
|
|
+ @RequestParam("examId") Long examId,
|
|
|
+ @RequestParam("courseNo") String courseNo){
|
|
|
+ try{
|
|
|
+ Page<ExtractConfig> extractConfigPageList = extractConfigService.findPageExtractConfig(currentPage,pageSize,examId,courseNo);
|
|
|
+ return new ResponseEntity<Page<ExtractConfig>>(extractConfigPageList,HttpStatus.OK);
|
|
|
+ }catch(Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return new ResponseEntity<Object>(new ErrorMsg(e.getMessage()),HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "根据考试ID和课程ID获取调卷规则", notes = "根据考试ID和课程ID获取调卷规则")
|
|
|
+ @GetMapping(value = "/extractConfig/{examId}/{courseCode}")
|
|
|
+ public ResponseEntity<ExtractConfig> findExtractConfig(@PathVariable Long examId,@PathVariable String courseCode){
|
|
|
+ ExtractConfig condition = new ExtractConfig();
|
|
|
+ condition.setExamId(examId);
|
|
|
+ condition.setCourseCode(courseCode);
|
|
|
+ ExtractConfig extractConfig = extractConfigService.findConfig(condition);
|
|
|
+ return new ResponseEntity<ExtractConfig>(extractConfig,HttpStatus.OK);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "根据ID获取调卷规则", notes = "根据ID获取调卷规则")
|
|
|
+ @GetMapping(value = "/extractConfig/{id}")
|
|
|
+ public ResponseEntity<ExtractConfig> findExtractConfigById(@PathVariable String id){
|
|
|
+ ExtractConfig extractConfig = extractConfigService.findConfigById(id);
|
|
|
+ return new ResponseEntity<ExtractConfig>(extractConfig,HttpStatus.OK);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "保存调卷规则", notes = "保存调卷规则")
|
|
|
+ @PutMapping(value = "/extractConfig/{isbuildFile}")
|
|
|
+ public ResponseEntity<Object> saveExtractConfig(HttpServletRequest request,@PathVariable Integer isbuildFile,@RequestBody ExtractConfig extractConfig){
|
|
|
+ try{
|
|
|
+ AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
|
|
|
+ extractConfig.setOrgId(accessUser.getRootOrgId()+"");
|
|
|
+ extractConfig.setOrgName(accessUser.getRootOrgName());
|
|
|
+ extractConfigFileService.saveExtractConfigAndBuildPaperFile(extractConfig,isbuildFile,accessUser);
|
|
|
+ return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
+ }catch(Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return new ResponseEntity<Object>(new ErrorMsg(e.getMessage()),HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @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.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);
|
|
|
+ }else{
|
|
|
+ return new ResponseEntity<String>(returnMap.get("errorMsg")+"", HttpStatus.OK);
|
|
|
+ }
|
|
|
+ }catch(Exception e){
|
|
|
+ logger.error("抽卷失败",e);
|
|
|
+ return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "抽取单个试题", notes = "抽取单个试题")
|
|
|
+ @GetMapping(value = "/extractQues/{examId}/{courseCode}/{groupCode}/{paperDetailUnitId}")
|
|
|
+ public ResponseEntity<Object> extractQuestion(@PathVariable String examId,
|
|
|
+ @PathVariable String courseCode,
|
|
|
+ @PathVariable String groupCode,
|
|
|
+ @PathVariable String paperDetailUnitId){
|
|
|
+ try{
|
|
|
+ QuestionDto questionDto = extractConfigService.extractExamQuestion(examId,courseCode,groupCode,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 = "判断试卷中的题是否都为客观题(单选、多选、判断),包括套题中的小题",
|
|
|
+ notes = "判断试卷中的题是否都为客观题(单选、多选、判断),包括套题中的小题")
|
|
|
+ @GetMapping(value = "/checkObjective/{paperId}")
|
|
|
+ public ResponseEntity<Map<String, Object>> checkIsAllObjectiveQuestion(@PathVariable String paperId){
|
|
|
+ Map<String, Object> quesMap = new HashMap<String, Object>();
|
|
|
+ try{
|
|
|
+ if(StringUtils.isBlank(paperId)){
|
|
|
+ quesMap.put("message","paperId不能为空");
|
|
|
+ return new ResponseEntity<Map<String, Object>>(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
+ }
|
|
|
+ boolean result = extractConfigService.checkIsAllQbjectiveQuestion(paperId);
|
|
|
+ quesMap.put("result", result);
|
|
|
+ quesMap.put("message", result?"全为客观题":"不全为客观题");
|
|
|
+ return new ResponseEntity<Map<String, Object>>(quesMap, HttpStatus.OK);
|
|
|
+ }catch(Exception e){
|
|
|
+ logger.error("调用checkIsAllQbjectiveQuestion失败",e);
|
|
|
+ quesMap.put("result","error");
|
|
|
+ quesMap.put("message","调用失败");
|
|
|
+ return new ResponseEntity<Map<String, Object>>(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "导出单张考试试卷、答案、试卷结构", notes = "导出单张考试试卷、答案、试卷结构")
|
|
|
+ @GetMapping(value = "/exportSingleExamPaperInfo/{exportWay}/{examId}/{courseId}/{exportContentList}")
|
|
|
+ public void exportSingleExamPaperInfo(HttpServletResponse response,
|
|
|
+ @PathVariable String exportWay,
|
|
|
+ @PathVariable String examId,
|
|
|
+ @PathVariable String courseId,
|
|
|
+ @PathVariable String exportContentList){
|
|
|
+ ExportPaperInfoModel exportModel = new ExportPaperInfoModel();
|
|
|
+ exportModel.setExportWay(ExportWay.strToEnum(exportWay));
|
|
|
+ exportModel.setExamId(examId);
|
|
|
+ exportModel.setCourseId(courseId);
|
|
|
+ String[] exportContentArray = exportContentList.split(",");
|
|
|
+ List<String> list = new ArrayList<String>();
|
|
|
+ for(int i = 0;i<exportContentArray.length;i++){
|
|
|
+ list.add(exportContentArray[i]);
|
|
|
+ }
|
|
|
+ exportModel.setExportContentList(list);
|
|
|
+ try {
|
|
|
+ extractConfigFileService.exportExamPaperInfo(exportModel,response);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "导出试卷文件前校验", notes = "导出试卷文件前校验")
|
|
|
+ @GetMapping(value = "/exportBatchExamPaperInfoCheck/{exportWay}/{examId}")
|
|
|
+ public ResponseEntity<Object> exportExamPaperInfoCheck(HttpServletResponse response,
|
|
|
+ @PathVariable String exportWay,
|
|
|
+ @PathVariable String examId){
|
|
|
+ ExportPaperInfoModel exportModel = new ExportPaperInfoModel();
|
|
|
+ exportModel.setExportWay(ExportWay.strToEnum(exportWay));
|
|
|
+ exportModel.setExamId(examId);
|
|
|
+ try {
|
|
|
+ extractConfigFileService.exportExamPaperInfoCheck(exportModel,response);
|
|
|
+ return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return new ResponseEntity<Object>(new ErrorMsg("导出失败"),HttpStatus.OK);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value = "导出整个考试下所有 课程的试卷、答案、试卷结构", notes = "导出整个考试下所有 课程的试卷、答案、试卷结构")
|
|
|
+ @GetMapping(value = "/exportBatchExamPaperInfo/{exportWay}/{examId}/{exportContentList}")
|
|
|
+ public void exportBatchExamPaperInfo(HttpServletResponse response,
|
|
|
+ @PathVariable String exportWay,
|
|
|
+ @PathVariable String examId,
|
|
|
+ @PathVariable String exportContentList){
|
|
|
+ ExportPaperInfoModel exportModel = new ExportPaperInfoModel();
|
|
|
+ exportModel.setExportWay(ExportWay.strToEnum(exportWay));
|
|
|
+ exportModel.setExamId(examId);
|
|
|
+ String[] exportContentArray = exportContentList.split(",");
|
|
|
+ List<String> list = new ArrayList<String>();
|
|
|
+ for(int i = 0;i<exportContentArray.length;i++){
|
|
|
+ list.add(exportContentArray[i]);
|
|
|
+ }
|
|
|
+ exportModel.setExportContentList(list);
|
|
|
+ try {
|
|
|
+ extractConfigFileService.exportExamPaperInfo(exportModel,response);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|