diff --git a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/javafx/MatchTheMeaningController.java b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/javafx/MatchTheMeaningController.java index 48b33cc..23668f6 100644 --- a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/javafx/MatchTheMeaningController.java +++ b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/javafx/MatchTheMeaningController.java @@ -133,20 +133,30 @@ public class MatchTheMeaningController extends SharedCodeController { */ public void checkAnswers(){ + ArrayList answers = new ArrayList<>(); ArrayList listOfAnswers = new ArrayList<>(); + + answers.add(answer.get(Integer.parseInt(word1.getValue())-1)); + answers.add(answer.get(Integer.parseInt(word2.getValue())-1)); + answers.add(answer.get(Integer.parseInt(word3.getValue())-1)); + answers.add(answer.get(Integer.parseInt(word4.getValue())-1)); + if(isEnglish){ - listOfAnswers.add(RightWord1.getText()); - listOfAnswers.add(RightWord2.getText()); - listOfAnswers.add(RightWord3.getText()); - listOfAnswers.add(RightWord4.getText()); - }else { listOfAnswers.add(LeftWord1.getText()); listOfAnswers.add(LeftWord2.getText()); listOfAnswers.add(LeftWord3.getText()); listOfAnswers.add(LeftWord4.getText()); + + + }else { + listOfAnswers.add(RightWord1.getText()); + listOfAnswers.add(RightWord2.getText()); + listOfAnswers.add(RightWord3.getText()); + listOfAnswers.add(RightWord4.getText()); + } - Question.checkAnswer(answer,listOfAnswers,isEnglish); + Question.checkAnswer(answers,listOfAnswers,isEnglish); answer.clear();