}
public List<EventBean> getExams(User user) {
List<EventBean> allEvents = new ArrayList<EventBean>();
ExecutionSemester currentExecutionSemester = ExecutionSemester.readActualExecutionSemester();
for (Registration registration : user.getPerson().getStudent().getRegistrationsSet()) {
for (WrittenEvaluation writtenEvaluation : registration.getWrittenEvaluations(currentExecutionSemester)) {
allEvents.addAll(writtenEvaluation.getAllEvents(registration));
}
for (Attends attends : registration.getAttendsForExecutionPeriod(currentExecutionSemester)) {
for (Project project : attends.getExecutionCourse().getAssociatedProjects()) {
allEvents.addAll(project.getAllEvents(attends.getExecutionCourse()));
}
}
for (WrittenEvaluation writtenEvaluation : registration.getWrittenEvaluations(currentExecutionSemester
.getPreviousExecutionPeriod())) {
allEvents.addAll(writtenEvaluation.getAllEvents(registration));
}
for (Attends attends : registration.getAttendsForExecutionPeriod(currentExecutionSemester
.getPreviousExecutionPeriod())) {
for (Project project : attends.getExecutionCourse().getAssociatedProjects()) {
allEvents.addAll(project.getAllEvents(attends.getExecutionCourse()));
}
}