예제 #1
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;
 }
예제 #2
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;
  }
예제 #3
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();
  }