Merge branch 'master' of https://gitlab.dcs.aber.ac.uk/ncw/gp20
This commit is contained in:
commit
ded93411a1
1 changed files with 23 additions and 28 deletions
|
@ -15,34 +15,29 @@ import java.util.ArrayList;
|
||||||
*/
|
*/
|
||||||
public class Question {
|
public class Question {
|
||||||
|
|
||||||
public int correctAnswer = 0;
|
public int correctAnswers = 0;
|
||||||
public int wrongAnswer =0;
|
public int wrongAnswers =0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for
|
*
|
||||||
* WordEnterQuestion that takes a WelshDictionary object that is being tested on as the parameter.
|
* @param listOfCorrectQuestions
|
||||||
* @param correctAnswer
|
* @param listOfAnswers
|
||||||
|
* @param isEnglish
|
||||||
*/
|
*/
|
||||||
public void wordEnterQuestion(DictionaryEntry correctAnswer){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void checkAnswer(ArrayList<DictionaryEntry> listOfCorrectQuestions, ArrayList<String>listOfAnswers, boolean isEnglish){
|
public void checkAnswer(ArrayList<DictionaryEntry> listOfCorrectQuestions, ArrayList<String>listOfAnswers, boolean isEnglish){
|
||||||
if(isEnglish){
|
if(isEnglish){
|
||||||
for(int i=0; i<listOfCorrectQuestions.size();i++){
|
for(int i=0; i<listOfCorrectQuestions.size();i++){
|
||||||
if(listOfCorrectQuestions.get(i).getWelsh().equals(listOfAnswers.get(i))){
|
if(listOfCorrectQuestions.get(i).getWelsh().equals(listOfAnswers.get(i))){
|
||||||
correctAnswer++;
|
correctAnswers++;
|
||||||
}else wrongAnswer++;
|
}else wrongAnswers++;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
for(int i=0; i<listOfCorrectQuestions.size();i++){
|
for(int i=0; i<listOfCorrectQuestions.size();i++){
|
||||||
if(listOfCorrectQuestions.get(i).getEnglish().equals(listOfAnswers.get(i))){
|
if(listOfCorrectQuestions.get(i).getEnglish().equals(listOfAnswers.get(i))){
|
||||||
correctAnswer++;
|
correctAnswers++;
|
||||||
}else wrongAnswer++;
|
}else wrongAnswers++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue