Duel Expansion, Cookie Consent & Legal Infrastructure
Very Easy Duel mode for beginners, Per-Problem Duels from any problem page, Duel Ratio replacing K/D, cookie consent banner with granular preferences, centralized legal versioning, and a refreshed Privacy Policy and Terms of Service.
- +Very Easy Duel mode: a beginner-friendly difficulty tier covering variables, arithmetic, basic I/O, simple conditionals, and counting. Fully integrated with the existing Elo & Duel Points engine.
- +Per-Problem Duel: a DUEL action button on individual problem pages that creates a locked 1-round Duel match using that specific problem. Problem identity and difficulty are derived server-side; clients cannot forge the difficulty.
- +Cookie Consent banner: non-intrusive, accessible UI with Accept All, Reject Optional, and Manage Preferences actions. Preferences are persisted to localStorage (versioned) and synced server-side for authenticated users.
- +Cookie Preferences Modal: granular toggles for Necessary (always on), Functional, and Analytics cookie categories with ARIA switch roles.
- +Privacy Choices button in the site footer, allowing users to reopen the Cookie Preferences Modal at any time.
- +POST /api/user/legal-consent: server-authoritative endpoint for recording cookie consent preferences and/or full Privacy Policy + Terms of Service re-consent.
- +GET /api/user/legal-consent: endpoint returning the user's current consent status against active legal document versions.
- +Centralized legal version configuration (src/config/legal.ts) with CURRENT_PRIVACY_POLICY_VERSION, CURRENT_TERMS_VERSION, CURRENT_COOKIE_POLICY_VERSION constants and checkUserConsentStatus helper.
- ~K/D Ratio renamed to Duel Ratio across all user-facing UI, profile stats, Stats page, and API payloads. Calculation (Wins / Losses) and safe zero-loss handling preserved.
- ~Privacy Policy updated to accurately disclose: OAuth disconnect, voluntary account deletion, Duel competitive metrics (Elo, Duel Points, Duel Rank, Duel Ratio), and cookie/consent data collection.
- ~Terms of Service updated to cover: Duel Ratio and Elo manipulation as prohibited conduct, voluntary account self-deletion rights, and expanded progress revocation scope.
- ~Duel difficulty enum extended to include 'Very Easy' across Question, DuelRoom, and DuelRound models.
- !Per-Problem Duel difficulty derived exclusively from the server-fetched problem record: client-supplied difficulty is ignored to prevent match difficulty forgery.
- !Cookie consent version validated server-side on every POST to /api/user/legal-consent; version mismatches return 409 Conflict.
- =User schema extended with cookiePolicyVersion, consentVersion, cookieConsent (nested object), and legalConsent (nested object with versioned fields).
- =DuelRoom and DuelRound difficulty enum updated to include 'Very Easy'.
- =Question difficulty enum updated to include 'Very Easy' with 16 foundational problems categorized.