Updated Questions to use standard getters

Questions now have standard getters to get the correct answers
This commit is contained in:
law39 2020-04-29 12:11:41 +01:00
parent 1ccc033759
commit a0254f5259
3 changed files with 13 additions and 3 deletions

View file

@ -3,11 +3,13 @@ package uk.ac.aber.cs22120.group20.selfassessment;
import uk.ac.aber.cs22120.group20.json.DictionaryEntry;
public class MatchTheMeaningQuestion extends Question {
DictionaryEntry[] correctAnswer;
private DictionaryEntry[] correctAnswer;
public MatchTheMeaningQuestion(DictionaryEntry[] correctAnswer){
this.correctAnswer = correctAnswer;
}
public DictionaryEntry[] getCorrectAnswer() {
return correctAnswer;
}
}

View file

@ -8,4 +8,8 @@ public class SixMeaningsQuestion extends Question{
private SixMeaningsQuestion(DictionaryEntry correctAnswer) {
this.correctAnswer = correctAnswer;
}
public DictionaryEntry getCorrectAnswer() {
return correctAnswer;
}
}

View file

@ -5,9 +5,13 @@ import uk.ac.aber.cs22120.group20.json.DictionaryEntry;
import java.util.LinkedList;
public class TranslationQuestion extends Question {
DictionaryEntry correctAnswer;
private DictionaryEntry correctAnswer;
public TranslationQuestion(DictionaryEntry correctAnswer){
this.correctAnswer = correctAnswer;
}
public DictionaryEntry getCorrectAnswer() {
return correctAnswer;
}
}