Browse Source

implemented method to check if the fourth answer is correct

master
Ozan-Can Ekinci 2 years ago
parent
commit
4c5d7a6c83
  1. 3
      QandA/Answers.txt
  2. 1
      QandA/Questions.txt
  3. 12
      src/main/java/game/loadNextQuestion.java

3
QandA/Answers.txt

@ -1,4 +1,5 @@
right,wrong,wrong,wrong,1 right,wrong,wrong,wrong,1
wrong,right,wrong,wrong,2 wrong,right,wrong,wrong,2
wrong,wrong,right,wrong,3 wrong,wrong,right,wrong,3
-,-,-,-,4
wrong,wrong,wrong,right,4
-,-,-,-,1

1
QandA/Questions.txt

@ -2,3 +2,4 @@ test1
test2 test2
test3 test3
test4 test4
test5

12
src/main/java/game/loadNextQuestion.java

@ -43,6 +43,18 @@ public class loadNextQuestion implements ActionListener {
} }
} }
else if (runGame.splitAns[4].equals("4")) {
if (e.getSource() == GameGui.AnswersBtn4) {
if (GameGui.questionNr != runGame.arrQuestions.length - 1) {
runGame StartGame = new runGame();
StartGame.run(GameGui.questionNr);
}
} else {
System.exit(0);
}
}
} }
} }
Loading…
Cancel
Save