Skip to content

Commit

Permalink
#1368 don't show the 'show points' option if category type is 'catego…
Browse files Browse the repository at this point in the history
…ries and weighting'
  • Loading branch information
steveswinsburg committed Mar 16, 2016
1 parent c4a4443 commit ed97b90
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.apache.wicket.model.Model;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.sakaiproject.gradebookng.business.GbCategoryType;
import org.sakaiproject.gradebookng.business.GradebookNgBusinessService;
import org.sakaiproject.gradebookng.tool.model.GbModalWindow;
import org.sakaiproject.gradebookng.tool.model.GradebookUiSettings;
Expand Down Expand Up @@ -42,6 +43,8 @@ public void onInitialize() {
final Gradebook gradebook = this.businessService.getGradebook();
final GradebookPage gradebookPage = (GradebookPage) getPage();

final GbCategoryType categoryType = GbCategoryType.valueOf(gradebook.getCategory_type());

// get setting
final Boolean showPoints = this.model.getObject();

Expand All @@ -55,6 +58,7 @@ public void onInitialize() {

// menu
final WebMarkupContainer menu = new WebMarkupContainer("menu");

menu.add(new AjaxLink<Void>("setUngraded") {
private static final long serialVersionUID = 1L;

Expand Down Expand Up @@ -91,6 +95,11 @@ public void onClick(final AjaxRequestTarget target) {
// refresh
setResponsePage(new GradebookPage());
}

@Override
public boolean isVisible() {
return categoryType != GbCategoryType.WEIGHTED_CATEGORY;
}
};

// the label changes depending on the state so we wrap it in a model
Expand Down

0 comments on commit ed97b90

Please sign in to comment.