Beispiel #1
0
  public static void displayFlashcard() {
    int size = flashcardSet.size();

    if (currentIndex < size) {
      Main.frame.setContentPane(
          new TermDisplay(flashcardSet.getFlashcard(currentIndex)).getPanel1());
      Main.frame.pack();
      Main.frame.invalidate();

      currentIndex++;
    } else {
      displayCompleted();
    }
  }
Beispiel #2
0
  private static String getStats() {

    int total = flashcardSet.size();
    int correct = 0;

    for (int index = 0; index < flashcardSet.size(); index++) {
      if (flashcardSet.getFlashcard(index).isCorrect()) {
        correct++;
      }
    }

    return correct
        + "/"
        + total
        + " ("
        + (double) Math.round((double) correct / (double) total * 10000) / 100
        + "%)";
  }