Package com.jguice.quizzle.interfaces

Examples of com.jguice.quizzle.interfaces.Question


  }
  /* (non-Javadoc)
   * @see com.jguice.quizzle.interfaces.Quizzer#doQuiz()
   */
  public void doQuiz() throws IOException {
    Question question;
    String userInput = "y";
    int numQuestionsLeft;
   
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        System.out.println("Quiz Started");
        while (userInput.toLowerCase().equals("y")) {
            resetQuiz();

            while (quiz.hasQuestions()) {
                question = quiz.nextQuestion();
                numQuestionsSoFar++;
                numQuestionsLeft = quiz.getNumQuestions() - numQuestionsSoFar;
                question.doPrompt();

                userInput = br.readLine();

                if (question.checkAnswer(userInput)) {
                    doCorrectAction();
                    numCorrect++;
                }
                else {
                    doIncorrectAction();
View Full Code Here


    BufferedReader br = new BufferedReader(new FileReader(file));
   
    String line;
   
    while ((line = br.readLine()) != null) {
      Question q = new AudioQuestion(voice);
     
      q.setQuestion(line.trim());
     
      // TODO If there isn't a matched q/a this will fail.  Need to check line
      line = br.readLine();
      q.setAnswer(line.trim());
     
      questions.add(q);
    }
   
    return questions.size();
View Full Code Here

                answer = line.trim();
                break;
            }

            Question q = new TextQuestion();
            q.setQuestion(question);
            q.setAnswer(answer);

      questions.add(q);
    }
   
    return questions.size();
View Full Code Here

TOP

Related Classes of com.jguice.quizzle.interfaces.Question

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.