예제 #1
0
 /** Method run in case of wrong answer. */
 private void answeredWrongly() {
   student.increaseNumberOfWrongAnswers();
   if (student.getNumberOfWrongAnswers() >= 9) {
     student.setNumberOfWrongAnswers(0);
     changeDifficulty(student.getDifficulty() - 1);
   }
 }
예제 #2
0
 /** Method run in case of correct answer. */
 private void answeredCorrectly() {
   increaseScore();
   student.increaseNumberOfCorrectAnswers();
   if (student.getNumberOfRightAnswers() >= 9) {
     changeDifficulty(student.getDifficulty() + 1);
     student.setNumberOfRightAnswers(0);
   }
 }
예제 #3
0
 /**
  * Sets the desired difficulty.
  *
  * @param difficulty Integer; 1-10
  */
 public void changeDifficulty(int difficulty) {
   student.setDifficulty(difficulty);
   this.questionsController =
       new QuestionsController(10, student.getDifficulty(), student.getOperationType());
 }
예제 #4
0
 /** @param student An Object of the class Student. */
 public GameController(Student student) {
   this.student = student;
   this.questionsController =
       new QuestionsController(10, student.getDifficulty(), student.getOperationType());
 }