Merge branch 'master' of https://gitlab.dcs.aber.ac.uk/ncw/gp20
This commit is contained in:
commit
f0327fbbfc
7 changed files with 39 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* @(#) AddWordController.java 0,1 2020/04/30
|
* @(#) AddWordController.java 0,1 2020/05/01
|
||||||
* <p>
|
* <p>
|
||||||
* Copyright (c) 2020 Aberystwyth University.
|
* Copyright (c) 2020 Aberystwyth University.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|
|
@ -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>
|
* <p>
|
||||||
* Copyright (c) 2020 Aberystwyth University.
|
* Copyright (c) 2020 Aberystwyth University.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
package uk.ac.aber.cs221.group20.javafx;
|
||||||
|
|
||||||
|
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.scene.control.Alert;
|
import javafx.scene.control.Alert;
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
package uk.ac.aber.cs221.group20.javafx;
|
|
||||||
/**
|
/**
|
||||||
* @(#) ScreenSwitch.java 0.1 2020/04/07
|
* @(#) ScreenSwitch.java 0.1 2020/04/07
|
||||||
* <p>
|
* <p>
|
||||||
* Copyright (c) 2020 Aberystwyth University.
|
* Copyright (c) 2020 Aberystwyth University.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
package uk.ac.aber.cs221.group20.javafx;
|
||||||
|
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.scene.Parent;
|
import javafx.scene.Parent;
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
|
|
|
@ -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;
|
package uk.ac.aber.cs221.group20.javafx;
|
||||||
|
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
|
@ -21,7 +29,7 @@ package uk.ac.aber.cs221.group20.javafx;
|
||||||
* Controller for the translationTest fxml file.
|
* Controller for the translationTest fxml file.
|
||||||
*
|
*
|
||||||
* @author Brad Corbett brc9
|
* @author Brad Corbett brc9
|
||||||
* @version 0.1
|
* @version 1.1
|
||||||
*/
|
*/
|
||||||
public class TranslationController extends SharedCodeController {
|
public class TranslationController extends SharedCodeController {
|
||||||
|
|
||||||
|
@ -83,16 +91,20 @@ public class TranslationController extends SharedCodeController {
|
||||||
@FXML
|
@FXML
|
||||||
private void initialize() {
|
private void initialize() {
|
||||||
setup();
|
setup();
|
||||||
|
|
||||||
|
//Setup of image on screen
|
||||||
currentPageIcon.setImage(new Image("file:src/main/resources/assets/icons/white_icons/50px/pass-fail-50.png"));
|
currentPageIcon.setImage(new Image("file:src/main/resources/assets/icons/white_icons/50px/pass-fail-50.png"));
|
||||||
currentPageText.setText("Study");
|
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"));
|
studyIcon.setImage(new Image("file:src/main/resources/assets/icons/black_icons/50px/pass-fail-50.png"));
|
||||||
studyText.setFill(Color.BLACK);
|
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"));
|
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());
|
correctAnswer.setText(": " + AssessmentGenerator.getTotalCorrectAnswers());
|
||||||
|
|
||||||
totalAnswer.setText(": " + AssessmentGenerator.getTotalAnswers());
|
totalAnswer.setText(": " + AssessmentGenerator.getTotalAnswers());
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,14 +123,16 @@ public class TranslationController extends SharedCodeController {
|
||||||
@FXML
|
@FXML
|
||||||
void translateWord() {
|
void translateWord() {
|
||||||
|
|
||||||
|
//Creates ArrayList of answers and ArrayList of user answers to check
|
||||||
ArrayList<String> usersInput = new ArrayList<>();
|
ArrayList<String> usersInput = new ArrayList<>();
|
||||||
usersInput.add(translationBox.getText());
|
usersInput.add(translationBox.getText());
|
||||||
|
|
||||||
ArrayList<DictionaryEntry> correctTranslation = new ArrayList<>();
|
ArrayList<DictionaryEntry> correctTranslation = new ArrayList<>();
|
||||||
correctTranslation.add(answer);
|
correctTranslation.add(answer);
|
||||||
|
|
||||||
|
//check user answers against correct answers
|
||||||
Question.checkAnswer(correctTranslation, usersInput, AssessmentGenerator.isEnglish());
|
Question.checkAnswer(correctTranslation, usersInput, AssessmentGenerator.isEnglish());
|
||||||
|
|
||||||
|
//Open the next question of the assessment.
|
||||||
AssessmentGenerator.goToNextQuestion();
|
AssessmentGenerator.goToNextQuestion();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
package uk.ac.aber.cs221.group20.json;
|
|
||||||
/**
|
/**
|
||||||
* @(#) JsonProcessing.java 0,1 2020/04/27
|
* @(#) JsonProcessing.java 0,1 2020/04/27
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -6,6 +5,8 @@ package uk.ac.aber.cs221.group20.json;
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
package uk.ac.aber.cs221.group20.json;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
|
|
|
@ -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;
|
package uk.ac.aber.cs221.group20.selfassessment;
|
||||||
|
|
||||||
import javafx.scene.control.Alert;
|
import javafx.scene.control.Alert;
|
||||||
|
|
|
@ -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;
|
package uk.ac.aber.cs221.group20.test;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
Reference in a new issue