From bf97724c2f4f470fbc6329e34af461bf607e2279 Mon Sep 17 00:00:00 2001 From: Ozan-Can Ekinci Date: Mon, 9 Jan 2023 01:45:45 +0100 Subject: [PATCH] implemented method to check if the third answer is correct --- QandA/Answers.txt | 4 ++-- src/main/java/game/loadNextQuestion.java | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/QandA/Answers.txt b/QandA/Answers.txt index 0779f68..8294e97 100644 --- a/QandA/Answers.txt +++ b/QandA/Answers.txt @@ -1,4 +1,4 @@ right,wrong,wrong,wrong,1 -wrong,right,wrong,right,2 --,-,-,-,3 +wrong,right,wrong,wrong,2 +wrong,wrong,right,wrong,3 -,-,-,-,4 \ No newline at end of file diff --git a/src/main/java/game/loadNextQuestion.java b/src/main/java/game/loadNextQuestion.java index 1b2d1b2..140b2ab 100644 --- a/src/main/java/game/loadNextQuestion.java +++ b/src/main/java/game/loadNextQuestion.java @@ -32,6 +32,16 @@ public class loadNextQuestion implements ActionListener { } } + else if (runGame.splitAns[4].equals("3")) { + if (e.getSource() == GameGui.AnswersBtn3) { + if (GameGui.questionNr != runGame.arrQuestions.length - 1) { + runGame StartGame = new runGame(); + StartGame.run(GameGui.questionNr); + } + } else { + System.exit(0); + } + } }