if(gradebook != null && (gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_ONLY_CATEGORY || gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_WEIGHTED_CATEGORY))
if(gradebook != null && (gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_ONLY_CATEGORY || gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_WEIGHTED_CATEGORY))
categoryId, getGradebook(gradebookUid).getCategory_type(), null, null); if (enrRecFunctionMap == null) { return new HashMap();
final Map<EnrollmentRecord, String> enrRecFunctionMap = this.authz.findMatchingEnrollmentsForItemForUser(userUid, gradebookUid, categoryId, getGradebook(gradebookUid).getCategory_type(), null, null); if (enrRecFunctionMap == null) { return new HashMap();
/** * Convenience method for checking if the grade for the assignment should be included in calculations. This is different from just the * {@link #isCounted()} method for an assignment. This method does a more thorough check using other values, such as if removed, * isExtraCredit, ungraded, etc in addition to the assignment's notCounted property. Now also considers category type. If categories are * configured (setting 2 or 3), uncategorised items are not counted. * * @return true if grades for this assignment should be included in various calculations. */ public boolean isIncludedInCalculations() { boolean isIncludedInCalculations = false; final int categoryType = this.gradebook.getCategory_type(); if (!this.removed && !getUngraded() && isCounted() && (isExtraCredit() || (this.pointsPossible != null && this.pointsPossible > 0))) { isIncludedInCalculations = true; } if (categoryType != 1 && this.category == null) { isIncludedInCalculations = false; } return isIncludedInCalculations; }
.findMatchingEnrollmentsForViewableCourseGrade(gradebookUid, thisGradebook.getCategory_type(), null, null); enrollmentMap = new HashMap();
final Map viewableEnrollmentsMap = GradebookServiceHibernateImpl.this.authz.findMatchingEnrollmentsForViewableCourseGrade(gradebookUid, thisGradebook.getCategory_type(), null, null); enrollmentMap = new HashMap();
final Gradebook gradebook = getGradebook(gradebookUid); final Set studentUids = getAllStudentUids(getGradebookUid(gradebook.getId())); if (gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_NO_CATEGORY || gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_ONLY_CATEGORY) { final List records = getAllAssignmentGradeRecords(gradebook.getId(), studentUids); final List assigns = getAssignments(gradebook.getId(), SortType.SORT_BY_SORTING, true);
final GradebookAssignment assign = gradeRec.getAssignment(); boolean extraCredit = assign.isExtraCredit(); if (gradebook.getCategory_type() != GradebookService.CATEGORY_TYPE_NO_CATEGORY && assign.getCategory() != null && assign.getCategory().isExtraCredit()) { extraCredit = true; final GradebookAssignment go = gradeRec.getAssignment(); if (pointsEarned != null) { if (gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_NO_CATEGORY) { assignmentsTaken.add(go.getId()); } else if ((gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_ONLY_CATEGORY || gradebook .getCategory_type() == GradebookService.CATEGORY_TYPE_WEIGHTED_CATEGORY) && go != null && categories != null) { if (!literalTotal && gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_WEIGHTED_CATEGORY) { for (int i = 0; i < categories.size(); i++) { final Category cate = (Category) categories.get(i); if (gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_NO_CATEGORY && assignmentsTaken.contains(asn.getId())) { totalPointsPossible += pointsPossible; } else if (gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_ONLY_CATEGORY && assignmentsTaken.contains(asn.getId())) { totalPointsPossible += pointsPossible; } else if (literalTotal && gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_WEIGHTED_CATEGORY && assignmentsTaken.contains(asn.getId())) { totalPointsPossible += pointsPossible;
thisGradebook.getCategory_type(), null, null); final Map<String, EnrollmentRecord> enrollmentMap = new HashMap<>();
if(gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_NO_CATEGORY || gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_ONLY_CATEGORY)
gradebook.getCategory_type(), null, null); final Set enrRecs = enrRecFunctionMap.keySet(); final Map studentIdEnrRecMap = new HashMap();
final CourseGrade courseGrade = getCourseGrade(gradebookId); final Map viewableEnrollmentsMap = this.authz.findMatchingEnrollmentsForViewableCourseGrade(gradebookUid, thisGradebook.getCategory_type(), null, null); final Map<String, EnrollmentRecord> enrollmentMap = new HashMap<>();
final Map enrRecFunctionMap = this.authz.findMatchingEnrollmentsForItem(gradebook.getUid(), categoryId, gradebook.getCategory_type(), null, null); final Set enrRecs = enrRecFunctionMap.keySet(); final Map studentIdEnrRecMap = new HashMap();
if (gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_NO_CATEGORY) { assignmentsToReturn.addAll(getAssignments(gradebookUid, sortBy)); } else {
if (gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_NO_CATEGORY) { assignmentsToReturn.addAll(getAssignments(gradebookUid, sortBy)); } else {
if(gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_WEIGHTED_CATEGORY) { double totalWeight = 0; for(final CategoryDefinition newDef: newCategoryDefinitions) { if(gradebook.getCategory_type() == GradebookService.CATEGORY_TYPE_WEIGHTED_CATEGORY) { excludeUncategorisedItemsFromCourseGradeCalculations(gradebook);
@Override public String getGradebookDefinitionXml(final String gradebookUid) { final Long gradebookId = getGradebook(gradebookUid).getId(); final Gradebook gradebook = getGradebook(gradebookUid); final GradebookDefinition gradebookDefinition = new GradebookDefinition(); final GradeMapping selectedGradeMapping = gradebook.getSelectedGradeMapping(); gradebookDefinition.setSelectedGradingScaleUid(selectedGradeMapping.getGradingScale().getUid()); gradebookDefinition.setSelectedGradingScaleBottomPercents(new HashMap<>(selectedGradeMapping.getGradeMap())); gradebookDefinition.setAssignments(getAssignments(gradebookUid)); gradebookDefinition.setGradeType(gradebook.getGrade_type()); gradebookDefinition.setCategoryType(gradebook.getCategory_type()); gradebookDefinition.setCategory(getCategories(gradebookId)); return VersionedExternalizable.toXml(gradebookDefinition); }
rval.setCategoryType(gradebook.getCategory_type()); rval.setDisplayReleasedGradeItemsToStudents(gradebook.isAssignmentsDisplayed());
rval.setCategoryType(gradebook.getCategory_type()); rval.setDisplayReleasedGradeItemsToStudents(gradebook.isAssignmentsDisplayed());