Skip to content

feat(gradebook): add gradebook page with column picker, CSV export, and statistics bridge#8400

Open
LWS49 wants to merge 1 commit into
masterfrom
lws49/feat-gradebook-export
Open

feat(gradebook): add gradebook page with column picker, CSV export, and statistics bridge#8400
LWS49 wants to merge 1 commit into
masterfrom
lws49/feat-gradebook-export

Conversation

@LWS49

@LWS49 LWS49 commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a new Gradebook page (/courses/:id/gradebook) giving staff a consolidated view of student grades across all published assessments. The page renders a TanStack-backed table with per-student rows and per-assessment grade columns, supports a tree-structured column picker (student info, gamification, and grades branches), persists column visibility to localStorage per user per course, and exports the visible columns as CSV. Gamification columns (Level, XP) are hidden from the picker when the course has gamification disabled. The Statistics → Assessments tab gains a subtitle explaining it is only for course-level statistics to bridge the two views. The existing "Download Score Summary" button on that tab is removed in full (frontend component, operations, API method, Rails controller action, route, background job, service, and locale keys) since the gradebook supersedes it.

Regression prevention

Tests added:

  • GradebookColumnTree.test.tsx - covers branch rendering, gamification gating, checkbox disabled state, parent toggle propagation, and mixed visibility indeterminate state
  • GradebookIndex.test.tsx - covers loading state, table render, empty student state, column picker toggle, and error toast on fetch failure
  • GradebookTable.test.tsx - covers grade cell rendering, unsubmitted placeholder, column visibility, CSV export header/row content, and localStorage persistence across remounts
  • Backend: gradebook_controller_spec.rb (authorization, index JSON shape), assessment_spec.rb and submission_spec.rb (new query methods), aggregate_controller_spec.rb (gradebookEnabled flag)

Manual testing: All scenarios confirmed - gradebook page loads with students and grades, column picker toggles persist and reflect in CSV, gamification columns absent when disabled, empty state renders cleanly, score summary button gone.

Backward compat: Score summary download removed for all users on upgrade; no migration needed. All other Statistics features unchanged.

image

@LWS49 LWS49 force-pushed the lws49/feat-gradebook-export branch 4 times, most recently from 3525c59 to 702f85e Compare May 21, 2026 11:43
@LWS49 LWS49 marked this pull request as ready for review May 21, 2026 11:53
@LWS49 LWS49 force-pushed the lws49/feat-gradebook-export branch 9 times, most recently from fa7a036 to 031c2e1 Compare May 25, 2026 05:53
@LWS49 LWS49 changed the base branch from master to lws49/feat-table-column-picker May 26, 2026 08:07
@LWS49 LWS49 force-pushed the lws49/feat-table-column-picker branch 4 times, most recently from 0bb52e5 to 8a7d3be Compare May 29, 2026 04:27
@LWS49 LWS49 force-pushed the lws49/feat-gradebook-export branch 4 times, most recently from cd70de2 to 64927b1 Compare May 29, 2026 09:08
Base automatically changed from lws49/feat-table-column-picker to master June 1, 2026 10:12
@LWS49 LWS49 force-pushed the lws49/feat-gradebook-export branch 3 times, most recently from 217cebd to 33def9e Compare June 4, 2026 02:22
@LWS49 LWS49 changed the title feat(gradebook): add gradebook with column picker and CSV export feat(gradebook): add gradebook page with column picker and CSV export Jun 4, 2026
@LWS49 LWS49 force-pushed the lws49/feat-gradebook-export branch from 33def9e to 7eb8f5d Compare June 4, 2026 02:36
@LWS49 LWS49 changed the title feat(gradebook): add gradebook page with column picker and CSV export feat(gradebook): add gradebook page with column picker, CSV export, and statistics bridge Jun 4, 2026
@LWS49 LWS49 force-pushed the lws49/feat-gradebook-export branch from 3517914 to b3e0042 Compare June 4, 2026 04:16
@LWS49 LWS49 closed this Jun 8, 2026
@LWS49 LWS49 reopened this Jun 8, 2026
@LWS49 LWS49 force-pushed the lws49/feat-gradebook-export branch 5 times, most recently from 38ebf53 to 0e0e5ab Compare June 11, 2026 10:08
… links

Introduce the course gradebook: a frozen-column table of students × assessments
with a column picker, CSV export, and per-grade links into submissions.

Gradebook table
- Page with TanStack-backed table: pinned checkbox + Name columns, sticky
  header and Max Marks rows, frozen-column border seams that survive sticky
  scroll compositing.
- Column picker (assessments grouped by tab/category) and CSV export of the
  selected columns; empty-state hint when no data columns are chosen.
- External ID column, shown when any student has one.
- Grade cells link to the student's submission; a dismissible GradeLinkHint
  banner explains the affordance (persisted per-user via useDismissibleOnce).
- "Search students" global search.

Shared table builder
- getColumnCanGlobalFilter is gated on column visibility ("search what you
  see"): hiding a column via the picker removes it from search, and the
  nullable-first-row type sniff is bypassed. Affects all TanStack tables.

Backend
- Gradebook controller, ability and course component; index JSON serializes
  students, assessments, submissions (with submissionId) and gamification.
- Submission grade query also selects the submission id for grade links.

- Remove the redundant ScoreAssessmentSummary download from Statistics.
@LWS49 LWS49 force-pushed the lws49/feat-gradebook-export branch from 0e0e5ab to a7d8c0a Compare June 11, 2026 14:25
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