Changed checkAnswer method.

This commit is contained in:
maj83 2020-04-30 12:39:44 +01:00
parent 0c56cfd033
commit becf069f04

View file

@ -133,20 +133,30 @@ public class MatchTheMeaningController extends SharedCodeController {
*/
public void checkAnswers(){
ArrayList<DictionaryEntry> answers = new ArrayList<>();
ArrayList<String> listOfAnswers = new ArrayList<>();
answers.add(answer.get(Integer.parseInt(word1.getValue())-1));
answers.add(answer.get(Integer.parseInt(word2.getValue())-1));
answers.add(answer.get(Integer.parseInt(word3.getValue())-1));
answers.add(answer.get(Integer.parseInt(word4.getValue())-1));
if(isEnglish){
listOfAnswers.add(RightWord1.getText());
listOfAnswers.add(RightWord2.getText());
listOfAnswers.add(RightWord3.getText());
listOfAnswers.add(RightWord4.getText());
}else {
listOfAnswers.add(LeftWord1.getText());
listOfAnswers.add(LeftWord2.getText());
listOfAnswers.add(LeftWord3.getText());
listOfAnswers.add(LeftWord4.getText());
}else {
listOfAnswers.add(RightWord1.getText());
listOfAnswers.add(RightWord2.getText());
listOfAnswers.add(RightWord3.getText());
listOfAnswers.add(RightWord4.getText());
}
Question.checkAnswer(answer,listOfAnswers,isEnglish);
Question.checkAnswer(answers,listOfAnswers,isEnglish);
answer.clear();