Skip to content

feat(gradebook): By-weight view with Configure Weights dialog#8413

Draft
LWS49 wants to merge 15 commits into
lws49/feat-gradebook-weights-pr2-apifrom
lws49/feat-gradebook-weights-pr3-frontend
Draft

feat(gradebook): By-weight view with Configure Weights dialog#8413
LWS49 wants to merge 15 commits into
lws49/feat-gradebook-weights-pr2-apifrom
lws49/feat-gradebook-weights-pr3-frontend

Conversation

@LWS49
Copy link
Copy Markdown
Collaborator

@LWS49 LWS49 commented May 28, 2026

Summary

  • Adds "By weight" gradebook view: per-tab subtotal columns + weighted Total column, behind a [All assessments | By weight] toolbar toggle (rendered only when the course-level setting from PR 1 is enabled)
  • 3-row sticky header: categories → tab titles → "X% of grade" weight subheaders
  • Configure Weights dialog for managers: per-tab integer input, live sum, warning when sum ≠ 100 (save allowed)
  • "Treat Ungraded as 0" toolbar toggle — client-side, recalculates subtotals and total live
  • Total subheader shows warning icon when tab weights don't sum to 100
  • Empty-state banner when all tab weights are 0

Architecture

  • Pure compute helpers (computeWeighted.ts) — computeTabSubtotal, computeStudentTotal, sumWeights
  • Redux store extended: weightedViewEnabled, canManageWeights, gradebookWeight per tab; updateTabWeights action
  • GradebookWeightedTable — self-contained table with custom 3-row thead; no column picker (all subtotals always visible)
  • ConfigureWeightsDialog — dispatches updateGradebookWeights thunk → PATCH /gradebook/weights
  • GradebookIndex — reads weightedViewEnabled selector; conditionally renders ToggleButtonGroup + swaps table component

LWS49 added 15 commits May 25, 2026 11:57
…alog, toolbar buttons, visibility state, and tests

    - Add MuiColumnPickerDialog with Apply/Export actions, locked-column enforcement, and optional dataColumnIds hint when no data columns are selected
    - Update MuiTableToolbar to render a trigger button (opens dialog) and a direct export button alongside the existing CSV download icon
    - Extend useTanStackTableBuilder with column visibility state (localStorage persistence, dynamic reconciliation), onExportFromPicker, onDirectExport, and cross-page selection helpers (selectedCount, toggleAllFiltered, etc.)
    - Add ColumnPickerTemplate interface and Body.ts selection fields
    - Add full test coverage for dialog, toolbar, and hook behaviour
    - Add lib.components.table.* locale keys (en/ko/zh)
- Add gradebook_weight (0-100 integer) column to course_assessment_tabs
- Add Course::Settings::GradebookComponent with weighted_view_enabled
- Add manage_gradebook_weights/settings abilities (manager/owner only)
- Add Course Admin -> Gradebook settings page to toggle the setting
- add Tab.update_gradebook_weights: transactional bulk update scoped to
  course tabs, with pre-flight ID validation and single pre-fetch query
- extend GET /gradebook index JSON with weightedViewEnabled,
  canManageWeights, and per-tab gradebookWeight (gated by setting)
- add PATCH /gradebook/weights: manager-only, returns 422 on validation
  failure or foreign tab, transactionally rolls back on any error
@LWS49 LWS49 marked this pull request as draft May 29, 2026 08:44
@LWS49 LWS49 force-pushed the lws49/feat-gradebook-weights-pr2-api branch 5 times, most recently from 333c45a to 8b79b30 Compare June 4, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant