diff --git a/src/main/java/org/bitbiome/commands/QuizCommand.java b/src/main/java/org/bitbiome/commands/QuizCommand.java index 3d10aea..241917d 100644 --- a/src/main/java/org/bitbiome/commands/QuizCommand.java +++ b/src/main/java/org/bitbiome/commands/QuizCommand.java @@ -30,7 +30,17 @@ public class QuizCommand implements CommandAPI { String antwort = antworten.getString(i); System.out.println(i + 1 + ". " + antwort); } + Scanner quizScanner = new Scanner(System.in); + int eingabe = quizScanner.nextInt(); + String korrekteAntwort = frage.getString("korrekteAntwort"); + + if (antworten.getString(eingabe - 1).equalsIgnoreCase(korrekteAntwort)) { + System.out.println("Richtige Antwort!\n"); + } else { + System.out.println("Leider falsch... Richtig ist: " + korrekteAntwort + "\n"); + } + System.out.println("Das Quiz ist vorbei."); } }