コード例 #1
0
  /**
   * 到竞赛页面
   *
   * @param request
   * @param competionId
   * @return
   */
  @RequestMapping("/totcompetion")
  public ModelAndView totcompetion(HttpServletRequest request, int competionId) {
    ModelAndView view = new ModelAndView();

    Competion competion = competionService.get(competionId);
    view.addObject("competion", competion);
    // 竞赛裁判
    List<UserCompetion> uclist = usercompetionService.getCompetionjudgment(competionId);
    for (UserCompetion uc : uclist) {
      User user = userService.getUserById(uc.getUserId());
      uc.setUser(user);
    }
    view.addObject("judgmentlist", uclist);
    // Exam course = examService.get(examId);
    // view.addObject("exam", course);
    // 竞赛试卷
    List<CompetionExam> celist = competionService.getCompetionExam(competionId);
    for (CompetionExam ce : celist) {
      TeacherExam te = teacherExamService.getTeacherExamByExamId(ce.getExam().getId());
      ce.setExamuser(userService.getUserById(te.getUserId()).getUsername());
      if (ce.getSelectexam() == 1) {
        view.addObject("sexam", ce);
      }
    }
    view.addObject("celist", celist);
    // 竞赛学生
    List<UserCompetionData> ucslist = usercompetionService.getCompetionStudentData(competionId);
    view.addObject("studentlist", ucslist);

    view.setViewName("/cms/competion");
    return view;
  }
コード例 #2
0
  /**
   * 到竞赛的命卷页面
   *
   * @param request
   * @param competionId
   * @return
   */
  @RequestMapping("/totcompetionmt")
  public ModelAndView totcompetionmt(HttpServletRequest request, int competionId) {
    ModelAndView view = new ModelAndView();

    Competion competion = competionService.get(competionId);
    view.addObject("competion", competion);
    // 竞赛试卷
    List<CompetionExam> list = competionService.getCompetionExam(competionId);
    List<CompetionExam> celist = new ArrayList();
    User user = getSessionUser(request);
    for (CompetionExam ce : list) {
      TeacherExam te = teacherExamService.getTeacherExamByExamId(ce.getExam().getId());

      ce.setExamuser(userService.getUserById(te.getUserId()).getUsername());
      if (user.getId() == te.getUserId()) {
        celist.add(ce);
      }
    }
    view.addObject("celist", celist);

    view.setViewName("/cms/competionmt");
    return view;
  }