Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.GradeScale


    }

    private Grade getEvaluationMark() {
        Integer mark = getMark();

        GradeScale scale = getEnrolment().getCurricularCourse().getGradeScaleChain();
        if (scale != GradeScale.TYPE20) {
            throw new DomainException("thesis.grade.type20.expected");
        }

        return Grade.createGrade((mark == null || mark < 10) ? GradeScale.RE : mark.toString(), scale);
View Full Code Here


        super.setMark(mark);
    }

    public boolean isMarkValid(Integer mark) {
        GradeScale scale = getEnrolment().getCurricularCourse().getGradeScaleChain();

        if (scale == null) {
            scale = GradeScale.TYPE20;
        }

        return scale.isValid(mark.toString(), EvaluationType.EXAM_TYPE); // TODO:
        // thesis
        // ,
        // check
        // grade
        // type
View Full Code Here

        if (enrolments.isEmpty()) {
            return null;
        }
        JsonObject enrolmentsJsonObject = new JsonObject();
        enrolmentsJsonObject.addProperty("name", BundleUtil.getString(Bundle.STUDENT, "label.student.statistics.marksheet"));
        GradeScale gradeScale = enrolments.get(0).getGradeScale();
        enrolmentsJsonObject.addProperty("grade-scale", gradeScale.name());
        populateMinAndMaxGrade(gradeScale, enrolmentsJsonObject);
        JsonArray gradesArray = new JsonArray();
        for (Enrolment enrolment : enrolments) {
            JsonObject enrolmentJsonObject = new JsonObject();
            enrolmentJsonObject.addProperty("id", enrolment.getRegistration().getStudent().getNumber());
View Full Code Here

            @Override
            public void performValidation() {

                HtmlGradeTextInput htmlGradeTextInput = (HtmlGradeTextInput) getComponent();
                GradeConverter gradeConverter = (GradeConverter) htmlGradeTextInput.getConverter();
                GradeScale gradeScale = gradeConverter.getGradeScale();

                String value = getComponent().getValue().trim();
                if (value != null && value.length() > 0) {
                    if (gradeScale == null) {
                        setValid(false);
                        setMessage("renderers.validator.grade.no.grade.scale");
                    } else {
                        if (!gradeScale.belongsTo(value)) {
                            setValid(false);
                            setMessage("renderers.validator.grade.invalid.grade.value");
                            setArguments(value, RenderUtils.getEnumString(gradeScale));
                        }
                    }
View Full Code Here

        return items;
    }

    public String getGradeScaleDescription() {
        GradeScale gradeScale = getGradeScale();
        if (gradeScale != null) {
            return getGradeScale().getPossibleValueDescription(getEvaluation().isFinal());
        }
        return "";
    }
View Full Code Here

        }
    }

    public boolean getMixedGrades() {
        final Evaluation evaluation = getEvaluation();
        final GradeScale gradeScale = getGradeScale();

        if (gradeScale == null) {
            return false;
        }

        try {
            for (String mark : getMarks().values()) {
                if (!gradeScale.isValid(mark, evaluation.getEvaluationType())) {
                    return true;
                }
            }
        } catch (FenixServiceException e) {
            // nothing
View Full Code Here

TOP

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

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.