Index: server/src/java/org/sakaiproject/gradebook/gwt/sakai/calculations/GradeCalculationsImpl.java =================================================================== --- server/src/java/org/sakaiproject/gradebook/gwt/sakai/calculations/GradeCalculationsImpl.java (revision 73899) +++ server/src/java/org/sakaiproject/gradebook/gwt/sakai/calculations/GradeCalculationsImpl.java (revision 73915) @@ -770,7 +770,8 @@ else { // GRBK 483 - we deduct this assignment weight - myTotalCategoryPercent = subtract(myTotalCategoryPercent, multiply(assignmentWeight, BIG_DECIMAL_100)); + if (!isExtraCreditItem) + myTotalCategoryPercent = subtract(myTotalCategoryPercent, multiply(assignmentWeight, BIG_DECIMAL_100)); // GRBK-784 - we need a count of items in this thing. if (!isExcused(assignmentGradeRecord)) @@ -854,9 +855,9 @@ } else { // GRBK-869 : prevent division by zero - if(BigDecimal.ZERO.compareTo(myTotalCategoryPercent) == 0) { + if(BigDecimal.ZERO.compareTo(myTotalCategoryPercent) == 0 || isExtraCreditItem) { - earnedPercentWithinCategory = multiply(BIG_DECIMAL_100, gradeRecordUnit.getPercentageScore()); + earnedPercentWithinCategory = gradeRecordUnit.getPercentageScore(); } else { Index: client/src/java/org/sakaiproject/gradebook/gwt/client/gxt/view/panel/MultiGradeContentPanel.java =================================================================== --- client/src/java/org/sakaiproject/gradebook/gwt/client/gxt/view/panel/MultiGradeContentPanel.java (revision 73899) +++ client/src/java/org/sakaiproject/gradebook/gwt/client/gxt/view/panel/MultiGradeContentPanel.java (revision 73915) @@ -1000,13 +1000,9 @@ } }); searchToolBar.add(showWeightedToggleButton); - if(this.isShowWeightedEnabled()) { - showWeightedToggleButton.show(); - showWeightedToggleButton.enable(); - } else { - showWeightedToggleButton.disable(); - showWeightedToggleButton.hide(); - } + showWeightedToggleButton.disable(); + showWeightedToggleButton.hide(); + } /*useClassicNavigationCheckBox = new CheckBox(); @@ -1620,10 +1616,20 @@ isShowWeightedEnabled = enabled; } - protected String getShowWeightedString() { - return showWeightedString; + public void disableShowWeightedButton() { + if (showWeightedToggleButton != null) { + showWeightedToggleButton.disable(); + showWeightedToggleButton.hide(); + } } + public void enableShowWeightedButton() { + if (showWeightedToggleButton != null && this.isShowWeightedEnabled()) { + showWeightedToggleButton.show(); + showWeightedToggleButton.enable(); + } + } + public String getSelectedSectionUid() { String sectionUid = null; if (sectionListBox != null) { Index: client/src/java/org/sakaiproject/gradebook/gwt/client/gxt/view/MultigradeView.java =================================================================== --- client/src/java/org/sakaiproject/gradebook/gwt/client/gxt/view/MultigradeView.java (revision 73899) +++ client/src/java/org/sakaiproject/gradebook/gwt/client/gxt/view/MultigradeView.java (revision 73915) @@ -247,6 +247,12 @@ Gradebook selectedGradebook = Registry.get(AppConstants.CURRENT); multigrade.addGrid(selectedGradebook.getConfigurationModel(), selectedGradebook.getColumns(), (ItemModel)selectedGradebook.getGradebookItemModel()); + // GRBK-483 hide and disable the toggle button when not usable + if (selectedGradebook.getGradebookItemModel().getCategoryType().getDisplayName().equals("Weighted Categories") && + selectedGradebook.getGradebookItemModel().getGradeType().getDisplayName().equals("Points")) + multigrade.enableShowWeightedButton(); + else + multigrade.disableShowWeightedButton(); } return multigrade; }