if (enrolment.isFirstTime()) {
firstEnrolledCount++;
if (evaluation != null && evaluation.getEnrollmentStateByGrade() == EnrollmentState.APROVED) {
firstApprovedCount++;
IGrade grade = evaluation.getGradeWrapper();
firstApprovedGrades.add(grade);
totalApprovedGrades.add(grade);
totalApprovedCount++;
}
} else {
restEnrolledCount++;
if (evaluation != null && evaluation.getEnrollmentStateByGrade() == EnrollmentState.APROVED) {
restApprovedCount++;
IGrade grade = evaluation.getGradeWrapper();
restApprovedGrades.add(grade);
totalApprovedGrades.add(grade);
totalApprovedCount++;
}
}
}
IGrade firstApprovedAverage = calculateApprovedAverage(firstApprovedGrades);
IGrade restApprovedAverage = calculateApprovedAverage(restApprovedGrades);
IGrade totalApprovedAverage = calculateApprovedAverage(totalApprovedGrades);
courseStatistics.setFirstEnrolledCount(firstEnrolledCount);
courseStatistics.setFirstApprovedCount(firstApprovedCount);
courseStatistics.setFirstApprovedAverage(firstApprovedAverage);