Skip to content

Add shared grading, progress and learning-gain logic - #6

Merged
iamharshtita merged 1 commit into
feat/backend-foundationfrom
feat/domain-logic
Nov 14, 2026
Merged

iamharshtita merged 1 commit into
feat/backend-foundationfrom
feat/domain-logic

Conversation

@iamharshtita

Copy link
Copy Markdown
Collaborator

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) and safe_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_up modules 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, n vs nEnrolled, 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:py

Stacked on #5 (base is feat/backend-foundation). Merge #5 first.

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.
@github-actions

Copy link
Copy Markdown

👋 Quick PR hygiene check (nothing is blocked):

  • 608 changed lines — PRs under 400 lines get reviewed and merged faster; consider splitting the next one.

Small PRs with short, clear descriptions are what judges and recruiters read. See AGENTS.md.

@iamharshtita
iamharshtita merged commit ee474a3 into feat/backend-foundation Nov 14, 2026
1 check passed
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