From 96546c7419dad9459eaeefa87c23fd4ef3b982de Mon Sep 17 00:00:00 2001 From: law39 Date: Fri, 1 May 2020 15:16:52 +0100 Subject: [PATCH] Updated translation controller SE.QA.09 Issues #51 --- .../group20/javafx/TranslationController.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs221/group20/javafx/TranslationController.java b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs221/group20/javafx/TranslationController.java index 271e985..0808b16 100644 --- a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs221/group20/javafx/TranslationController.java +++ b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs221/group20/javafx/TranslationController.java @@ -1,3 +1,11 @@ +/** + +@(#) TranslationController.java 1.1 2020/05/01 + + +Copyright (c) 2020 Aberystwyth University. +All rights reserved. +*/ package uk.ac.aber.cs221.group20.javafx; import javafx.event.ActionEvent; @@ -83,16 +91,20 @@ public class TranslationController extends SharedCodeController { @FXML private void initialize() { setup(); + + //Setup of image on screen currentPageIcon.setImage(new Image("file:src/main/resources/assets/icons/white_icons/50px/pass-fail-50.png")); currentPageText.setText("Study"); + //Setup of image on screen studyIcon.setImage(new Image("file:src/main/resources/assets/icons/black_icons/50px/pass-fail-50.png")); studyText.setFill(Color.BLACK); + //Setup of image on screen submitButton.setImage(new Image("file:src/main/resources/assets/icons/black_icons/50px/right-50.png")); + //Sets answer counters to correct values correctAnswer.setText(": " + AssessmentGenerator.getTotalCorrectAnswers()); - totalAnswer.setText(": " + AssessmentGenerator.getTotalAnswers()); @@ -111,14 +123,16 @@ public class TranslationController extends SharedCodeController { @FXML void translateWord() { + //Creates ArrayList of answers and ArrayList of user answers to check ArrayList usersInput = new ArrayList<>(); usersInput.add(translationBox.getText()); - ArrayList correctTranslation = new ArrayList<>(); correctTranslation.add(answer); + //check user answers against correct answers Question.checkAnswer(correctTranslation, usersInput, AssessmentGenerator.isEnglish()); + //Open the next question of the assessment. AssessmentGenerator.goToNextQuestion();