Skip to content

Gamification: Quiz XP — 5 XP on first quiz pass #78

Description

@ljm20088

Parent PRD

#41

What to build

Award XP for quizzes. End-to-end: when a student passes a quiz for the first time, a 5 XP event is recorded; retaking or re-passing the same quiz awards nothing further.

  • Extend quizScoringService.computeResult to record a 5 XP quiz_pass event as a side effect when the attempt passes AND no prior quiz_pass XP event exists for that quiz/user. See PRD "XP Awards" and user story 15.
  • Reuse the xp_events table and award/dedup helper from the XP foundation slice.

Acceptance criteria

  • Passing a quiz for the first time records exactly one 5 XP event
  • Failing a quiz records no XP
  • Re-passing or retaking an already-passed quiz records no additional XP
  • Total XP / level (sidebar) reflect quiz XP
  • Tests cover first-pass award, no-XP-on-fail, and no-XP-on-retake
  • pnpm test and typecheck pass

Blocked by

User stories addressed

  • User story 2
  • User story 15

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions