|
|
@@ -38,6 +38,8 @@ import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import static vip.xiaonuo.exam.domain.enums.ExamPaperTypeEnum.Task;
|
|
|
+
|
|
|
@Service
|
|
|
public class ExamPaperAnswerServiceImpl extends BaseServiceImpl<ExamPaperAnswer> implements ExamPaperAnswerService {
|
|
|
|
|
|
@@ -74,7 +76,7 @@ public class ExamPaperAnswerServiceImpl extends BaseServiceImpl<ExamPaperAnswer>
|
|
|
ExamPaper examPaper = examPaperMapper.selectByPrimaryKey(examPaperSubmitVM.getId());
|
|
|
ExamPaperTypeEnum paperTypeEnum = ExamPaperTypeEnum.fromCode(examPaper.getPaperType());
|
|
|
//任务试卷只能做一次
|
|
|
- if (paperTypeEnum == ExamPaperTypeEnum.Task) {
|
|
|
+ if (paperTypeEnum == Task) {
|
|
|
ExamPaperAnswer examPaperAnswer = examPaperAnswerMapper.getByPidUid(examPaperSubmitVM.getId(), user.getId());
|
|
|
if (null != examPaperAnswer)
|
|
|
return null;
|
|
|
@@ -110,6 +112,15 @@ public class ExamPaperAnswerServiceImpl extends BaseServiceImpl<ExamPaperAnswer>
|
|
|
customerAnswers.setExamPaperAnswerId(examPaperAnswer.getId());
|
|
|
});
|
|
|
examPaperQuestionCustomerAnswerService.insertList(examPaperQuestionCustomerAnswers);
|
|
|
+ ExamPaperTypeEnum examPaperTypeEnum = ExamPaperTypeEnum.fromCode(examPaper.getPaperType());
|
|
|
+ if(Task.equals(examPaperTypeEnum)){
|
|
|
+ TaskExamCustomerAnswer taskExamCustomerAnswer = new TaskExamCustomerAnswer();
|
|
|
+ taskExamCustomerAnswer.setCreateUser(user.getId());
|
|
|
+ taskExamCustomerAnswer.setTaskExamId(examPaper.getTaskExamId());
|
|
|
+ taskExamCustomerAnswer.setCreateTime(now);
|
|
|
+ taskExamCustomerAnswer.setTextContentId(textContent.getId());
|
|
|
+ taskExamCustomerAnswerMapper.insertSelective(taskExamCustomerAnswer);
|
|
|
+ }
|
|
|
return examPaperAnswerInfo;
|
|
|
}
|
|
|
|