Ejemplo n.º 1
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();
  }
Ejemplo n.º 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;
  }
Ejemplo 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;
 }