Added changes to TranslationController.java to work with eventual implementation of AssessmentGenerator.
This commit is contained in:
parent
ddb70a042c
commit
1b8cc34bf8
1 changed files with 6 additions and 8 deletions
|
@ -22,7 +22,8 @@ import uk.ac.aber.cs22120.group20.javafx.Application;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class TranslationController extends Question {
|
public class TranslationController extends Question {
|
||||||
ArrayList<DictionaryEntry> practiceList = new ArrayList<>();
|
private ArrayList<DictionaryEntry> practiceList = new ArrayList<>();
|
||||||
|
public static DictionaryEntry practiceWord = new DictionaryEntry();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the word that will be randomly chosen from the practiceList.
|
* 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"));
|
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);
|
correctGuesses.setText("Correct Guesses: " + correctAnswers);
|
||||||
incorrectGuesses.setText("Incorrect Guesses: " + wrongAnswers);
|
incorrectGuesses.setText("Incorrect Guesses: " + wrongAnswers);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(AssessmentGenerator.isEnglish){
|
if(AssessmentGenerator.isEnglish){
|
||||||
wordToTranslate.setText(practiceList.get(chosenWord).getWelsh());
|
wordToTranslate.setText(practiceWord.getWelsh());
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
wordToTranslate.setText(practiceList.get(chosenWord).getEnglish());
|
wordToTranslate.setText(practiceWord.getEnglish());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue