fuliqi
2024-05-31 21a9aa320b3eeb072bcd7d3fa883587d57b6ccbb
src/main/java/com/ycl/jxkg/service/impl/ExamPaperQuestionCustomerAnswerServiceImpl.java
@@ -1,5 +1,6 @@
package com.ycl.jxkg.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.jxkg.domain.ExamPaperQuestionCustomerAnswer;
import com.ycl.jxkg.domain.other.ExamPaperAnswerUpdate;
import com.ycl.jxkg.domain.other.KeyValue;
@@ -15,6 +16,7 @@
import com.ycl.jxkg.vo.student.question.answer.QuestionPageStudentRequestVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -23,17 +25,11 @@
import java.util.stream.Collectors;
@Service
public class ExamPaperQuestionCustomerAnswerServiceImpl extends BaseServiceImpl<ExamPaperQuestionCustomerAnswer> implements ExamPaperQuestionCustomerAnswerService {
@RequiredArgsConstructor
public class ExamPaperQuestionCustomerAnswerServiceImpl extends ServiceImpl<ExamPaperQuestionCustomerAnswerMapper, ExamPaperQuestionCustomerAnswer> implements ExamPaperQuestionCustomerAnswerService {
    private final ExamPaperQuestionCustomerAnswerMapper examPaperQuestionCustomerAnswerMapper;
    private final TextContentService textContentService;
    @Autowired
    public ExamPaperQuestionCustomerAnswerServiceImpl(ExamPaperQuestionCustomerAnswerMapper examPaperQuestionCustomerAnswerMapper, TextContentService textContentService) {
        super(examPaperQuestionCustomerAnswerMapper);
        this.examPaperQuestionCustomerAnswerMapper = examPaperQuestionCustomerAnswerMapper;
        this.textContentService = textContentService;
    }
    @Override
@@ -97,13 +93,13 @@
                examPaperSubmitItemVO.setContentArray(ExamUtil.contentToArray(examPaperQuestionCustomerAnswer.getAnswer()));
                break;
            case GapFilling:
                TextContent textContent = textContentService.selectById(examPaperQuestionCustomerAnswer.getTextContentId());
                TextContent textContent = textContentService.getById(examPaperQuestionCustomerAnswer.getTextContentId());
                List<String> correctAnswer = JsonUtil.toJsonListObject(textContent.getContent(), String.class);
                examPaperSubmitItemVO.setContentArray(correctAnswer);
                break;
            default:
                if (QuestionTypeEnum.needSaveTextContent(examPaperQuestionCustomerAnswer.getQuestionType())) {
                    TextContent content = textContentService.selectById(examPaperQuestionCustomerAnswer.getTextContentId());
                    TextContent content = textContentService.getById(examPaperQuestionCustomerAnswer.getTextContentId());
                    examPaperSubmitItemVO.setContent(content.getContent());
                } else {
                    examPaperSubmitItemVO.setContent(examPaperQuestionCustomerAnswer.getAnswer());