Esempio n. 1
0
  public void actionIfCustom(String recup) {

    // test
    if (recup.equals(((QuestionCustom) e.getQuestion(iterateur - 1)).getSolutionString())) {
      practice.addRight(iterateur - 1);
    } else {
      practice.addWrong(iterateur - 1);
    }
  }
Esempio n. 2
0
  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);
    }
  }
Esempio n. 3
0
 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;
     }
   }
 }