feat(gradebook): add weighted view settings foundation (pr1 of 3)#8411
Open
LWS49 wants to merge 2 commits into
Open
feat(gradebook): add weighted view settings foundation (pr1 of 3)#8411LWS49 wants to merge 2 commits into
LWS49 wants to merge 2 commits into
Conversation
8718f51 to
f91df1d
Compare
865ba2b to
6bd0a13
Compare
Introduces a course-wide gradebook showing per-student grades across all assessments. Instructors can toggle which assessment columns are visible via a hierarchical column picker (grouped by category/tab), then export the current view to CSV. Backend adds GradebookController#index (JSON), ability guard, and model methods on Assessment and Submission for fetching grade data. Table lib gains reusable ColumnPickerTemplate, MuiColumnPickerPrompt, ColumnPickerTreeGroup, and toolbar integration used by the gradebook.
6bd0a13 to
cd70de2
Compare
f8d517b to
298ef61
Compare
- Add gradebook_weight (0-100 integer) column to course_assessment_tabs - Add manage_gradebook_weights/settings abilities (manager/owner only) - Add Course Admin -> Gradebook settings page to toggle the setting
298ef61 to
f572984
Compare
cd70de2 to
64927b1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lays the storage and admin-settings foundation for per-tab grade weighting in the gradebook. Adds a
gradebook_weightinteger column (0-100, default 0) tocourse_assessment_tabswith model-level validation (integer, 0-100, presence), a newCourse::Settings::GradebookComponentwith aweighted_view_enabledboolean (default false), two new CanCanCan abilities (manage_gradebook_weights,manage_gradebook_settings) scoped to manager/owner, and a Course Admin → Gradebook settings page where owners can enable or disable the weighted view. No observable change to the gradebook for existing courses — the setting defaults to false, and the weighted view surface (view toggle, Configure Weights button, weighted columns) lands in a later PR.Design decisions
weighted_view_enableddefaults to false - zero UX impact on existing courses; staff who don't use weighting never encounter the feature. Matches Coursemology's existing per-component opt-in pattern.:manage_gradebook_settings, not the generic:manageon the course - tab weighting is a course grading policy, so the settings page is intentionally narrower than full course management; TAs are excluded even though they read the gradebook.Design Considerations
Course-level setting gates the entire feature
Decision: New
weighted_view_enabledboolean course setting (defaultfalse). When disabled, no view toggle, no Configure Weights button, no weighted columns. The entire feature surface is hidden.Why considered: Could have made the By-weight view always visible (toggle present, weighted columns blank when no weights configured). Setting toggle adds an extra step to enable.
For:
Against:
Alternatives:
Rationale: I chose gating because the feature is meaningful only when a course has actually decided to grade by tab weights. Gating prevents UI clutter for the majority of courses that don't.
Phase 1 staff-only scope
Decision: Implement weighted view for staff gradebook only. Student-facing weighted view becomes a separate later spec.
Why considered: Both views share the same underlying weights and compute logic; combining them in one PR is technically feasible.
For:
Against:
Alternatives:
Rationale: I chose staff-first because tab weights are configured by staff; staff are the primary persona for Phase 1. Once weights are live and stable, exposing them to students is additive rather than dependent.
Regression prevention
Covers: migration (
gradebook_weightinteger, not-null, default 0, reversible), tab validation (0-100 range, integer, presence, default value), settings model (default false, persistence, string"1"/"0"coercion), abilities (manager/owner granted both new abilities; TA and student denied), admin controller (edit returnsweightedViewEnabled: falsefor manager; TA denied on both edit and update; PATCH persists setting and returns updated value; existing tabgradebook_weightvalues survive toggling the setting in both directions).Manual: enabled setting as course owner and confirmed persistence across page refresh; disabled and re-enabled confirming tab weights survived the round-trip; confirmed TA is denied on the settings page; confirmed a tab's
gradebook_weightwas unchanged after togglingweighted_view_enabledoff and back on.Backward compatibility:
weighted_view_enableddefaults to false — no change to the gradebook page or any other UI for existing courses.