Skip to content

Commit

Permalink
SAK-41845 allow institutions to disable stats display by default in n…
Browse files Browse the repository at this point in the history
…ew gradebook (sakaiproject#6949)
  • Loading branch information
ottenhoff authored and Miguel Pellicer committed May 24, 2019
1 parent 04a3747 commit 7bf51c4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1843,6 +1843,14 @@
# Default: true
# gradebook.assignments.displayed=false

# Default for assignment stats displayed
# Default: true
# gradebook.stats.assignments.displayed=false

# Default for course grade stats displayed
# Default: true
# gradebook.stats.coursegrade.displayed=false

# Show the option to grade with letter grade (converted to points)
# Default: false
# gradebook_enable_letter_grade=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public class GradebookFrameworkServiceImpl extends BaseHibernateManager implemen
public static final String PROP_COURSE_POINTS_DISPLAYED = "gradebook.coursepoints.displayed";
public static final String PROP_COURSE_GRADE_DISPLAYED = "gradebook.coursegrade.displayed";
public static final String PROP_ASSIGNMENTS_DISPLAYED = "gradebook.assignments.displayed";
public static final String PROP_ASSIGNMENT_STATS_DISPLAYED = "gradebook.stats.assignments.displayed";
public static final String PROP_COURSE_GRADE_STATS_DISPLAYED = "gradebook.stats.coursegrade.displayed";

@Override
public void addGradebook(final String uid, final String name) {
Expand Down Expand Up @@ -145,9 +147,12 @@ public void addGradebook(final String uid, final String name) {
gradebook.setCourseLetterGradeDisplayed(true);
gradebook.setCourseAverageDisplayed(true);

// SAK-33855 turn on stats for new gradebooks
gradebook.setAssignmentStatsDisplayed(true);
gradebook.setCourseGradeStatsDisplayed(true);
// SAK-33855 turn on stats for new gradebooks
final Boolean propAssignmentStatsDisplayed = this.serverConfigurationService.getBoolean(PROP_ASSIGNMENT_STATS_DISPLAYED, true);
gradebook.setAssignmentStatsDisplayed(propAssignmentStatsDisplayed);

final Boolean propCourseGradeStatsDisplayed = this.serverConfigurationService.getBoolean(PROP_COURSE_GRADE_STATS_DISPLAYED, true);
gradebook.setCourseGradeStatsDisplayed(propCourseGradeStatsDisplayed);

// Update the gradebook with the new selected grade mapping
session.update(gradebook);
Expand Down

0 comments on commit 7bf51c4

Please sign in to comment.