Exemplo n.º 1
0
  public String generateQuestions() {
    List<VidQuestion> list = service.getListVidQuestionByTopic(selectedMenu.getId());

    ResponseQuestionBacking responseQuestionBacking = FacesUtil.findBean("responseQuestionBacking");

    VidQuestion medQuestion = new VidQuestion();
    List<VidAnswer> listAnswer = new LinkedList<VidAnswer>();

    if (list.size() > 0) {
      medQuestion = list.get(0);
      listAnswer = service.getListVidQuestionByQuestion(medQuestion.getId());
      responseQuestionBacking.setList(list);
    } else {
      medQuestion.setId(new BigDecimal(-1));
      medQuestion.setName("No existen preguntas!");
      medQuestion.setQuestionType(Constant.QUESTION_TYPE_MESSAGE);
    }

    responseQuestionBacking.init(medQuestion, list, listAnswer);

    return "/pages/view/responseVideo?faces-redirect=true";
  }
Exemplo n.º 2
0
 public List<VidTopic> getList() {
   if (list.size() == 0) {
     list = service.getListVidTopicByCurrentUser();
   }
   return list;
 }