Skip to content

Commit

Permalink
SAK-41209: GradebookNG > new sakai.property to disable 'Set Zero Scor…
Browse files Browse the repository at this point in the history
…e for Empty Cells' (sakaiproject#6477)
  • Loading branch information
bjones86 authored Jan 18, 2019
1 parent ef00b06 commit 503b60e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1839,6 +1839,10 @@
# Default: 20,000
# gradebookng.maxCommentLength=500

# SAK-41209: control visibility of the 'Set Zero Score for Empty Cells' menu option
# DEFAULT: true (visibile)
# gradebookng.showSetZeroScore=false

# ASSIGNMENT 1
# Allows an instructor or any user with assignments management permissions to submit the assignment on behalf of a student
# who has no submission yet (via the View Assignment list by student)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
<span class="caret"></span>
</a>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
<li><a href="javascript:void(0);" class="gb-set-zero-score" role="menuitem"><wicket:message key="coursegrade.option.setungraded" /></a></li>
{if settings.isSetUngradedToZeroEnabled}
<li><a href="javascript:void(0);" class="gb-set-zero-score" role="menuitem"><wicket:message key="coursegrade.option.setungraded" /></a></li>
{/if}
{if !settings.isCategoryTypeWeighted}
<li>
<a href="javascript:void(0);" class="gb-toggle-points" role="menuitem">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.wicket.Component;
import org.apache.wicket.model.StringResourceModel;

import org.sakaiproject.component.cover.ServerConfigurationService;
import org.sakaiproject.gradebookng.business.GbCategoryType;
import org.sakaiproject.gradebookng.business.GbRole;
import org.sakaiproject.gradebookng.business.model.GbCourseGrade;
Expand All @@ -54,6 +56,9 @@ public class GbGradebookData {

private final int NULL_SENTINEL = 127;

private static final String SAK_PROP_SHOW_SET_ZERO_SCORE = "gradebookng.showSetZeroScore";
private static final boolean SAK_PROP_SHOW_SET_ZERO_SCORE_DEFAULT = true;

@Data
private class StudentDefinition {
private String eid;
Expand Down Expand Up @@ -386,6 +391,7 @@ private Map<String, Object> serializeSettings() {
result.put("showPoints", this.uiSettings.getShowPoints());
result.put("isUserAbleToEditAssessments", isUserAbleToEditAssessments());
result.put("isStudentNumberVisible", this.isStudentNumberVisible);
result.put("isSetUngradedToZeroEnabled", ServerConfigurationService.getBoolean(SAK_PROP_SHOW_SET_ZERO_SCORE, SAK_PROP_SHOW_SET_ZERO_SCORE_DEFAULT));

return result;
};
Expand Down

0 comments on commit 503b60e

Please sign in to comment.