|
@@ -9,8 +9,10 @@ import cn.com.qmth.examcloud.core.oe.admin.api.request.GetPagedToBeMarkExamRecor
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.api.response.GetPagedToBeMarkExamRecordResp;
|
|
|
import cn.com.qmth.examcloud.exchange.outer.api.ExamQuestionOuterService;
|
|
|
import cn.com.qmth.examcloud.exchange.outer.api.bean.*;
|
|
|
+import cn.com.qmth.examcloud.exchange.outer.api.request.OuterGetQuestionAnswerReq;
|
|
|
import cn.com.qmth.examcloud.exchange.outer.api.request.OuterGetSubjectivePaperStructReq;
|
|
|
import cn.com.qmth.examcloud.exchange.outer.api.request.OuterGetSubjectiveQuestionReq;
|
|
|
+import cn.com.qmth.examcloud.exchange.outer.api.response.OuterGetQuestionAnswerResp;
|
|
|
import cn.com.qmth.examcloud.exchange.outer.api.response.OuterGetScoreQueueTopResp;
|
|
|
import cn.com.qmth.examcloud.exchange.outer.api.response.OuterGetSubjectivePaperStructResp;
|
|
|
import cn.com.qmth.examcloud.exchange.outer.api.response.OuterGetSubjectiveQuestionResp;
|
|
@@ -19,6 +21,8 @@ import cn.com.qmth.examcloud.exchange.outer.service.bean.OuterCourseBean;
|
|
|
import cn.com.qmth.examcloud.exchange.outer.service.bean.OuterQuestionBean;
|
|
|
import cn.com.qmth.examcloud.question.commons.core.question.AnswerType;
|
|
|
import cn.com.qmth.examcloud.question.commons.core.question.QuestionType;
|
|
|
+import cn.com.qmth.examcloud.support.cache.CacheHelper;
|
|
|
+import cn.com.qmth.examcloud.support.cache.bean.QuestionAnswerCacheBean;
|
|
|
import cn.com.qmth.examcloud.support.helper.ExamCacheTransferHelper;
|
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.web.support.StatusResponse;
|
|
@@ -67,7 +71,7 @@ public class ExamQuestionOuterServiceProvider extends ControllerSupport implemen
|
|
|
|
|
|
@Override
|
|
|
@ApiOperation(value = "获取主观题试卷结构", httpMethod = "POST")
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "成功", response = OuterGetScoreQueueTopResp.class),
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "成功", response = OuterGetSubjectivePaperStructResp.class),
|
|
|
@ApiResponse(code = 500, message = "系统异常(异常信息见响应体)", response = StatusResponse.class)})
|
|
|
@PostMapping("/getSubjectivePaperStruct")
|
|
|
public OuterGetSubjectivePaperStructResp getSubjectivePaperStruct(@RequestBody OuterGetSubjectivePaperStructReq req) {
|
|
@@ -118,7 +122,7 @@ public class ExamQuestionOuterServiceProvider extends ControllerSupport implemen
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取主观题作答结果", httpMethod = "POST")
|
|
|
- @ApiResponses({@ApiResponse(code = 200, message = "成功", response = OuterGetScoreQueueTopResp.class),
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "成功", response = OuterGetSubjectiveQuestionResp.class),
|
|
|
@ApiResponse(code = 500, message = "系统异常(异常信息见响应体)", response = StatusResponse.class)})
|
|
|
@PostMapping("/getSubjectiveQuestion")
|
|
|
@Override
|
|
@@ -161,6 +165,25 @@ public class ExamQuestionOuterServiceProvider extends ControllerSupport implemen
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "获取题目答案", httpMethod = "POST")
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "成功", response = OuterGetQuestionAnswerResp.class),
|
|
|
+ @ApiResponse(code = 500, message = "系统异常(异常信息见响应体)", response = StatusResponse.class)})
|
|
|
+ @PostMapping("/getQuestionAnswer")
|
|
|
+ @Override
|
|
|
+ public OuterGetQuestionAnswerResp getQuestionAnswer(@RequestBody OuterGetQuestionAnswerReq req) {
|
|
|
+ if (StringUtils.isNullOrEmpty(req.getQuestionId())) {
|
|
|
+ throw new StatusException("102001","题目id不允许为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ QuestionAnswerCacheBean questionAnswer = CacheHelper.getQuestionAnswer(req.getQuestionId());
|
|
|
+
|
|
|
+ OuterGetQuestionAnswerResp resp = new OuterGetQuestionAnswerResp();
|
|
|
+ resp.setAnswerList(questionAnswer.getRightAnswers());
|
|
|
+
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 构造满足条件的考试记录集合
|
|
|
*
|
|
@@ -567,4 +590,5 @@ public class ExamQuestionOuterServiceProvider extends ControllerSupport implemen
|
|
|
String regExp = "^(ftp|https?)\\:\\/\\/([\\w\\_\\-]+)\\.([\\w\\-]+[\\.]?)*[\\w]+\\.[a-zA-Z]{2,10}(.*)\\.(mp3)";
|
|
|
return studentAnswer.matches(regExp);
|
|
|
}
|
|
|
+
|
|
|
}
|