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. 3
      QandA/Questions.txt
  3. 12
      src/main/java/game/loadNextQuestion.java

3
QandA/Answers.txt

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

3
QandA/Questions.txt

@ -1,4 +1,5 @@
test1
test2
test3
test4
test4
test5

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

@ -42,7 +42,19 @@ public class loadNextQuestion implements ActionListener {
System.exit(0);
}
}
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