private double calculateTotalEctsCredits(final EnrolmentContext enrolmentContext) { double accumulated = 0d; for (final IDegreeModuleToEvaluate degreeModuleToEvaluate : enrolmentContext.getDegreeModulesToEvaluate()) { accumulated += degreeModuleToEvaluate.getAccumulatedEctsCredits(enrolmentContext.getExecutionPeriod()); } return accumulated; }
private double calculateApprovedEcts(final EnrolmentContext enrolmentContext) { final ExecutionSemester executionSemester = enrolmentContext.getExecutionPeriod(); final StandaloneCurriculumGroup group = enrolmentContext.getStudentCurricularPlan().getStandaloneCurriculumGroup(); double approved = 0d; for (final CurriculumLine line : group.getChildCurriculumLines()) { if (line.isApproved() && line.isValid(executionSemester)) { approved += line.getAccumulatedEctsCredits(executionSemester); } } return approved; }
protected static Set<IDegreeModuleToEvaluate> getEnroledAndEnroling( final EnrolmentContext enrolmentContext) { return enrolmentContext .getDegreeModulesToEvaluate() .stream() .filter(i -> i.isLeaf() && (i.isEnroled() || i.isEnroling())) .collect(Collectors.toSet()); }