|
@@ -13,6 +13,8 @@ import cn.com.qmth.examcloud.support.handler.QuestionBodyHandler;
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
@@ -33,6 +35,8 @@ import java.util.Set;
|
|
@RequestMapping("${api_cqb}/default_question")
|
|
@RequestMapping("${api_cqb}/default_question")
|
|
public class DefaultQuesionController extends ControllerSupport {
|
|
public class DefaultQuesionController extends ControllerSupport {
|
|
|
|
|
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(DefaultQuesionController.class);
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private QuestionProviderService questionProviderService;
|
|
private QuestionProviderService questionProviderService;
|
|
|
|
|
|
@@ -80,7 +84,8 @@ public class DefaultQuesionController extends ControllerSupport {
|
|
if (rootOrgId == null) {
|
|
if (rootOrgId == null) {
|
|
throw new StatusException("Q-011079", "rootOrgId is null");
|
|
throw new StatusException("Q-011079", "rootOrgId is null");
|
|
}
|
|
}
|
|
- Page<DefaultQuestion> defaultQuestions = questionProviderService.findQustions(rootOrgId, req.getProperties(), req.getCurPage(), req.getPageSize());
|
|
|
|
|
|
+ Page<DefaultQuestion> defaultQuestions = questionProviderService.findQustions(rootOrgId, req.getProperties(),
|
|
|
|
+ req.getCurPage(), req.getPageSize());
|
|
return new ResponseEntity<>(defaultQuestions, HttpStatus.OK);
|
|
return new ResponseEntity<>(defaultQuestions, HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -114,7 +119,9 @@ public class DefaultQuesionController extends ControllerSupport {
|
|
if (StringUtils.isBlank(questionId)) {
|
|
if (StringUtils.isBlank(questionId)) {
|
|
throw new StatusException("Q-010090", "questionId is null");
|
|
throw new StatusException("Q-010090", "questionId is null");
|
|
}
|
|
}
|
|
- DefaultQuestion defaultQuestion = extractConfigExamService.getDefaultQuestion(examId, courseCode, groupCode, questionId);
|
|
|
|
|
|
+
|
|
|
|
+ DefaultQuestion defaultQuestion = extractConfigExamService.getDefaultQuestion(examId, courseCode, groupCode,
|
|
|
|
+ questionId, "webClient");
|
|
return new ResponseEntity<>(defaultQuestion, HttpStatus.OK);
|
|
return new ResponseEntity<>(defaultQuestion, HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -138,7 +145,9 @@ public class DefaultQuesionController extends ControllerSupport {
|
|
if (StringUtils.isBlank(questionId)) {
|
|
if (StringUtils.isBlank(questionId)) {
|
|
throw new StatusException("Q-010090", "questionId is null");
|
|
throw new StatusException("Q-010090", "questionId is null");
|
|
}
|
|
}
|
|
- DefaultQuestion defaultQuestion = extractConfigExamService.getDefaultQuestion(examId, courseCode, groupCode, questionId);
|
|
|
|
|
|
+
|
|
|
|
+ DefaultQuestion defaultQuestion = extractConfigExamService.getDefaultQuestion(examId, courseCode, groupCode,
|
|
|
|
+ questionId, "pcClient");
|
|
|
|
|
|
// 将题干、选项等 HTML结构转换为“富文本”JSON结构
|
|
// 将题干、选项等 HTML结构转换为“富文本”JSON结构
|
|
QuestionBodyHandler.convertRichText(defaultQuestion);
|
|
QuestionBodyHandler.convertRichText(defaultQuestion);
|