Package nl.nuggit.moltest.model.question

Examples of nl.nuggit.moltest.model.question.Question


          t++;
        } else if (line.startsWith(QUESTION)) {
          if (test == null) {
            throw new IllegalArgumentException(String.format("Found %s without %s: %s", QUESTION, TEST, line));
          }
          Question question = Question.getInstance(line);
          test.getQuestions().add(question);
          q++;
        }
      }
    } catch (FileNotFoundException e) {
View Full Code Here


      if (result.hasNextQuestion()) {
        viewQuestion(request, response, null);
        return;
      }
    }
    Question question = result.nextQuestion();
    if (question == null) {
      viewWait(request, response);
      return;
    }
    String answerText = request.getParameter("answerText");
    if (!question.isValid(answerText)) {
      viewQuestion(request, response, "Ongeldig antwoord");
      return;
    }
    Answer answer = new Answer(answerText, question.getScore(answerText));
    result.getAnswers().add(answer);
    if (result.hasNextQuestion()) {
      viewQuestion(request, response, null);
      return;
    }
View Full Code Here

  public String toString() {
    return String.format("result,%s,%s,%s", player.getId(), test.getId(), duration);
  }

  public Question nextQuestion() {
    Question question = null;
    if (answers.size() < test.getQuestions().size()) {
      question = test.getQuestions().get(answers.size());
    }
    return question;
  }
View Full Code Here

TOP

Related Classes of nl.nuggit.moltest.model.question.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.