Skip to content

Feat/motivation features - #103

Open
udaykiran-404 wants to merge 2 commits into
vicharanashala:mainfrom
udaykiran-404:feat/motivation-features
Open

Feat/motivation features#103
udaykiran-404 wants to merge 2 commits into
vicharanashala:mainfrom
udaykiran-404:feat/motivation-features

Conversation

@udaykiran-404

Copy link
Copy Markdown

Summary of Changes

Implemented 6 locked behavioral and gamification features to extend the Spurti Motivation Engine with agency, self-regulation, and engagement mechanisms.


Core Features Added

  1. Streaks Engine 🔥

    • Tracks consecutive attendance qualifications (present $\ge 75%$ and answering $\ge 75%$ of polls when launched).
    • Streak counters are rendered live in the student Level Tiles dashboard.
    • Automatically awards an SP Shield for every 10 consecutive qualified sessions.
  2. SP Shield 🛡️

    • Added a Shield Shop card and transaction type. Students can purchase shields for 30 SP (capped at 3 shields max).
    • Restricted shield purchases to only 1 shield per week (7 days).
    • Automatically consumes a shield to protect streaks during missed/failed sessions and awards baseline attendance points (+5 SP).
  3. Weekly Goal & Reflections 🎯✍️

    • Created a new Reflection schema.
    • Added a new Goals & Reflections tab in the client UI.
    • Allows setting weekly SP targets with a dynamic, beautiful progress bar displaying SP Earned, SP Remaining, and completion percentage.
    • Students can submit a weekly self-reflection text to claim a +5 SP reward.
  4. Recovery Missions 🌟

    • Automatically triggers a comeback mission for students whose streaks reset.
    • Requires 3 consecutive qualified sessions to recover +15 SP. Progress is displayed via a progress card in the student pulse grid.
  5. Badge Gallery 🏆

    • Added a comprehensive Badge Gallery representing 8 system achievements.
    • Displays description and visual indicator showing unlocked badges (vibrant color) vs locked badges (translucent with a 🔒 lock icon).
  6. Educator Nudges 📢

    • Enabled admins to send custom nudges directly to student dashboards.
    • Students receive unread notifications in a prominent header alert banner with a "Dismiss" action.

Technical Architecture Updates

  • Models: Updated Student.js and SPTransaction.js, and created Reflection.js.
  • Scoring Pipeline: Patched sp-rubric-build-mirror.cjs to query manual/shop transactions and run streaks/shield/mission logic sequentially from scratch (maintains idempotent replay capability).
  • Server APIs: Added endpoints for purchase, goals, submissions, admin nudging, and read triggers in server.js.
  • Security/Local Auth: Added X-Student-Email headers to facilitate action requests (goals/shop) under local student search confirmation modes.
  • Frontend & Styling: Designed and integrated tab navigation, components, progress bars, grid layouts, and styles in main.jsx and styles.css.

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