| | |
| | | import com.ycl.jxkg.domain.ExamPaperAnswerInfo; |
| | | import com.ycl.jxkg.domain.entity.ExamPaperScore; |
| | | import com.ycl.jxkg.domain.entity.User; |
| | | import com.ycl.jxkg.domain.vo.DoQuestionVO; |
| | | import com.ycl.jxkg.domain.vo.PaperFixQuestionVO; |
| | | import com.ycl.jxkg.domain.vo.admin.exam.ExamPaperMarkNavbarVO; |
| | | import com.ycl.jxkg.domain.vo.admin.exam.ExamPaperScoreVO; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @RequiredArgsConstructor |
| | |
| | | return Result.ok(examPaperScoreVO); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/checkWrong", method = RequestMethod.POST) |
| | | public Result<ExamPaperScoreVO> checkWrong(@RequestBody @Valid DoQuestionVO model) { |
| | | ExamPaperScore examPaperScore = examPaperScoreService.getById(model.getId()); |
| | | ExamPaperScoreVO examPaperScoreVO = new ExamPaperScoreVO(); |
| | | BeanUtils.copyProperties(examPaperScore, examPaperScoreVO); |
| | | User user = userService.getById(examPaperScore.getUserId()); |
| | | examPaperScoreVO.setUserName(Objects.nonNull(user) ? user.getRealName() : "用户已注销"); |
| | | examPaperScoreVO.setNavbar(JSON.parseArray(examPaperScore.getNavbar(), ExamPaperMarkNavbarVO.class)); |
| | | examPaperScoreVO.setTitleItems(JSON.parseArray(examPaperScore.getPaperContent(), PaperFixQuestionVO.class)); |
| | | |
| | | List<PaperFixQuestionVO> titleItems = new ArrayList<>(); |
| | | List<DoQuestionVO> list = new ArrayList<>(); |
| | | PaperFixQuestionVO paperFixQuestionVO = new PaperFixQuestionVO(); |
| | | paperFixQuestionVO.setQuestionType(model.getQuestionType()); |
| | | list.add(model); |
| | | paperFixQuestionVO.setQuestionList(list); |
| | | titleItems.add(paperFixQuestionVO); |
| | | examPaperScoreVO.setTitleItems(titleItems); |
| | | return Result.ok(examPaperScoreVO); |
| | | } |
| | | |
| | | } |