Changed checkAnswer method.
This commit is contained in:
parent
0c56cfd033
commit
becf069f04
1 changed files with 16 additions and 6 deletions
|
@ -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();
|
||||
|
|
Reference in a new issue