diff --git a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/javafx/FlashcardController.java b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/javafx/FlashcardController.java index 8fa6ec6..e80bda4 100644 --- a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/javafx/FlashcardController.java +++ b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/javafx/FlashcardController.java @@ -71,8 +71,13 @@ public class FlashcardController extends SharedCodeController { flashcardIcon.setImage(new Image("file:src/main/resources/assets/icons/black_icons/50px/flashcard-50.png")); flashcardsText.setFill(Color.BLACK); - testWord.setText(Application.practiceList.getFirst().getWelsh()); - wordType.setText("Welsh"); + if(isSortedByEnglish){ + testWord.setText(Application.practiceList.getFirst().getEnglish()); + wordType.setText("English"); + } else{ + testWord.setText(Application.practiceList.getFirst().getWelsh()); + wordType.setText("Welsh"); + } updateCounter(); card = flashcard; @@ -103,8 +108,14 @@ public class FlashcardController extends SharedCodeController { index--; } updateCounter(); - testWord.setText(Application.practiceList.get(index).getWelsh()); - wordType.setText("Welsh"); + + if(isSortedByEnglish){ + testWord.setText(Application.practiceList.get(index).getEnglish()); + wordType.setText("English"); + } else{ + testWord.setText(Application.practiceList.get(index).getWelsh()); + wordType.setText("Welsh"); + } } /** @@ -120,8 +131,14 @@ public class FlashcardController extends SharedCodeController { } updateCounter(); - testWord.setText(Application.practiceList.get(index).getWelsh()); - wordType.setText("Welsh"); + if(isSortedByEnglish){ + testWord.setText(Application.practiceList.get(index).getEnglish()); + wordType.setText("English"); + } else{ + testWord.setText(Application.practiceList.get(index).getWelsh()); + wordType.setText("Welsh"); + } + } /** diff --git a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/javafx/SharedCodeController.java b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/javafx/SharedCodeController.java index a9d5330..4b567dc 100644 --- a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/javafx/SharedCodeController.java +++ b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/javafx/SharedCodeController.java @@ -20,7 +20,7 @@ import uk.ac.aber.cs22120.group20.json.DictionaryEntry; * @see AssessmentGenerator */ abstract public class SharedCodeController { - + static boolean isSortedByEnglish = true; static int sideBarWidth = 50; // /////////////////// // @@ -151,7 +151,7 @@ abstract public class SharedCodeController { @FXML private void flashcardIconClick() { - if(Application.practiseList.size() == 0) { // Check to see if there are any practice words before switching scene, throwing an alert notifying them that they can't switch scenes. + if(Application.practiceList.size() == 0) { // Check to see if there are any practice words before switching scene, throwing an alert notifying them that they can't switch scenes. Alert alert = new Alert(Alert.AlertType.ERROR); alert.setTitle("Error"); alert.setHeaderText("Unable to use Flashcard"); @@ -170,7 +170,7 @@ abstract public class SharedCodeController { */ @FXML private void studyIconClick() { - AssessmentGenerator.generateAssessment(Application.practiseList); + AssessmentGenerator.generateAssessment(Application.practiceList); } /** diff --git a/src/Welsh Vocabulary Tutor/src/main/resources/uk/ac/aber/cs22120/group20/flashcard.fxml b/src/Welsh Vocabulary Tutor/src/main/resources/uk/ac/aber/cs22120/group20/flashcard.fxml index 6335e5e..8c2e91e 100644 --- a/src/Welsh Vocabulary Tutor/src/main/resources/uk/ac/aber/cs22120/group20/flashcard.fxml +++ b/src/Welsh Vocabulary Tutor/src/main/resources/uk/ac/aber/cs22120/group20/flashcard.fxml @@ -126,7 +126,7 @@ - +