From 1b8cc34bf80661cfe1d632844f86b945badb14e6 Mon Sep 17 00:00:00 2001 From: Brad Corbett Date: Wed, 29 Apr 2020 11:22:02 +0100 Subject: [PATCH] Added changes to TranslationController.java to work with eventual implementation of AssessmentGenerator. --- .../selfassessment/TranslationController.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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 4c184e3..6650068 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 @@ -22,7 +22,8 @@ import uk.ac.aber.cs22120.group20.javafx.Application; * */ public class TranslationController extends Question { - ArrayList practiceList = new ArrayList<>(); + private ArrayList practiceList = new ArrayList<>(); + public static DictionaryEntry practiceWord = new DictionaryEntry(); /** * Represents the word that will be randomly chosen from the practiceList. @@ -60,19 +61,16 @@ public class TranslationController extends Question { submitButton.setImage(new Image ("file:src/main/resources/assets/icons/black_icons/50px/right-50.png")); - practiceList.addAll(Application.practiseList); - - - chosenWord = (rand.nextInt(practiceList.size())); - correctGuesses.setText("Correct Guesses: " + correctAnswers); incorrectGuesses.setText("Incorrect Guesses: " + wrongAnswers); + + if(AssessmentGenerator.isEnglish){ - wordToTranslate.setText(practiceList.get(chosenWord).getWelsh()); + wordToTranslate.setText(practiceWord.getWelsh()); } else{ - wordToTranslate.setText(practiceList.get(chosenWord).getEnglish()); + wordToTranslate.setText(practiceWord.getEnglish()); } }