Skip to content

feat(gradebook): keep-highest N for equal-mode tabs + pin expanded rows#8438

Open
LWS49 wants to merge 2 commits into
lws49/feat-gradebook-weighted-viewfrom
lws49/feat-gradebook-weighted-view-pin-expanded-and-add-keep-n
Open

feat(gradebook): keep-highest N for equal-mode tabs + pin expanded rows#8438
LWS49 wants to merge 2 commits into
lws49/feat-gradebook-weighted-viewfrom
lws49/feat-gradebook-weighted-view-pin-expanded-and-add-keep-n

Conversation

@LWS49

@LWS49 LWS49 commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds two features to the weighted gradebook view. First, instructors can configure a per-tab keep-highest limit in equal mode: after enabling it for a tab, only the top N submission ratios count toward that tab's subtotal - the rest are dropped as lowest. The limit only applies in equal mode (custom mode exposes per-assessment weights instead) and is stored as a new gradebook_keep_highest column on course_assessment_tabs. Second, the per-student score breakdown panel now pins to one open row at a time - expanding a second student collapses the first, keeping the table readable at scale.

Design decisions

  • Keep-highest operates on ratios (grade/maxGrade), not raw points - ensures fairness when assessments have different max grades, consistent with how equal-mode averaging already works
  • Dropped assessments display 0 in points mode and their actual grade percentage in percentage mode (not em-dash like excluded assessments) - 0 makes the contribution to the weighted total legible; the actual grade stays visible so instructors can see what was dropped
  • keepHighest is reset to 0 when switching a tab from equal to custom mode (backend enforces this) - custom mode has per-assessment weights which serve the same purpose; keeping a stale value would produce confusing results

Regression prevention

Covers: keep-highest ratio selection and averaging, ties at the boundary, keepHighest > included (no drop), keepHighest=0 equality with legacy average, composition with per-assessment exclusion, dropped-vs-excluded display distinction in points and percentage modes, pin-to-one-expanded behaviour, keyboard focus retention on toggle, auto-scroll on expand, keepHighest round-trip through the Redux reducer, model validation (non-negative integer), controller permit and serialisation.

Manual testing: confirmed all scenarios above including keep-highest in equal mode, custom mode hiding the control, disabled state with one included assessment, save/reload persistence, dropped label and value rendering, and pin-expanded collapse behaviour.

Backward compat: tabs with no gradebook_keep_highest value default to 0, which preserves existing averaging behaviour exactly.

@LWS49 LWS49 changed the base branch from master to lws49/feat-gradebook-weighted-view June 15, 2026 02:33
@LWS49 LWS49 force-pushed the lws49/feat-gradebook-weighted-view branch 7 times, most recently from 422b4af to 44284da Compare June 15, 2026 06:02
@LWS49 LWS49 force-pushed the lws49/feat-gradebook-weighted-view-pin-expanded-and-add-keep-n branch 2 times, most recently from df2ffce to 95135ce Compare June 15, 2026 07:11
@LWS49 LWS49 changed the title Lws49/feat gradebook weighted view pin expanded and add keep n feat(gradebook): keep-highest N for equal-mode tabs + pin expanded rows Jun 15, 2026
@LWS49 LWS49 force-pushed the lws49/feat-gradebook-weighted-view branch 2 times, most recently from 2d24331 to 4c71a02 Compare June 15, 2026 09:55
@LWS49 LWS49 force-pushed the lws49/feat-gradebook-weighted-view-pin-expanded-and-add-keep-n branch from 95135ce to f875efc Compare June 15, 2026 10:00
@LWS49 LWS49 force-pushed the lws49/feat-gradebook-weighted-view branch 2 times, most recently from 7d9fdb4 to ade1ddf Compare June 16, 2026 07:12
@LWS49 LWS49 force-pushed the lws49/feat-gradebook-weighted-view-pin-expanded-and-add-keep-n branch 2 times, most recently from d4cb3aa to 72edac9 Compare June 17, 2026 06:13
@LWS49 LWS49 force-pushed the lws49/feat-gradebook-weighted-view branch 2 times, most recently from 521efed to 2efbb02 Compare June 17, 2026 06:45
LWS49 added 2 commits June 17, 2026 14:49
Expanding a student in the weighted gradebook now keeps that student's
summary row pinned beneath the sticky header while their per-assessment
breakdown is open, so the totals stay visible while scrolling the detail.

The view becomes a single-open accordion (opening one student collapses
any other), the focused row auto-scrolls to just under the header on
expand (respecting prefers-reduced-motion), and focus stays on the
expand/collapse toggle for keyboard users.
- Permit keepHighest in update_weights_params
- Parse keepHighest from request and pass to bulk_update via keep_highest
- Echo keepHighest in serialize_weight_updates response
- Serialize keepHighest from contribution in index.json.jbuilder
- Add controller tests: round-trip persist and index response
- Add model tests: bulk_update persists keep_highest in equal mode
@LWS49 LWS49 force-pushed the lws49/feat-gradebook-weighted-view-pin-expanded-and-add-keep-n branch from 72edac9 to 07a4215 Compare June 17, 2026 06:49
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