src/main/java/com/mindskip/xzs/controller/admin/ExamPaperController.java
@@ -13,6 +13,7 @@ import com.mindskip.xzs.utility.DateTimeUtil; import com.mindskip.xzs.utility.PageInfoHelper; import com.mindskip.xzs.utility.excel.ExcelUtils; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVO; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperPageRequestVM; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM; import com.mindskip.xzs.viewmodel.admin.exam.ExamResponseVM; @@ -77,7 +78,7 @@ @RequestMapping(value = "/edit", method = RequestMethod.POST) public RestResponse<ExamPaperEditRequestVM> edit(@RequestBody @Valid ExamPaperEditRequestVM model) throws Exception { public RestResponse<ExamPaperEditRequestVO> edit(@RequestBody @Valid ExamPaperEditRequestVM model) throws Exception { Object[] obj = Arrays.stream(model.getUserIds()).sorted().distinct().toArray(); Integer[] userIds = new Integer[obj.length]; for(int i = 0;i<obj.length;i++) { @@ -85,13 +86,13 @@ } model.setUserIds(userIds); ExamPaper examPaper = examPaperService.savePaperFromVM(model, getCurrentUser()); ExamPaperEditRequestVM newVM = examPaperService.examPaperToVM(examPaper.getId()); ExamPaperEditRequestVO newVM = examPaperService.examPaperToVM(examPaper.getId()); return RestResponse.ok(newVM); } @RequestMapping(value = "/select/{id}", method = RequestMethod.POST) public RestResponse<ExamPaperEditRequestVM> select(@PathVariable Integer id) { ExamPaperEditRequestVM vm = examPaperService.examPaperToVM(id); public RestResponse<ExamPaperEditRequestVO> select(@PathVariable Integer id) { ExamPaperEditRequestVO vm = examPaperService.examPaperToVM(id); return RestResponse.ok(vm); } src/main/java/com/mindskip/xzs/controller/admin/QuestionController.java
@@ -90,9 +90,8 @@ } @RequestMapping(value = "/select/{id}", method = RequestMethod.POST) public RestResponse<QuestionEditRequestVM> select(@PathVariable Integer id) { QuestionEditRequestVM newVM = questionService.getQuestionEditRequestVM(id); return RestResponse.ok(newVM); public RestResponse<ExamQuestionVO> select(@PathVariable Integer id) { return RestResponse.ok(questionService.getQuestionEditRequestVM(id)); } src/main/java/com/mindskip/xzs/controller/student/ExamPaperAnswerController.java
@@ -11,7 +11,9 @@ import com.mindskip.xzs.utility.ExamUtil; import com.mindskip.xzs.utility.PageInfoHelper; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVO; import com.mindskip.xzs.viewmodel.student.exam.ExamPaperReadVM; import com.mindskip.xzs.viewmodel.student.exam.ExamPaperReadVO; import com.mindskip.xzs.viewmodel.student.exam.ExamPaperSubmitVM; import com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageResponseVM; import com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageVM; @@ -123,10 +125,10 @@ } @RequestMapping(value = "/read/{id}", method = RequestMethod.POST) public RestResponse<ExamPaperReadVM> read(@PathVariable Integer id) { public RestResponse<ExamPaperReadVO> read(@PathVariable Integer id) { ExamPaperAnswer examPaperAnswer = examPaperAnswerService.selectById(id); ExamPaperReadVM vm = new ExamPaperReadVM(); ExamPaperEditRequestVM paper = examPaperService.examPaperToVM(examPaperAnswer.getExamPaperId()); ExamPaperReadVO vm = new ExamPaperReadVO(); ExamPaperEditRequestVO paper = examPaperService.examPaperToVM(examPaperAnswer.getExamPaperId()); ExamPaperSubmitVM answer = examPaperAnswerService.examPaperAnswerToVM(examPaperAnswer.getId()); vm.setPaper(paper); vm.setAnswer(answer); src/main/java/com/mindskip/xzs/controller/student/ExamPaperController.java
@@ -13,6 +13,7 @@ import com.mindskip.xzs.utility.DateTimeUtil; import com.mindskip.xzs.utility.PageInfoHelper; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVO; import com.mindskip.xzs.viewmodel.student.exam.ExamPaperPageResponseVM; import com.mindskip.xzs.viewmodel.student.exam.ExamPaperPageVM; import com.github.pagehelper.PageInfo; @@ -46,9 +47,8 @@ @RequestMapping(value = "/select/{id}", method = RequestMethod.POST) public RestResponse<ExamPaperEditRequestVM> select(@PathVariable Integer id) { ExamPaperEditRequestVM vm = examPaperService.examPaperToVM(id); return RestResponse.ok(vm); public RestResponse<ExamPaperEditRequestVO> select(@PathVariable Integer id) { return RestResponse.ok(examPaperService.examPaperToVM(id)); } @@ -85,7 +85,7 @@ } @RequestMapping(value = "/edit", method = RequestMethod.POST) public RestResponse<ExamPaperEditRequestVM> edit(@RequestBody @Valid ExamPaperEditRequestVM model) throws Exception { public RestResponse<ExamPaperEditRequestVO> edit(@RequestBody @Valid ExamPaperEditRequestVM model) throws Exception { ExamPaperUser examPaperUser = new ExamPaperUser(); User user = getCurrentUser(); model.setDepartmentIds(new Integer[0]); @@ -97,8 +97,6 @@ examPaperUser.setDeleted("0"); examPaperUserService.add(examPaperUser); ExamPaperEditRequestVM newVM = examPaperService.examPaperToVM(examPaper.getId()); return RestResponse.ok(newVM); return RestResponse.ok(examPaperService.examPaperToVM(examPaper.getId())); } } src/main/java/com/mindskip/xzs/controller/student/QuestionAnswerController.java
@@ -9,9 +9,11 @@ import com.mindskip.xzs.utility.HtmlUtil; import com.mindskip.xzs.utility.JsonUtil; import com.mindskip.xzs.utility.PageInfoHelper; import com.mindskip.xzs.viewmodel.admin.question.ExamQuestionVO; import com.mindskip.xzs.viewmodel.admin.question.QuestionEditRequestVM; import com.mindskip.xzs.viewmodel.student.exam.ExamPaperSubmitItemVM; import com.mindskip.xzs.viewmodel.student.question.answer.QuestionAnswerVM; import com.mindskip.xzs.viewmodel.student.question.answer.QuestionAnswerVO; import com.mindskip.xzs.viewmodel.student.question.answer.QuestionPageStudentRequestVM; import com.mindskip.xzs.viewmodel.student.question.answer.QuestionPageStudentResponseVM; import com.github.pagehelper.PageInfo; @@ -67,11 +69,11 @@ @RequestMapping(value = "/select/{id}", method = RequestMethod.POST) public RestResponse<QuestionAnswerVM> select(@PathVariable Integer id) { QuestionAnswerVM vm = new QuestionAnswerVM(); public RestResponse<QuestionAnswerVO> select(@PathVariable Integer id) { QuestionAnswerVO vm = new QuestionAnswerVO(); ExamPaperQuestionCustomerAnswer examPaperQuestionCustomerAnswer = examPaperQuestionCustomerAnswerService.selectById(id); ExamPaperSubmitItemVM questionAnswerVM = examPaperQuestionCustomerAnswerService.examPaperQuestionCustomerAnswerToVM(examPaperQuestionCustomerAnswer); QuestionEditRequestVM questionVM = questionService.getQuestionEditRequestVM(examPaperQuestionCustomerAnswer.getQuestionId()); ExamQuestionVO questionVM = questionService.getQuestionEditRequestVM(examPaperQuestionCustomerAnswer.getQuestionId()); vm.setQuestionVM(questionVM); vm.setQuestionAnswerVM(questionAnswerVM); return RestResponse.ok(vm); src/main/java/com/mindskip/xzs/controller/wx/student/ExamPaperAnswerController.java
@@ -13,6 +13,8 @@ import com.mindskip.xzs.utility.ExamUtil; import com.mindskip.xzs.utility.PageInfoHelper; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVO; import com.mindskip.xzs.viewmodel.student.exam.ExamPaperReadVO; import com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageResponseVM; import com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageVM; import com.github.pagehelper.PageInfo; @@ -123,10 +125,10 @@ @PostMapping(value = "/read/{id}") public RestResponse<ExamPaperReadVM> read(@PathVariable Integer id) { ExamPaperReadVM vm = new ExamPaperReadVM(); public RestResponse<ExamPaperReadVO> read(@PathVariable Integer id) { ExamPaperReadVO vm = new ExamPaperReadVO(); ExamPaperAnswer examPaperAnswer = examPaperAnswerService.selectById(id); ExamPaperEditRequestVM paper = examPaperService.examPaperToVM(examPaperAnswer.getExamPaperId()); ExamPaperEditRequestVO paper = examPaperService.examPaperToVM(examPaperAnswer.getExamPaperId()); ExamPaperSubmitVM answer = examPaperAnswerService.examPaperAnswerToVM(examPaperAnswer.getId()); vm.setPaper(paper); vm.setAnswer(answer); src/main/java/com/mindskip/xzs/controller/wx/student/ExamPaperController.java
@@ -9,6 +9,7 @@ import com.mindskip.xzs.utility.DateTimeUtil; import com.mindskip.xzs.utility.PageInfoHelper; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVO; import com.mindskip.xzs.viewmodel.student.exam.ExamPaperPageResponseVM; import com.mindskip.xzs.viewmodel.student.exam.ExamPaperPageVM; import com.github.pagehelper.PageInfo; @@ -35,9 +36,8 @@ @RequestMapping(value = "/select/{id}", method = RequestMethod.POST) public RestResponse<ExamPaperEditRequestVM> select(@PathVariable Integer id) { ExamPaperEditRequestVM vm = examPaperService.examPaperToVM(id); return RestResponse.ok(vm); public RestResponse<ExamPaperEditRequestVO> select(@PathVariable Integer id) { return RestResponse.ok(examPaperService.examPaperToVM(id)); } src/main/java/com/mindskip/xzs/domain/enums/QuestionTypeEnum.java
@@ -12,8 +12,8 @@ GapFilling(4, "填空题"), ShortAnswer(5, "简答题"); int code; String name; public final Integer code; public final String name; QuestionTypeEnum(int code, String name) { this.code = code; @@ -61,16 +61,8 @@ return code; } public void setCode(int code) { this.code = code; } public String getName() { return name; } public void setName(String name) { this.name = name; } src/main/java/com/mindskip/xzs/service/ExamPaperService.java
@@ -4,6 +4,7 @@ import com.mindskip.xzs.domain.User; import com.mindskip.xzs.domain.vo.PaperExcelVO; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVO; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperPageRequestVM; import com.mindskip.xzs.viewmodel.student.dashboard.PaperFilter; import com.mindskip.xzs.viewmodel.student.dashboard.PaperInfo; @@ -23,7 +24,7 @@ ExamPaper savePaperFromVM(ExamPaperEditRequestVM examPaperEditRequestVM, User user) throws Exception; ExamPaperEditRequestVM examPaperToVM(Integer id); ExamPaperEditRequestVO examPaperToVM(Integer id); List<PaperInfo> indexPaper(PaperFilter paperFilter); src/main/java/com/mindskip/xzs/service/QuestionService.java
@@ -1,6 +1,7 @@ package com.mindskip.xzs.service; import com.mindskip.xzs.domain.Question; import com.mindskip.xzs.viewmodel.admin.question.ExamQuestionVO; import com.mindskip.xzs.viewmodel.admin.question.QuestionEditRequestVM; import com.mindskip.xzs.viewmodel.admin.question.QuestionPageRequestVM; import com.github.pagehelper.PageInfo; @@ -16,9 +17,9 @@ Question updateFullQuestion(QuestionEditRequestVM model); QuestionEditRequestVM getQuestionEditRequestVM(Integer questionId); ExamQuestionVO getQuestionEditRequestVM(Integer questionId); QuestionEditRequestVM getQuestionEditRequestVM(Question question); ExamQuestionVO getQuestionEditRequestVM(Question question); Integer selectAllCount(); src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java
@@ -18,10 +18,8 @@ import com.mindskip.xzs.utility.JsonUtil; import com.mindskip.xzs.utility.ModelMapperSingle; import com.mindskip.xzs.utility.ExamUtil; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperPageRequestVM; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperTitleItemVM; import com.mindskip.xzs.viewmodel.admin.exam.QuestionTypeVM; import com.mindskip.xzs.viewmodel.admin.exam.*; import com.mindskip.xzs.viewmodel.admin.question.ExamQuestionVO; import com.mindskip.xzs.viewmodel.admin.question.QuestionEditRequestVM; import com.mindskip.xzs.viewmodel.student.dashboard.PaperFilter; import com.mindskip.xzs.viewmodel.student.dashboard.PaperInfo; @@ -32,6 +30,7 @@ import com.mindskip.xzs.domain.Question; import com.mindskip.xzs.domain.User; import org.modelmapper.ModelMapper; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -151,9 +150,9 @@ } @Override public ExamPaperEditRequestVM examPaperToVM(Integer id) { public ExamPaperEditRequestVO examPaperToVM(Integer id) { ExamPaper examPaper = examPaperMapper.selectByPrimaryKey(id); ExamPaperEditRequestVM vm = modelMapper.map(examPaper, ExamPaperEditRequestVM.class); ExamPaperEditRequestVO vm = modelMapper.map(examPaper, ExamPaperEditRequestVO.class); vm.setLevel(examPaper.getGradeLevel()); vm.setMenuIds(examPaper.getUserIds()); TextContent frameTextContent = textContentService.selectById(examPaper.getFrameTextContentId()); @@ -172,11 +171,12 @@ Integer order = 0; Set<Integer> generatedNumbers = new HashSet<>(); Random random = new Random(); List<ExamPaperTitleItemVM> examPaperTitleItemVMS = examPaperTitleItemObjects.stream().map(t -> { ExamPaperTitleItemVM tTitleVM = modelMapper.map(t, ExamPaperTitleItemVM.class); List<QuestionEditRequestVM> questionItemsVM = t.getQuestionItems().stream().map(i -> { List<ExamPaperTitleItemVO> examPaperTitleItemVMS = examPaperTitleItemObjects.stream().map(t -> { ExamPaperTitleItemVO tTitleVM = new ExamPaperTitleItemVO(); BeanUtils.copyProperties(t, tTitleVM); List<ExamQuestionVO> questionItemsVM = t.getQuestionItems().stream().map(i -> { Question question = questions.stream().filter(q -> q.getId().equals(i.getId())).findFirst().get(); QuestionEditRequestVM questionEditRequestVM = questionService.getQuestionEditRequestVM(question); ExamQuestionVO questionEditRequestVM = questionService.getQuestionEditRequestVM(question); questionEditRequestVM.setTitle("(" + QuestionTypeEnum.fromCode(questionEditRequestVM.getQuestionType()).getName() + ") " + questionEditRequestVM.getTitle()); questionEditRequestVM.setItemOrder(generateRandomNumber(questionEditRequestVM.getQuestionType() == 1 ? 0 : ((questionEditRequestVM.getQuestionType() == 2 ? singleChoice : multipleChoice + singleChoice)), questionEditRequestVM.getQuestionType() == 1 ? singleChoice : ((questionEditRequestVM.getQuestionType() == 2 ? multipleChoice + singleChoice : trueFalse + multipleChoice + singleChoice)), @@ -184,7 +184,7 @@ // questionEditRequestVM.setItemOrder(getRandomNumber(t.getQuestionItems().size() - 1, generatedNumbers, random)); return questionEditRequestVM; }).sorted(Comparator.comparing(QuestionEditRequestVM::getItemOrder)) }).sorted(Comparator.comparing(ExamQuestionVO::getItemOrder)) .collect(Collectors.toList()); tTitleVM.setQuestionItems(questionItemsVM); return tTitleVM; @@ -360,6 +360,7 @@ int remainingScore = totalScore; for (int i = 0; i < quantity - 1; i++) { // 如果题数量超过了题库数量,报错 if (i >= scoresMap.size()) { throw new QuestionException(); } src/main/java/com/mindskip/xzs/service/impl/ExamTemplatesServiceImpl.java
@@ -11,6 +11,7 @@ import com.mindskip.xzs.service.ExamTemplatesUserCountService; import com.mindskip.xzs.utility.convert.ExamTemplatesClassConvert; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVO; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperTitleItemVM; import com.mindskip.xzs.viewmodel.admin.exam.QuestionTypeVM; import lombok.extern.slf4j.Slf4j; @@ -147,7 +148,7 @@ vm.setType("1"); vm.setId(null); ExamPaper examPaper = examPaperService.savePaperFromVM(vm, user); ExamPaperEditRequestVM newVM = examPaperService.examPaperToVM(examPaper.getId()); ExamPaperEditRequestVO newVM = examPaperService.examPaperToVM(examPaper.getId()); count.setExamPaperId(examPaper.getId()); count.setUserId(user.getId()); examTemplatesUserCountService.add(count); @@ -166,7 +167,7 @@ vm.setType("1"); vm.setId(null); ExamPaper examPaper = examPaperService.savePaperFromVM(vm, user); ExamPaperEditRequestVM newVM = examPaperService.examPaperToVM(examPaper.getId()); ExamPaperEditRequestVO newVM = examPaperService.examPaperToVM(examPaper.getId()); // count.setExamPaperId(examPaper.getId()); // count.setUserId(user.getId()); // examTemplatesUserCountService.add(count); src/main/java/com/mindskip/xzs/service/impl/QuestionServiceImpl.java
@@ -19,6 +19,7 @@ import com.mindskip.xzs.utility.ModelMapperSingle; import com.mindskip.xzs.utility.ExamUtil; import com.mindskip.xzs.viewmodel.admin.education.SubjectPageRequestVM; import com.mindskip.xzs.viewmodel.admin.question.ExamQuestionVO; import com.mindskip.xzs.viewmodel.admin.question.QuestionEditItemVM; import com.mindskip.xzs.viewmodel.admin.question.QuestionEditRequestVM; import com.mindskip.xzs.viewmodel.admin.question.QuestionPageRequestVM; @@ -132,7 +133,7 @@ } @Override public QuestionEditRequestVM getQuestionEditRequestVM(Integer questionId) { public ExamQuestionVO getQuestionEditRequestVM(Integer questionId) { //题目映射 Question question = questionMapper.selectByPrimaryKey(questionId); List<QuestionSubject> list = questionSubjectService.getQuestion(questionId).stream().map(e->{ @@ -141,41 +142,41 @@ e.setSubName(subjectMapper.page(subject).get(0).getName()); return e; }).collect(Collectors.toList()); QuestionEditRequestVM questionEditRequestVM = getQuestionEditRequestVM(question); ExamQuestionVO questionEditRequestVM = getQuestionEditRequestVM(question); questionEditRequestVM.setQuestionSubjects(list); return questionEditRequestVM; } @Override public QuestionEditRequestVM getQuestionEditRequestVM(Question question) { public ExamQuestionVO getQuestionEditRequestVM(Question question) { //题目映射 TextContent questionInfoTextContent = textContentService.selectById(question.getInfoTextContentId()); QuestionObject questionObject = JsonUtil.toJsonObject(questionInfoTextContent.getContent(), QuestionObject.class); QuestionEditRequestVM questionEditRequestVM = modelMapper.map(question, QuestionEditRequestVM.class); ExamQuestionVO questionEditRequestVM = modelMapper.map(question, ExamQuestionVO.class); questionEditRequestVM.setTitle(questionObject.getTitleContent()); //答案 QuestionTypeEnum questionTypeEnum = QuestionTypeEnum.fromCode(question.getQuestionType()); switch (questionTypeEnum) { case SingleChoice: case TrueFalse: questionEditRequestVM.setCorrect(question.getCorrect()); break; case MultipleChoice: questionEditRequestVM.setCorrectArray(ExamUtil.contentToArray(question.getCorrect())); break; case GapFilling: List<String> correctContent = questionObject.getQuestionItemObjects().stream().map(d -> d.getContent()).collect(Collectors.toList()); questionEditRequestVM.setCorrectArray(correctContent); break; case ShortAnswer: questionEditRequestVM.setCorrect(questionObject.getCorrect()); break; default: break; } questionEditRequestVM.setScore(ExamUtil.scoreToVM(question.getScore())); questionEditRequestVM.setAnalyze(questionObject.getAnalyze()); // QuestionTypeEnum questionTypeEnum = QuestionTypeEnum.fromCode(question.getQuestionType()); // switch (questionTypeEnum) { // case SingleChoice: // case TrueFalse: // questionEditRequestVM.setCorrect(question.getCorrect()); // break; // case MultipleChoice: // questionEditRequestVM.setCorrectArray(ExamUtil.contentToArray(question.getCorrect())); // break; // case GapFilling: // List<String> correctContent = questionObject.getQuestionItemObjects().stream().map(d -> d.getContent()).collect(Collectors.toList()); // questionEditRequestVM.setCorrectArray(correctContent); // break; // case ShortAnswer: // questionEditRequestVM.setCorrect(questionObject.getCorrect()); // break; // default: // break; // } // questionEditRequestVM.setScore(ExamUtil.scoreToVM(question.getScore())); // questionEditRequestVM.setAnalyze(questionObject.getAnalyze()); //题目项映射 src/main/java/com/mindskip/xzs/viewmodel/admin/exam/ExamPaperEditRequestVO.java
New file @@ -0,0 +1,52 @@ package com.mindskip.xzs.viewmodel.admin.exam; import lombok.Data; import javax.validation.Valid; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.util.List; import java.util.Map; @Data public class ExamPaperEditRequestVO { private Integer id; // @NotNull private Integer level; // @NotNull private Integer[] subjectId; private Integer paperType; private String name; private Integer suggestTime; /** * 发布试卷部门 */ private Integer deptId; private List<String> limitDateTime; private List<ExamPaperTitleItemVO> titleItems; private String score; //部门ids private Integer[] departmentIds; private Integer[] userIds; private Map<Integer,Integer> subjectSource; //随机试卷各个标签题型数量 private List<QuestionTypeVM> questionTypeVMS; private Integer aggregateSource; private Integer[][] userId; private String type; private String status; private String menuIds; } src/main/java/com/mindskip/xzs/viewmodel/admin/exam/ExamPaperTitleItemVO.java
New file @@ -0,0 +1,19 @@ package com.mindskip.xzs.viewmodel.admin.exam; import com.mindskip.xzs.viewmodel.admin.question.ExamQuestionVO; import com.mindskip.xzs.viewmodel.admin.question.QuestionEditRequestVM; import lombok.Data; import javax.validation.Valid; import javax.validation.constraints.NotBlank; import java.util.List; @Data public class ExamPaperTitleItemVO { private String name; // @Size(min = 1,message = "请添加题目") private List<ExamQuestionVO> questionItems; } src/main/java/com/mindskip/xzs/viewmodel/admin/question/ExamQuestionVO.java
New file @@ -0,0 +1,48 @@ package com.mindskip.xzs.viewmodel.admin.question; import com.mindskip.xzs.domain.QuestionSubject; import lombok.Data; import java.util.List; /** * @author:xp * @date:2024/3/15 10:35 */ @Data public class ExamQuestionVO { private Integer id; /** * 题目类型 */ private Integer questionType; /** * 课目 */ private Integer subjectId; /** * 题干 */ private String title; private String sbNames; private List<QuestionSubject> questionSubjects; //答案 private List<QuestionEditItemVM> items; private Integer itemOrder; private String department; private String a; private String b; private String c; private String d; } src/main/java/com/mindskip/xzs/viewmodel/admin/question/QuestionEditRequestVM.java
@@ -47,6 +47,8 @@ private String department; private List<QuestionSubject> questionSubjects; private String a; private String b; @@ -61,7 +63,7 @@ this.department = department; } private List<QuestionSubject> questionSubjects; public List<QuestionSubject> getQuestionSubjects() { return questionSubjects; src/main/java/com/mindskip/xzs/viewmodel/student/exam/ExamPaperReadVO.java
New file @@ -0,0 +1,11 @@ package com.mindskip.xzs.viewmodel.student.exam; import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVO; import lombok.Data; @Data public class ExamPaperReadVO { private ExamPaperEditRequestVO paper; private ExamPaperSubmitVM answer; } src/main/java/com/mindskip/xzs/viewmodel/student/question/answer/QuestionAnswerVO.java
New file @@ -0,0 +1,14 @@ package com.mindskip.xzs.viewmodel.student.question.answer; import com.mindskip.xzs.viewmodel.admin.question.ExamQuestionVO; import com.mindskip.xzs.viewmodel.student.exam.ExamPaperSubmitItemVM; import lombok.Data; @Data public class QuestionAnswerVO { private ExamQuestionVO questionVM; private ExamPaperSubmitItemVM questionAnswerVM; }