public void actionIfCustom(String recup) { // test if (recup.equals(((QuestionCustom) e.getQuestion(iterateur - 1)).getSolutionString())) { practice.addRight(iterateur - 1); } else { practice.addWrong(iterateur - 1); } }
public void actionIfEquation(String recup) { // réponse double anwser = new Double(recup); // test if (anwser == ((QuestionEquation) e.getQuestion(iterateur - 1)).solve()[1]) { practice.addRight(iterateur - 1); } else { practice.addWrong(iterateur - 1); } }
public void action(String stringRecup) { if (stringRecup.equals("")) { practice.addWrong(iterateur - 1); } else { switch (e.getType()) { case "calculation": actionIfCalculation(stringRecup); break; case "fraction": actionIfFraction(stringRecup); break; case "power": actionIfPower(stringRecup); break; case "equation": actionIfEquation(stringRecup); break; case "custom": actionIfCustom(stringRecup); break; } } }