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; }
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; }
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(); }