This commit is contained in:
osp1 2020-05-01 15:27:26 +01:00
commit f0327fbbfc
7 changed files with 39 additions and 8 deletions

View file

@ -1,5 +1,5 @@
/**
* @(#) AddWordController.java 0,1 2020/04/30
* @(#) AddWordController.java 0,1 2020/05/01
* <p>
* Copyright (c) 2020 Aberystwyth University.
* All rights reserved.

View file

@ -1,10 +1,11 @@
package uk.ac.aber.cs221.group20.javafx;
/**
* @(#) MyController.java 0,1 2020/04/07
* @(#) MatchTheMeaningController.java 0,1 2020/04/07
* <p>
* Copyright (c) 2020 Aberystwyth University.
* All rights reserved.
*/
package uk.ac.aber.cs221.group20.javafx;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;

View file

@ -1,10 +1,11 @@
package uk.ac.aber.cs221.group20.javafx;
/**
* @(#) ScreenSwitch.java 0.1 2020/04/07
* <p>
* Copyright (c) 2020 Aberystwyth University.
* All rights reserved.
*/
package uk.ac.aber.cs221.group20.javafx;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;

View file

@ -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;
@ -21,7 +29,7 @@ package uk.ac.aber.cs221.group20.javafx;
* Controller for the translationTest fxml file.
*
* @author Brad Corbett brc9
* @version 0.1
* @version 1.1
*/
public class TranslationController extends SharedCodeController {
@ -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<String> usersInput = new ArrayList<>();
usersInput.add(translationBox.getText());
ArrayList<DictionaryEntry> 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();

View file

@ -1,4 +1,3 @@
package uk.ac.aber.cs221.group20.json;
/**
* @(#) JsonProcessing.java 0,1 2020/04/27
* <p>
@ -6,6 +5,8 @@ package uk.ac.aber.cs221.group20.json;
* All rights reserved.
*/
package uk.ac.aber.cs221.group20.json;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

View file

@ -1,3 +1,10 @@
/**
* @(#) AssessmentGenerator.java 0,1 2020/05/01
* <p>
* Copyright (c) 2020 Aberystwyth University.
* All rights reserved.
*/
package uk.ac.aber.cs221.group20.selfassessment;
import javafx.scene.control.Alert;

View file

@ -1,3 +1,10 @@
/**
* @(#) QuestionTest.java 0,1 2020/05/01
* <p>
* Copyright (c) 2020 Aberystwyth University.
* All rights reserved.
*/
package uk.ac.aber.cs221.group20.test;
import org.junit.jupiter.api.Test;