Skip to content

Extract mastery threshold constants to shared file #51

Description

@atbrace

Problem

The threshold 85 appears in 3+ locations across the codebase: readiness calculator weak-topic filter, mastery utils display functions, and readiness level determination. The 65 ("approaching") threshold is similarly scattered. Magic numbers in multiple files will drift out of sync.

Solution

Extract into a shared constants file (e.g. src/lib/assess/constants.ts or src/lib/utils/constants.ts):

export const MASTERY_THRESHOLD = 85;      // "exam ready"
export const APPROACHING_THRESHOLD = 65;  // "approaching" readiness

Update all callsites to import from that file.

Files Affected

  • src/lib/progress/calculator.ts
  • src/lib/utils/mastery.ts
  • src/components/ui/progress-indicator.tsx

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3-lowLow prioritychoreMaintenance and toolingeffort/medium30min - 2hrenhancementNew feature or requestneeds-criteriaNeeds acceptance criteria defined

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions