From 9bd1330513236113fca60e0ef08d6c028f45fef3 Mon Sep 17 00:00:00 2001 From: Brad Corbett Date: Wed, 29 Apr 2020 12:13:32 +0100 Subject: [PATCH] Changed the variable name for answers to be consistent across controllers. --- .../selfassessment/MatchTheMeaningController.java | 10 +++++----- .../group20/selfassessment/TranslationController.java | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/selfassessment/MatchTheMeaningController.java b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/selfassessment/MatchTheMeaningController.java index 1f9fa2d..e01af7e 100644 --- a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/selfassessment/MatchTheMeaningController.java +++ b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/selfassessment/MatchTheMeaningController.java @@ -33,7 +33,7 @@ import java.util.*; public class MatchTheMeaningController extends Question implements Initializable{ - private ArrayList setOfQuestions=new ArrayList<>(); + private ArrayList answer =new ArrayList<>(); private ArrayList orderList = new ArrayList<>(Arrays.asList(0,1,2,3)); private boolean isEnglish; @@ -86,7 +86,7 @@ public class MatchTheMeaningController extends Question implements Initializable */ private void getQuestions(){ - setOfQuestions.addAll(AssessmentGenerator.generateWordMatch()); + answer.addAll(AssessmentGenerator.generateWordMatch()); } @@ -147,12 +147,12 @@ public class MatchTheMeaningController extends Question implements Initializable listOfAnswers.add(LeftWord4.getText()); } - checkAnswer(setOfQuestions,listOfAnswers,isEnglish); + checkAnswer(answer,listOfAnswers,isEnglish); CorrectAnswer.setText(Integer.toString(correctAnswers)); WrongAnswer.setText(Integer.toString(wrongAnswers)); - setOfQuestions.clear(); + answer.clear(); this.prepare(); } @@ -162,7 +162,7 @@ public class MatchTheMeaningController extends Question implements Initializable */ private void prepare(){ getQuestions(); - setWords(setOfQuestions,orderList); + setWords(answer,orderList); } @Override diff --git a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/selfassessment/TranslationController.java b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/selfassessment/TranslationController.java index 6650068..f28622e 100644 --- a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/selfassessment/TranslationController.java +++ b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/selfassessment/TranslationController.java @@ -18,12 +18,12 @@ import uk.ac.aber.cs22120.group20.javafx.Application; * Controller for the translationTest fxml file. * * @author Brad Corbett brc9 - * @version 0.9 + * @version 0.1 * */ public class TranslationController extends Question { private ArrayList practiceList = new ArrayList<>(); - public static DictionaryEntry practiceWord = new DictionaryEntry(); + public static DictionaryEntry answer = new DictionaryEntry(); /** * Represents the word that will be randomly chosen from the practiceList. @@ -67,10 +67,10 @@ public class TranslationController extends Question { if(AssessmentGenerator.isEnglish){ - wordToTranslate.setText(practiceWord.getWelsh()); + wordToTranslate.setText(answer.getWelsh()); } else{ - wordToTranslate.setText(practiceWord.getEnglish()); + wordToTranslate.setText(answer.getEnglish()); } } @@ -86,7 +86,7 @@ public class TranslationController extends Question { usersInput.add(translationBox.getText()); ArrayList correctTranslation = new ArrayList<>(); - correctTranslation.add(practiceList.get(chosenWord)); + correctTranslation.add(answer); checkAnswer(correctTranslation, usersInput, AssessmentGenerator.isEnglish);