|
@@ -1,12 +1,14 @@
|
|
|
package cn.com.qmth.examcloud.core.oe.student.api.controller.client;
|
|
|
|
|
|
import cn.com.qmth.examcloud.api.commons.security.bean.User;
|
|
|
+import cn.com.qmth.examcloud.commons.util.JsonMapper;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.bean.*;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.service.*;
|
|
|
import cn.com.qmth.examcloud.support.Constants;
|
|
|
import cn.com.qmth.examcloud.support.examing.ExamQuestion;
|
|
|
import cn.com.qmth.examcloud.support.examing.ExamRecordPaperStruct;
|
|
|
import cn.com.qmth.examcloud.support.examing.ExamingSession;
|
|
|
+import cn.com.qmth.examcloud.support.handler.richtext2.RichTextConverter;
|
|
|
import cn.com.qmth.examcloud.web.redis.RedisClient;
|
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -97,7 +99,19 @@ public class ExamProcessController extends ControllerSupport {
|
|
|
@PostMapping("/findExamQuestionList")
|
|
|
public List<ExamQuestion> findExamQuestionList() {
|
|
|
User user = getAccessUser();
|
|
|
- return examRecordQuestionsService.findExamQuestionList(user.getUserId());
|
|
|
+ List<ExamQuestion> examQuestions = examRecordQuestionsService.findExamQuestionList(user.getUserId());
|
|
|
+
|
|
|
+ JsonMapper jsonMapper = JsonMapper.nonNullMapper();
|
|
|
+ for (ExamQuestion examQuestion : examQuestions) {
|
|
|
+ if (StringUtils.isBlank(examQuestion.getStudentAnswer())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 将考生作答内容的 HTML结构转换为“富文本”JSON结构
|
|
|
+ examQuestion.setStudentAnswer(jsonMapper.toJson(RichTextConverter.parse(examQuestion.getStudentAnswer())));
|
|
|
+ }
|
|
|
+
|
|
|
+ return examQuestions;
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "考试过程中-获取试题内容")
|