Skip to content

Commit

Permalink
SAK-41637 Disable uncalculable items during bulk edit (sakaiproject#6818
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianfish authored Apr 16, 2019
1 parent dd57312 commit 74f6526
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

<form class="form-vertical" wicket:id="form">

<!-- <p class="alert alert-info" role="alert"><wicket:message key="bulkedit.instruction"></wicket:message></p>-->

<table class="table table-striped table-bordered table-hover" style="width: auto;">
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
Expand All @@ -30,6 +31,7 @@
import org.sakaiproject.gradebookng.tool.component.GbAjaxButton;
import org.sakaiproject.gradebookng.tool.pages.GradebookPage;
import org.sakaiproject.service.gradebook.shared.Assignment;
import org.sakaiproject.service.gradebook.shared.CategoryDefinition;

import lombok.extern.slf4j.Slf4j;

Expand Down Expand Up @@ -85,6 +87,13 @@ protected void populateItem(final ListItem<Assignment> item) {
final ReleaseCheckbox release = new ReleaseCheckbox("release", new PropertyModel<Boolean>(assignment, "released"));
final IncludeCheckbox include = new IncludeCheckbox("include", new PropertyModel<Boolean>(assignment, "counted"));

// Are there categories in this Gradebook? If so, and this item is not in a category, disabled grade
// calculation inclusion.
List<CategoryDefinition> categories = businessService.getGradebookCategories();
if (categories != null && categories.size() > 0 && StringUtils.isBlank(assignment.getCategoryName())) {
include.setEnabled(false);
}

item.add(release);
item.add(include);
}
Expand Down

0 comments on commit 74f6526

Please sign in to comment.