Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.Attends


    @Atomic
    public void updateGroupingAttends(Grouping grouping, Map<String, Boolean> studentsToRemove, Map<String, Boolean> studentsToAdd) {
        for (Map.Entry<String, Boolean> entry : studentsToRemove.entrySet()) {
            if (entry.getValue()) {
                Attends attends = (Attends) FenixFramework.getDomainObject(entry.getKey());
                if (attends != null) {
                    grouping.getStudentGroupsSet().forEach(studentGroup -> studentGroup.removeAttends(attends));
                    grouping.removeAttends(attends);
                }
            }
        }

        for (Map.Entry<String, Boolean> entry : studentsToAdd.entrySet()) {
            if (entry.getValue()) {
                Registration registration = (Registration) FenixFramework.getDomainObject(entry.getKey());

                if (grouping.getAttendsSet().stream().noneMatch(attends -> attends.getRegistration().equals(registration))) {
                    Optional<Attends> opt =
                            registration.getAssociatedAttendsSet().stream()
                                    .filter(attends -> grouping.getExecutionCourses().stream().anyMatch(ec -> attends.isFor(ec)))
                                    .findAny();
                    if (opt.isPresent()) {
                        grouping.addAttends(opt.get());
                    }
                }
View Full Code Here


    public void updateStudentGroupMembers(StudentGroup studentGroup, Map<String, Boolean> studentsToRemove,
            Map<String, Boolean> studentsToAdd) {

        for (Map.Entry<String, Boolean> entry : studentsToRemove.entrySet()) {
            if (entry.getValue()) {
                Attends attends = (Attends) FenixFramework.getDomainObject(entry.getKey());
                if (attends != null) {
                    studentGroup.removeAttends(attends);
                }
            }
        }

        for (Map.Entry<String, Boolean> entry : studentsToAdd.entrySet()) {
            if (entry.getValue()) {
                Attends attends = (Attends) FenixFramework.getDomainObject(entry.getKey());
                if (attends != null) {
                    studentGroup.addAttends(attends);
                }
            }
        }
View Full Code Here

        final List<DomainException> exceptionList = new ArrayList<DomainException>();
        final List<AttendsMark> result = new ArrayList<AttendsMark>();

        for (final StudentMark studentMark : marks) {
            final Attends attend = findAttend(executionCourse, studentMark.studentNumber, exceptionList);
            if (attend != null) {
                addMark(result, studentMark, attend, exceptionList);
            }
        }
View Full Code Here

        final List<DomainException> exceptionList = new ArrayList<DomainException>();

        for (final AttendsMark entry : marks) {

            final Attends attend = findAttend(executionCourse, entry.attendId);
            final String markValue = entry.mark;

            if (attend.getEnrolment() != null && attend.getEnrolment().isImpossible()) {
                exceptionList.add(new DomainException("errors.student.with.impossible.enrolment", attend.getRegistration()
                        .getStudent().getNumber().toString()));
            } else {
                final Mark mark = attend.getMarkByEvaluation(evaluation);

                if (isToDeleteMark(markValue)) {
                    if (mark != null) {
                        mark.delete();
                    }
View Full Code Here

        final EnrolmentEvaluation improvement = enrolment.getLatestFinalImprovementEnrolmentEvaluation();
        row.setCell(improvement == null ? "" : improvement.getGradeValue());

        row.setCell(registration.getRegistrationProtocol().getCode());
        row.setCell(countPreviousEnrolments(curricularCourse, executionSemesterForPreviousEnrolmentCount, student));
        Attends attends = null; // enrolment.getAttendsFor(executionSemester);
        for (final Attends a : enrolment.getAttendsSet()) {
            if (a.isFor(executionSemester)) {
                if (attends == null) {
                    attends = a;
                }
View Full Code Here

    }

    public ActionForward viewProjectSubmissions(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws FenixActionException, FenixServiceException {

        final Attends attends = getAttends(request);
        final Project project = getProject(request);
        final StudentGroup studentGroup = project.getGrouping().getStudentGroupByAttends(attends);

        request.setAttribute("project", project);
View Full Code Here

            HttpServletResponse response) throws FenixActionException, FenixServiceException {

        ProjectSubmission submission = getProjectSubmission(request);

        if (submission != null && submission.getStudentGroup().isPersonInStudentGroup(getLoggedPerson(request))) {
            Attends attends = getAttends(request);
            Project project = getProject(request);
            StudentGroup studentGroup = project.getGrouping().getStudentGroupByAttends(attends);
            String rowClasses = "";
            for (ProjectSubmission oneSubmission : getProjectSubmissionsForStudentGroupSortedByMostRecent(project, studentGroup)) {
                if (oneSubmission.equals(submission)) {
View Full Code Here

    }

    public ActionForward prepareProjectSubmission(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws FenixActionException, FenixServiceException {

        Attends attends = getAttends(request);
        Project project = getProject(request);
        StudentGroup studentGroup = project.getGrouping().getStudentGroupByAttends(attends);

        request.setAttribute("attends", attends);
        request.setAttribute("project", getProject(request));
View Full Code Here

                final Student student = enrolment.getStudentCurricularPlan().getRegistration().getStudent();
                if (!studentsWithImpossibleEnrolments.contains(student)) {
                    studentsWithImpossibleEnrolments.add(student);
                }
            } else {
                Attends attends = enrolment.getAttendsByExecutionCourse(submissionBean.getExecutionCourse());
                if (attends != null) {
                    marksToSubmit.add(new MarkSheetTeacherMarkBean(attends, submissionBean.getEvaluationDate(), getMark(attends),
                            getEnrolmentEvaluationType(submissionBean, enrolment), getMark(attends).length() != 0));
                }
            }
View Full Code Here

            HttpServletResponse response) throws Exception {
        final Registration registration = getAndSetRegistration(request);
        request.setAttribute("registration", registration);

        final String attendsIdString = request.getParameter("attendsId");
        final Attends attends = FenixFramework.getDomainObject(attendsIdString);

        try {
            registration.removeAttendFor(attends.getExecutionCourse());
        } catch (final DomainException e) {
            addActionMessage(request, e.getMessage(), e.getArgs());
        }

        return viewAttends(mapping, actionForm, request, response);
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.Attends

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.