Ejemplo n.º 1
0
  private void redraw() {

    clear();
    add(formFactory.createTitle(questionnaire.getTitle()));
    for (GwtQuestionGroup group : questionnaire.getGroups()) {
      add(formFactory.createGroup(group));
    }
    if (!(questionnaire.getArchivedQuestionGroup() == null
        || questionnaire.getArchivedQuestionGroup().getQuestions().isEmpty())) {
      add(formFactory.createGroup(questionnaire.getArchivedQuestionGroup()));
    }
  }
Ejemplo n.º 2
0
  public void setAnswers(GwtQuestionnaireAnswers answers) {

    if (!questionnaire.getKey().equals(answers.getQuestionnaireKey())) {
      throw new IllegalArgumentException("answers do not match questionnaire");
    }

    this.answers = answers;

    updateForm();
  }
Ejemplo n.º 3
0
  @Override
  public void notifyAnswer(String questionKey, Object value) {

    changeListener.notifyChange();
    GwtAnswer answer = answers.getAnswer(questionKey);
    if (answer == null) {
      answer = questionnaire.getQuestion(questionKey).getAnswerTemplate().createAnswer();
      answer.setQuestionKey(questionKey);
      answers.addAnswer(answer);
    }
    answer.setValue(value);
    answer.setUpdated(true);
  }