Skip to content

Web optimisations - #115

Closed
Intern24601 wants to merge 41 commits into
thoth-tech:11.0.xfrom
ontrack-features-t2-2026:feature/peer-progress-indicator-JE-live
Closed

Intern24601 wants to merge 41 commits into
thoth-tech:11.0.xfrom
ontrack-features-t2-2026:feature/peer-progress-indicator-JE-live

Conversation

@Intern24601

Copy link
Copy Markdown

Made minor web Optimisations

maplefoxgit and others added 30 commits August 3, 2026 12:27
Updated the pull request template to include sections for Jira ticket, summary, testing, and security impact.
…uest-template

Revise pull request template for clarity and completeness
…ith-11.0.x

chore(ppi): sync shared API branch with 11.0.x
Adds `rake db:ppi_sample_data`, creating a deterministic minimum test
data set for testing the Peer Progress Indicator dashboard: 2 units,
2 classes of 16 students per unit (4 students per target grade —
Pass/Credit/Distinction/High Distinction), and 7 tasks per unit with
completion rates scaled by target grade so percentages are clearly
distinguishable across grade bands.

Verified against the local dev environment: both units created
successfully with 32 students and 7 tasks each, and completion
percentages visibly differ by grade band in the Students tab.
Adds a permanent technical reference documenting where the Peer
Progress Indicator's response fields actually come from in the
backend, so PPI-B01, PPI-F01, PPI-S01 and future contributors don't
have to rediscover it.

Builds on the earlier PPI API discovery task (preserved here as a
companion doc), which found the reusable aggregation infrastructure
existed but wasn't reachable by students. This document goes further:
it reviews the real, unmerged implementation on
ppi/student-progress-endpoint (PPI-B01) and maps all 9 response
fields to their exact source file/method, availability status, any
transformation applied, and the ticket that owns each one.

Includes a Mermaid data-flow diagram traced from the actual code
(auth -> authorised project -> task validation -> server-side
target-grade lookup -> nightly cohort aggregation -> small-cohort
suppression -> percentage quantisation -> safe response -> frontend
adapter -> existing widget), safe example responses for four business
states, and a recorded list of concrete gaps found while reviewing
the branch (unset config env vars, no unit has PPI enabled yet, a
frontend/backend target-grade parameter mismatch, two frontend
branches that independently renamed the same model, and a backfill
migration that will blank every existing snapshot on first deploy).

Does not implement the endpoint, frontend adapter, or any of the
other PPI-* work explicitly out of scope for this ticket.
Quantising into buckets of B only hides the underlying count while B is
strictly wider than one student's share of the cohort, 100.0 / cohort_size.
A floor of 5 with a 5-point bucket satisfied neither side of that: for every
cohort from 5 to 20 the mapping was injective and the returned percentage
inverted to an exact submitted count.

Move to a floor of 20 and a 10-point bucket, which leaves no cohort at or
above the floor from which the count can be recovered, and add two tests that
pin the relationship so the constants cannot drift apart again.

Also scope the nightly aggregation to units that actually enabled the feature,
rather than storing derived cohort statistics for every active unit and never
serving them.

Docs updated: the bucket size, the example response, the configuration floor,
and the genuine-zero row, which is no longer true now that a small count also
rounds to zero.
…ress-endpoint

feat(ppi): add student-authorised task-level peer-progress API
…le-dashboard-testdata

feat: add rake task to seed PPI sample dashboard test data
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.

5 participants