Repository navigation
Add shared grading, progress and learning-gain logic - #6
Merged
Merged
Conversation
Section 5, 6 and 7 endpoints all need the same unlock, grading and gain rules. Keeping them as pure functions in the shared layer means one tested definition, and the key builders give both teammates one source of truth for DynamoDB key shapes.
|
👋 Quick PR hygiene check (nothing is blocked):
Small PRs with short, clear descriptions are what judges and recruiters read. See |
This was referenced Nov 14, 2026
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.
What changed
Pure-Python modules in the shared layer, with 20 new tests (39 total):
keys.py: DynamoDB key builders (single source of truth for key shapes) andsafe_id, which blocks key injection through path IDs.grading.py: server-side grading for mcq, multi, short and numeric questions, per-concept points, and strict validation of submitted answers.progress.py: activity and module states, sequential unlocking,catch_upmodules before a late joiner's start module, and the resume pointer (architecture.md 7.1 and 7.2).gain.py: per-student, class and per-concept gain, normalized gain,nvsnEnrolled,lowItemCount, and small-group suppression (n < 5) for the read API (7.5).Why
The student player, instructor reports and read API all need the same rules. One tested definition keeps the numbers consistent.
How to test
cd backend && npm run test:pyStacked on #5 (base is
feat/backend-foundation). Merge #5 first.