private void collectCurricularCoursesToEnrol(final Map<Integer, Set<CurricularCourse>> result, final CourseGroup courseGroup,
final CollectContext collectContext, final EnrolmentContext enrolmentContext,
final IDegreeModuleToEvaluate sourceDegreeModuleToEvaluate, final boolean withTemporaryEnrolments) {
final CurriculumGroup curriculumGroup = enrolmentContext.getStudentCurricularPlan().findCurriculumGroupFor(courseGroup);
collectContext.ectsCredits = curriculumGroup != null ? curriculumGroup.getChildCreditsDismissalEcts() : 0;
final double missingEctsToConcludeGroup;
if (curriculumGroup != null) {
missingEctsToConcludeGroup =
curriculumGroup.getDegreeModule().getMinEctsCredits()
- calculateTotalEctsInGroup(enrolmentContext, curriculumGroup, withTemporaryEnrolments)
- calculateEnrollingEctsCreditsInCurricularCoursesFor(enrolmentContext, courseGroup);
} else {
missingEctsToConcludeGroup = courseGroup.getMinEctsCredits();
}