Esempio n. 1
0
  public double getAverageEasiness() {
    double totalEasiness = 0;
    Collection<Student> students = StudentManager.instance().values();

    for (Student student : students) totalEasiness += student.getEasinessFor(this);

    return totalEasiness / students.size();
  }
Esempio n. 2
0
  public double getAverageResponseTime() {
    if (timerReviews == null) {
      timerReviews = new ReviewList();

      for (Student student : StudentManager.instance().values()) {
        if (student.getGradingGroup() != GradingGroup.SCORE) continue;

        ReviewList tempList = student.getReviewsClone();
        for (int i = 0; i < tempList.size(); i++) timerReviews.add(tempList.get(i));
      }
    }

    return timerReviews.getFor(this).getAverageResponseTime();
  }
Esempio n. 3
0
 private ReviewList getReviewsFor(Student s) {
   ReviewList rl = s.getReviews();
   ReviewList reviewsForThisCard = new ReviewList();
   for (int i = 0; i < rl.size(); i++) {
     if (rl.get(i).getCardId() == cid) {
       reviewsForThisCard.add(rl.get(i));
     }
   }
   return reviewsForThisCard;
 }
Esempio n. 4
0
  public Stats getStatsFor(Student s) {
    Review lastReview = s.getLastReviewFor(this);
    Stats stats = new Stats();
    if (lastReview == null) {
      return stats;
    }
    ReviewList rl = getReviewsFor(s);
    int numSuccessfulReviews = 0;
    double totalReviewTime = 0.0;
    for (int i = 0; i < rl.size(); i++) {
      if (rl.get(i).getSuccess()) {
        numSuccessfulReviews++;
      }
      totalReviewTime += rl.get(i).getResponseTime();
    }
    stats.numReviews = rl.size();
    stats.numSuccessfulReviews = numSuccessfulReviews;
    stats.averageReviewTime = totalReviewTime / stats.numReviews;
    stats.mostRecentDate = lastReview.getDate();

    return stats;
  }