Пример #1
0
 private void showAnswersToQuestions() { // pop up window with the result
   Map<Question, String> answers = model.getAnswers();
   String resultString = "YOUR DESTINATION: work in progress...sorry :( \n \n";
   for (Entry<Question, String> answer :
       answers.entrySet()) { // test if questions and answers are correct
     resultString += answer.getKey().getQuestion() + " " + answer.getValue() + "\n";
   }
   JOptionPane.showMessageDialog(null, resultString);
 }
Пример #2
0
  private void startQuestioning() {
    unansweredQuestions = new LinkedBlockingQueue<Question>();
    unansweredQuestions.addAll(model.getQuestions());

    Question question =
        unansweredQuestions
            .poll(); // removes the head of this queue, or returns null if this queue is empty.
    if (question != null) {
      showQuestion(question);
      return;
    }
  }
Пример #3
0
 public void saveSelectedValue(Question question, String answer) { // saves users answer
   model.addAnswer(question, answer);
   showNextQuestion();
 }