diff --git a/backend/pragativeer-prd.pdf b/backend/pragativeer-prd.pdf new file mode 100644 index 0000000..756db6b Binary files /dev/null and b/backend/pragativeer-prd.pdf differ diff --git a/cbt_test.html b/cbt_test.html new file mode 100644 index 0000000..52721cf Binary files /dev/null and b/cbt_test.html differ diff --git a/package-lock.json b/package-lock.json index 55343bf..9ef1a30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "react-markdown": "^10.1.0", "recharts": "^3.9.2", "rehype-katex": "^7.0.1", + "rehype-raw": "^7.0.0", "remark-math": "^6.0.0", "tailwind-merge": "^3.6.0", "zustand": "^5.0.14" @@ -4673,6 +4674,31 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/hast-util-raw": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.1.0.tgz", + "integrity": "sha512-Y8/SBAHkZGoNkpzqqfCldijcuUKh7/su31kEBp67cFY09Wy0mTRgtsLYsiIxMJxlu0f6AA5SUTbDR8K0rxnbUw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "@ungap/structured-clone": "^1.0.0", + "hast-util-from-parse5": "^8.0.0", + "hast-util-to-parse5": "^8.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "parse5": "^7.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/hast-util-to-jsx-runtime": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz", @@ -4700,6 +4726,25 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/hast-util-to-parse5": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.1.tgz", + "integrity": "sha512-MlWT6Pjt4CG9lFCjiz4BH7l9wmrMkfkJYCxFwKQic8+RTZgWPuWxwAfjJElsXkex7DJjfSJsQIt931ilUgmwdA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/hast-util-to-text": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/hast-util-to-text/-/hast-util-to-text-4.0.2.tgz", @@ -4779,6 +4824,16 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/html-void-elements": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", + "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/idb-keyval": { "version": "6.2.6", "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-6.2.6.tgz", @@ -7409,6 +7464,21 @@ "katex": "cli.js" } }, + "node_modules/rehype-raw": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-7.0.0.tgz", + "integrity": "sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-raw": "^9.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-math": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/remark-math/-/remark-math-6.0.0.tgz", diff --git a/package.json b/package.json index 87ede3f..743bf3b 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "react-markdown": "^10.1.0", "recharts": "^3.9.2", "rehype-katex": "^7.0.1", + "rehype-raw": "^7.0.0", "remark-math": "^6.0.0", "tailwind-merge": "^3.6.0", "zustand": "^5.0.14" diff --git a/parse.js b/parse.js new file mode 100644 index 0000000..3641264 --- /dev/null +++ b/parse.js @@ -0,0 +1,9 @@ + +import { unified } from "unified"; +import remarkParse from "remark-parse"; +import remarkMath from "remark-math"; + +const text = "C) $2 \\text{ m}$"; +const tree = unified().use(remarkParse).use(remarkMath).parse(text); +console.log(JSON.stringify(tree, null, 2)); + diff --git a/parse2.js b/parse2.js new file mode 100644 index 0000000..b568680 --- /dev/null +++ b/parse2.js @@ -0,0 +1,18 @@ + +import { unified } from "unified"; +import remarkParse from "remark-parse"; +import remarkMath from "remark-math"; +import rehypeKatex from "rehype-katex"; +import remarkRehype from "remark-rehype"; +import rehypeStringify from "rehype-stringify"; + +const text = "The velocity of a particle moving along the x-axis is given by $v(t) = \\int_{0}^{t} (3\\tau^2 - 2\\tau) d\\tau$. What is the displacement of the particle at $t = 2$ seconds if it starts from the origin?"; +const tree = unified() + .use(remarkParse) + .use(remarkMath) + .use(remarkRehype) + .use(rehypeKatex, { strict: "warn", throwOnError: false }) + .use(rehypeStringify) + .processSync(text); +console.log(tree.toString()); + diff --git a/prd_dump.txt b/prd_dump.txt new file mode 100644 index 0000000..65da02d Binary files /dev/null and b/prd_dump.txt differ diff --git a/prd_dump_utf8.txt b/prd_dump_utf8.txt new file mode 100644 index 0000000..0dffa04 --- /dev/null +++ b/prd_dump_utf8.txt @@ -0,0 +1,1385 @@ +PragatiVeer +Product Requirements Document +India's first AI-powered daily practice platform for JEE & NEET +Version: 1.0 +Date: 1 July 2026 +Author: Maya — CEO's Office, Gyannetra Pvt Ltd +Approved by: Kapil Panwar (CEO) +Status: ✅ Final +CONFIDENTIAL — GYANNETRA PROPRIETARY +Gyannetra Pvt Ltd • Pune, India +PragatiVeer — Product Requirements +Document (PRD) +Version: 1.0 +Date: 1 July 2026 +Author: Maya — CEO's Office, Gyannetra Pvt Ltd +Status: Final (Approved by Kapil Panwar, CEO) +Table of Contents +Product Overview +Target Audience & Personas +Tier Structure & Pricing +Feature Catalog — Free Tier +Feature Catalog — Pro Plan +Feature Catalog — AI Coach Plan +Cross-Cutting Features +User Stories — Complete Collection +User Flows +Technical Requirements +Data Model (Key Entities) +1. Product Overview +1.1 Vision Statement +PragatiVeer is India's first AI-powered daily practice platform for JEE & NEET aspirants. It combines +daily practice sheets, computer-based test series, and an AI coach that personalizes every student's +learning journey — all through a web-based portal accessible on any device. +1.2 Product Mission +To make high-quality, personalized JEE/NEET preparation accessible and affordable for every Indian +student — especially in Tier 2/3 cities where quality coaching is out of reach. +1. +2. +3. +4. +5. +6. +7. +8. +9. +10. +11. +PragatiVeer — Product Requirements Document +Page 2 of 27 +1.3 Key Differentiators +Differentiator +Description +Daily Practice Loop +DPS every day builds discipline, not cramming +AI Personalization +Tracks every DPS, every test, every mistake — adapts to the student +Exam-Realistic Testing +Computer-based tests exactly like JEE Main/Advanced pattern +Affordable Pricing +₹299/mo for Pro vs ₹5K-15K for Physics Wallah +Parent Dashboard +Real-time progress visibility for parents (the actual buyers) +1.4 Platform +Web-based only (no mobile app) +Fully responsive — works seamlessly on mobile browsers, tablets, and desktops +PWA (Progressive Web App) capabilities for offline access and home-screen install +1.5 Scope — Exams Covered (Phase 1) +JEE Main (Paper 1: B.E./B.Tech) +JEE Advanced +NEET UG +2. Target Audience & Personas +2.1 Primary Persona: Rohan (Student, Class 12) +Attribute +Detail +Age +17 +Location +Tier 2 city (Jaipur) +Goal +JEE Main + Advanced 2027 +Medium +Hindi medium school, studies in English + Hindi mix +Device +Android phone (primary), shared family laptop (occasional) +Internet +4G, sometimes unstable +Pain Points +Coaching is expensive (₹50K+/yr), no daily practice structure, doesn't know where he stands +Behavior +Uses Telegram for study groups, watches PW videos on YouTube, solves PYQs from books +• +• +• +• +• +• +PragatiVeer — Product Requirements Document +Page 3 of 27 +2.2 Secondary Persona: Mrs. Sharma (Parent) +Attribute +Detail +Age +45 +Role +Mother of a Class 12 JEE aspirant +Location +Delhi NCR +Device +Smartphone (WhatsApp, basic browsing) +Pain Points +Worried about child's preparation, doesn't know if child is on track, coaching is too expensive +Decision Trigger +Seeing concrete progress data — "Mera bachcha kitna padh raha hai?" +2.3 Tertiary Persona: Mr. Verma (School Principal) +Attribute +Detail +Role +Principal, CBSE-affiliated school in Indore +Need +Affordable practice platform for 500+ students +Decision Factor +Bulk pricing, white-label option, school performance dashboard +3. Tier Structure & Pricing +3.1 Pricing (Final — Neha Gupta's Model) +Tier +Monthly +Quarterly +Annual +Per Month (Annual) +Free +₹0 +— +₹0 +₹0 +Pro +₹299 +₹749 (₹250/mo) +₹2,499 (₹208/mo) +₹208 +AI Coach +₹599 +₹1,499 (₹500/mo) +₹4,999 (₹417/mo) +₹417 +3.2 Launch Offers +Pro Launch: First month at ₹99 (vs ₹299 regular) +Annual AI Coach: 30% off + 2 months free +Referral: Invite a friend → both get 7 days of AI Coach free +School Bulk: ₹499/student/yr for 100+ students +Sibling Discount: 20% off on second child +• +• +• +• +• +PragatiVeer — Product Requirements Document +Page 4 of 27 +3.3 Tier Comparison Matrix +Feature +Free +Pro +AI Coach +Daily Practice Sheets (1/day) +✅ +✅ Unlimited +✅ Unlimited +Answer Keys +✅ +✅ +✅ +Basic Progress Dashboard +✅ +✅ +✅ +Streak Tracking +✅ +✅ +✅ +Leaderboard (City/School) +✅ +✅ +✅ +Topic-wise Micro-tests +✅ (5/day) +✅ (Unlimited) +✅ (Unlimited) +Weekly Test Series +❌ +✅ +✅ +Full-Length Mock Tests +❌ +✅ (4/month) +✅ (Unlimited) +Previous Year Papers +❌ +✅ +✅ +Detailed Performance Analytics +❌ +✅ +✅ +Chapter-wise Progress +❌ +✅ +✅ +Doubt Resolution (Community) +❌ +✅ +✅ +Parent Dashboard +❌ +✅ +✅ +AI Mistake Tracking +❌ +❌ +✅ +Spaced Repetition +❌ +❌ +✅ +Personalized Daily Study Plan +❌ +❌ +✅ +AI Tutor Chat +❌ +❌ +✅ +Exam Readiness Score +❌ +❌ +✅ +Exam Day Strategy +❌ +❌ +✅ +College Predictor +❌ +❌ +✅ +Study Time Optimization +❌ +❌ +✅ +Offline Mode (Download DPS) +❌ +✅ +✅ +Print-Friendly PDF Export +❌ +✅ +✅ +4. Feature Catalog — Free Tier +F-01: User Registration & Login +Description: Self-service registration with email/phone + OTP. Google login optional. Priority: P0 +(Launch-blocking) +PragatiVeer — Product Requirements Document +Page 5 of 27 +Requirements: - Register with email OR phone number - OTP-based verification - Google OAuth login +- Password-based login (email + password) - Forgot password flow (email/OTP reset) - Session +management (stay logged in for 30 days) - Single session per user (logout from other devices option) +F-02: Student Profile +Description: Basic profile capturing student's exam target, class, and medium. Priority: P0 +Requirements: - Name, email, phone - Class (11, 12, Dropper) - Target exam (JEE Main, JEE +Advanced, NEET) - Medium (English, Hindi, Bilingual) - School name (optional) - City/State - Avatar/ +photo upload - Profile completion progress bar +F-03: Daily Practice Sheet (DPS) +Description: One DPS per day with 10-15 questions covering mixed topics. Priority: P0 (Core feature) +Requirements: - 10-15 questions per DPS (mix of Physics, Chemistry, Maths/Biology) - Questions +displayed one at a time with navigation - Multiple choice (single correct, multiple correct) - Numerical +answer type - Timer per DPS (configurable, default 20 min) - Submit and get instant answer key - Mark +questions for review - Question palette (answered, not answered, marked for review) - Auto-submit on +timer expiry - DPS resets daily at 6:00 AM IST - Cannot attempt previous day's DPS (creates urgency) +F-04: Answer Key & Basic Solutions +Description: Instant answer key after DPS submission with correct answers. Priority: P0 +Requirements: - Show correct answer for each question immediately after submission - Highlight +user's answer vs correct answer - Show score (X/15) - Show time taken per question - Basic solution +text (not video) - Option to flag confusing questions +F-05: Basic Performance Dashboard +Description: Simple dashboard showing daily and weekly performance. Priority: P0 +Requirements: - Today's DPS score - 7-day accuracy trend (line chart) - Total questions attempted +(lifetime) - Overall accuracy percentage - Streak count (consecutive days) - "You're on a X-day streak!" +message +F-06: Streak Tracking +Description: Track consecutive days of DPS completion. Priority: P0 +Requirements: - Calendar view showing which days DPS was completed - Current streak count - +Longest streak record - Streak milestones (7 days, 30 days, 60 days, 100 days) - Streak milestone +badges - Daily reminder notification (browser/email) +F-07: Leaderboard +Description: Gamified ranking among peers. Priority: P1 +PragatiVeer — Product Requirements Document +Page 6 of 27 +Requirements: - City-wise leaderboard - School-wise leaderboard (if school provided) - All-India +leaderboard - Based on: accuracy × consistency (streak bonus) - Weekly reset - Top 10 visible, user +sees their own rank - Anonymous display (usernames only) +F-08: Topic-wise Micro-tests +Description: Short 5-question tests on specific topics. Priority: P1 +Requirements: - 5 questions per micro-test - Choose topic from syllabus tree (e.g., Physics → +Electrostatics → Coulomb's Law) - 5-minute timer - Instant results with topic-wise accuracy - Unlimited +attempts (Free: 5 micro-tests/day) - Recommended topics based on DPS performance +5. Feature Catalog — Pro Plan +P-01: Unlimited DPS +Description: Access to all DPS without daily limit. Multiple DPS per day. Priority: P0 +Requirements: - All Free tier DPS features - Unlimited DPS per day - Access to DPS archive (previous +days) - DPS difficulty levels (Easy, Medium, Hard) - Custom DPS: student picks subjects and topics - +DPS bookmarking for later +P-02: Weekly Test Series +Description: Full-length computer-based tests every week, increasing frequency near exams. Priority: +P0 (Core Pro feature) +Requirements: - One full-length test per week (standard frequency) - Increases to 2/week in last 3 +months before exam - Daily tests in last month before exam - Exact JEE Main/Advanced/NEET pattern +- Computer-based test interface (CBT) - Sectional timing (as per actual exam) - Question palette with +color coding - Mark for review - Change answer within section - Calculator (on-screen, basic) - Periodic +table reference (for Chemistry) - Scratchpad (digital notepad) - Auto-submit on section timer expiry - +Submit entire test manually - Instant score report +P-03: Full-Length Mock Tests (4/month) +Description: Additional full-length mocks beyond the weekly series. Priority: P1 +Requirements: - 4 full-length mocks per month (in addition to weekly series) - Can be taken anytime - +Same interface as weekly tests - Different difficulty levels - Previous year paper simulations +P-04: Previous Year Paper Bank +Description: Complete archive of JEE Main, JEE Advanced, and NEET previous year papers. Priority: +P0 +PragatiVeer — Product Requirements Document +Page 7 of 27 +Requirements: - JEE Main: 2020-2026 papers - JEE Advanced: 2020-2025 papers - NEET UG: +2020-2025 papers - Attempt in test mode (timed) or practice mode (untimed) - Topic-wise filtering of +PYQs - Difficulty tagging per question - Solution links for each question - Track which PYQs have been +attempted +P-05: Detailed Performance Analytics +Description: Comprehensive analytics dashboard with heatmaps, trends, and insights. Priority: P0 +Requirements: - Topic Heatmap: Subject × Topic grid showing accuracy (green/yellow/red) - +Accuracy Trend: Line chart over time (daily, weekly, monthly) - Speed Analysis: Average time per +question vs benchmark - Strength/Weakness Report: Auto-generated list of strong and weak topics - +Percentile Rank: Among all Pro users - Score Distribution: Histogram of test scores - Improvement +Rate: Week-over-week accuracy change - Subject-wise Breakdown: Physics %, Chemistry %, Maths/ +Biology % - Question Type Analysis: Performance by question type (MCQ, numerical, multiple +correct) - Export analytics as PDF +P-06: Chapter-wise Progress Tracking +Description: Track syllabus coverage and mastery per chapter. Priority: P1 +Requirements: - Complete syllabus tree for JEE/NEET - Per-chapter: questions attempted, accuracy, +time spent - Chapter status: Not Started, In Progress, Practiced, Mastered - Syllabus completion +percentage - Estimated time to complete remaining syllabus - Recommended next chapters based on +dependency graph +P-07: Parent Dashboard +Description: Simplified dashboard for parents to monitor their child's progress. Priority: P0 (Sales- +critical) +Requirements: - Separate login for parents (linked to student account) - Weekly progress summary +(auto-generated) - Daily time spent on platform - Accuracy trend (last 7/30 days) - Tests taken this +week/month - Rank improvement trend - "Areas of Concern" — topics where child is weak - +Comparison with peers (anonymous) - WhatsApp/Email weekly report (automated) - Multiple children +support (add multiple students) - Simple, non-technical UI (Hindi + English) +P-08: Doubt Resolution (Community) +Description: Text-based doubt solving with community + moderator support. Priority: P1 +Requirements: - Post a doubt (text + screenshot/image) - Tag by subject and topic - Community +answers (upvote/downvote) - Moderator-verified answers highlighted - 24-hour SLA for moderator +response - Searchable doubt archive - "My Doubts" history - Notification when doubt is answered +P-09: Print-Friendly DPS Export +Description: Download DPS as PDF for offline solving. Priority: P1 +PragatiVeer — Product Requirements Document +Page 8 of 27 +Requirements: - PDF export of any DPS - Print-optimized layout - Answer key on separate page - +Watermark with student name (prevents sharing) - Batch download (multiple DPS) +6. Feature Catalog — AI Coach Plan +A-01: AI Mistake Tracking & Analysis +Description: AI tracks every mistake across all DPS, tests, and micro-tests — builds a permanent error +profile. Priority: P0 (Core AI feature) +Requirements: - Every wrong answer logged with: question, topic, subtopic, error type - Error type +classification: conceptual error, calculation error, reading error, time pressure error - Mistake frequency +per topic - Recurring mistake patterns ("You keep making sign errors in Thermodynamics") - Mistake +history (searchable, filterable) - "Your Most Common Mistakes" weekly report - Mistake count vs peers +benchmark +A-02: Spaced Repetition System +Description: Wrong answers are queued for re-attempt at optimal intervals using spaced repetition +algorithm. Priority: P0 +Requirements: - Every wrong question enters spaced repetition queue - Re-attempt schedule: Day 1, +Day 3, Day 7, Day 14, Day 30 - If answered correctly on re-attempt → interval increases - If answered +wrong again → resets to Day 1 - Daily "Mistake Review" session (5-10 questions from queue) - +Progress tracking per mistake (attempt 1/5, attempt 2/5, etc.) - Mastered mistakes removed from queue +after 3 consecutive correct attempts - SM-2 algorithm (SuperMemo) adapted for exam prep +A-03: Personalized Daily Study Plan +Description: AI generates a customized daily study plan based on weak areas, upcoming exams, and +past performance. Priority: P0 +Requirements: - Generated every morning at 5:00 AM IST - Plan includes: DPS to attempt, topics to +revise, mistake review session, micro-test recommendations - Time-budgeted: "Today: 45 min — +Revise Thermodynamics (15 min) + DPS Electrostatics (20 min) + Mistake Review (10 min)" - Adaptive: +adjusts based on what was actually completed yesterday - Student can mark tasks as done/skipped - +Weekly study plan (Sunday generates plan for the week) - Plan difficulty calibrated to student's level - +"Cram Mode" activated near exams (more tests, less new learning) +A-04: AI Tutor Chat +Description: Text-based AI tutor that answers questions, explains concepts, and guides problem- +solving. Priority: P1 +Requirements: - Ask any doubt in natural language (text only) - AI responds with step-by-step +explanation - Can ask follow-up questions - Can request similar practice questions - Can ask "Why is +option C wrong?" for specific questions - Context-aware: AI knows student's weak areas and adapts +PragatiVeer — Product Requirements Document +Page 9 of 27 +explanations - Daily chat limit: 50 messages (to manage inference costs) - Chat history saved and +searchable - Hindi + English bilingual support - Moderation filter for inappropriate content +A-05: Exam Readiness Score +Description: A single 0-100 score predicting exam readiness based on multiple factors. Priority: P0 +Requirements: - Score calculated from: accuracy (40%), speed (20%), syllabus coverage (20%), +consistency (10%), mistake recovery (10%) - Daily update - Trend line (score over time) - Component +breakdown (which factor is pulling score down) - Peer comparison ("Your readiness score is higher than +65% of users") - Milestone celebrations (Score > 70: "You're on track for NIT!", Score > 85: "IIT within +reach!") - Actionable recommendations to improve score +A-06: Exam Day Strategy +Description: AI generates personalized exam-day strategy based on mock test performance. Priority: +P1 +Requirements: - Based on analysis of all mock tests - Recommendations include: - Optimal section +order ("Start with Physics — your strongest section") - Time allocation per section - Question selection +strategy ("Attempt numerical questions first in Chemistry") - Guessing strategy (when to skip vs +educated guess) - Pace recommendations ("You tend to slow down in the last 15 minutes — practice +timed sprints") - Updated after every mock test - Printable one-page strategy card +A-07: College Predictor +Description: Predicts likely colleges based on current performance trajectory. Priority: P1 +Requirements: - Based on mock test scores + historical JEE cutoff data - Predicts: IITs, NITs, IIITs, +GFTIs - "Reach" (ambitious), "Target" (realistic), "Safety" (likely) categories - Branch-wise prediction - +Updated after every mock test - Historical cutoff data for last 3 years - "You need X more marks to +reach IIT Delhi Computer Science" - Motivational: "At your current trajectory, you're on track for NIT +Surat" +A-08: Study Time Optimization +Description: AI analyzes when and how the student studies best and suggests schedule adjustments. +Priority: P2 +Requirements: - Track time-of-day performance (accuracy by hour) - Identify peak productivity hours - +Suggest optimal study schedule - Track session length vs focus (longer sessions = diminishing +returns?) - Recommend break intervals - "You perform best between 7-9 PM. Schedule your most +difficult topics then." +PragatiVeer — Product Requirements Document +Page 10 of 27 +7. Cross-Cutting Features +C-01: Responsive Web Design +Description: Full responsive design working on mobile browsers, tablets, and desktops. Priority: P0 +Requirements: - Mobile-first responsive design - Touch-optimized test interface (tap to select, swipe to +navigate) - Desktop keyboard shortcuts (N for next, P for previous, M for mark review) - Test interface +works in landscape and portrait - Minimum supported screen: 320px width - PWA manifest for "Add to +Home Screen" - Service worker for offline DPS access +C-02: Multi-Language Support +Description: Interface and content in Hindi, English, and bilingual mode. Priority: P1 +Requirements: - Full UI in English and Hindi - Bilingual mode (questions in English, UI in Hindi) - +Toggle between languages without page reload - All DPS questions available in both languages - AI +Coach responses in selected language - Parent dashboard in Hindi + English - Regional language +roadmap (Marathi, Gujarati, Bengali, Telugu — Phase 2) +C-03: Dark Mode +Description: Dark theme for late-night study sessions. Priority: P2 +Requirements: - Toggle between light and dark mode - System preference detection - All pages +support both themes - Test interface in dark mode - Persist preference in user settings +C-04: Notifications & Reminders +Description: Browser and email notifications for DPS, tests, and milestones. Priority: P1 +Requirements: - Daily DPS reminder (browser notification, configurable time) - Test reminder (24 hours +before, 1 hour before) - Streak at risk notification (if no DPS by 8 PM) - Milestone celebrations (streak +achievements, score milestones) - Weekly progress summary (email, Sunday evening) - Parent weekly +report (email/WhatsApp) - Notification preferences (which notifications, when, how) +C-05: Referral System +Description: Built-in referral program for organic growth. Priority: P1 +Requirements: - Unique referral link per user - Refer a friend → both get 7 days of AI Coach free - +Referral dashboard (total referrals, rewards earned) - Share via WhatsApp, Telegram, email, copy link - +Track referral signups and conversions - Leaderboard: top referrers +C-06: Shareable Progress Cards +Description: Auto-generated image cards showing progress that students can share on social media. +Priority: P1 +PragatiVeer — Product Requirements Document +Page 11 of 27 +Requirements: - "I've solved 450 questions this month!" card - "X-day streak!" card - "Accuracy: 78% +— Top 15% of users" card - "Test Score: 180/300 — Improved by 15 points" card - Branded with +PragatiVeer logo - Download as PNG - Share directly to WhatsApp, Instagram, Telegram - Generated +server-side (no client rendering) +C-07: Payment System +Description: Subscription management with UPI, cards, and netbanking. Priority: P0 +Requirements: - UPI (BHIM, Google Pay, PhonePe, Paytm) - Credit/Debit cards - Netbanking - +Razorpay/Stripe integration - Monthly, quarterly, and annual billing - Auto-renewal with 7-day grace +period - Invoice generation - Coupon code support - Free trial management (7-day Pro trial) - Upgrade/ +downgrade between tiers - Pause subscription (for exam breaks) - Refund policy (30-day money-back +guarantee) +C-08: Admin Dashboard +Description: Internal dashboard for Gyannetra team to manage content, users, and analytics. Priority: +P1 +Requirements: - User management (view, suspend, delete) - Content management (upload questions, +create DPS, schedule tests) - Analytics dashboard (DAU, MAU, conversion rates, revenue) - DPS +scheduling calendar - Test creation and scheduling - Question bank management (add, edit, tag, +review) - Coupon code management - Refund processing - Support ticket management - System health +monitoring +PragatiVeer — Product Requirements Document +Page 12 of 27 +8. User Stories — Complete Collection +8.1 Registration & Onboarding +ID +User Story +Priority +Tier +US-001 +As a new student, I want to register with my email or phone number so that I can +create my account quickly. +P0 +All +US-002 +As a new student, I want to verify my email/phone with OTP so that my account is +secure. +P0 +All +US-003 +As a returning student, I want to log in with my email and password so that I can +access my dashboard. +P0 +All +US-004 +As a returning student, I want to log in with Google so that I don't have to +remember another password. +P0 +All +US-005 +As a student, I want to reset my password via email/OTP so that I can recover my +account if I forget it. +P0 +All +US-006 +As a new student, I want to set up my profile (class, target exam, medium) during +onboarding so that the platform personalizes my experience. +P0 +All +US-007 +As a student, I want to see a welcome tour on my first login so that I understand +how to use the platform. +P1 +All +PragatiVeer — Product Requirements Document +Page 13 of 27 +8.2 Daily Practice Sheet (DPS) +ID +User Story +Priority +Tier +US-010 +As a Free student, I want to attempt one DPS per day so that I can practice daily. +P0 +Free +US-011 +As a Pro student, I want to attempt unlimited DPS per day so that I can practice as +much as I need. +P0 +Pro+ +US-012 +As a student, I want to see questions one at a time with navigation so that I can +focus on each question. +P0 +All +US-013 +As a student, I want to see a timer during my DPS so that I can manage my time. +P0 +All +US-014 +As a student, I want to mark questions for review so that I can come back to them +later. +P0 +All +US-015 +As a student, I want to see a question palette showing which questions I've +answered, not answered, and marked for review. +P0 +All +US-016 +As a student, I want my DPS to auto-submit when the timer runs out so that I don't +lose my answers. +P0 +All +US-017 +As a student, I want to see my score and correct answers immediately after +submitting so that I can learn from my mistakes. +P0 +All +US-018 +As a Pro student, I want to access DPS from previous days so that I can catch up +if I miss a day. +P1 +Pro+ +US-019 +As a Pro student, I want to choose DPS difficulty level so that I can challenge +myself appropriately. +P1 +Pro+ +US-020 +As a Pro student, I want to create a custom DPS by selecting specific subjects and +topics so that I can focus on my weak areas. +P1 +Pro+ +PragatiVeer — Product Requirements Document +Page 14 of 27 +8.3 Test Series +ID +User Story +Priority +Tier +US-030 +As a Pro student, I want to take a full-length weekly test that follows the exact JEE +pattern so that I can practice exam conditions. +P0 +Pro+ +US-031 +As a Pro student, I want the test frequency to increase as exams get closer so that +I get more practice when it matters most. +P0 +Pro+ +US-032 +As a student, I want the test interface to look exactly like the real computer-based +exam so that I'm not surprised on exam day. +P0 +Pro+ +US-033 +As a student, I want sectional timing (as per actual exam) so that I can practice +time management per section. +P0 +Pro+ +US-034 +As a student, I want an on-screen calculator and periodic table (where applicable) +so that the test mirrors the real exam. +P0 +Pro+ +US-035 +As a student, I want a digital scratchpad/notepad during the test so that I can do +rough work. +P1 +Pro+ +US-036 +As a Pro student, I want to take additional full-length mocks (4/month) beyond the +weekly series so that I can practice more. +P1 +Pro+ +US-037 +As a Pro student, I want to attempt previous year papers in test mode so that I can +practice with real exam questions. +P0 +Pro+ +US-038 +As a Pro student, I want to filter PYQs by topic so that I can practice specific +areas. +P1 +Pro+ +PragatiVeer — Product Requirements Document +Page 15 of 27 +8.4 Analytics & Progress +ID +User Story +Priority +Tier +US-040 +As a Free student, I want to see my basic accuracy and streak on a simple +dashboard so that I can track my progress. +P0 +Free +US-041 +As a Pro student, I want to see a topic-wise heatmap of my performance so that I +know exactly where I'm weak. +P0 +Pro+ +US-042 +As a Pro student, I want to see my accuracy trend over time so that I can see if I'm +improving. +P0 +Pro+ +US-043 +As a Pro student, I want to see my percentile rank among other users so that I +know where I stand. +P0 +Pro+ +US-044 +As a Pro student, I want to see my speed analysis (time per question vs +benchmark) so that I can improve my pace. +P1 +Pro+ +US-045 +As a Pro student, I want to see my performance broken down by question type so +that I know which types I struggle with. +P1 +Pro+ +US-046 +As a Pro student, I want to export my analytics as a PDF so that I can share it with +my parents or mentor. +P1 +Pro+ +US-047 +As a Pro student, I want to see my syllabus completion percentage per subject so +that I know how much I've covered. +P1 +Pro+ +PragatiVeer — Product Requirements Document +Page 16 of 27 +8.5 AI Coach +ID +User Story +Priority +Tier +US-050 +As an AI Coach student, I want the AI to track every mistake I make across all +DPS and tests so that I never forget my weak areas. +P0 +AI +Coach +US-051 +As an AI Coach student, I want the AI to classify my mistakes (conceptual, +calculation, etc.) so that I understand WHY I got it wrong. +P0 +AI +Coach +US-052 +As an AI Coach student, I want wrong questions to reappear at optimal +intervals (spaced repetition) so that I permanently learn from my mistakes. +P0 +AI +Coach +US-053 +As an AI Coach student, I want a daily "Mistake Review" session with 5-10 +questions from my error queue so that I consistently revise my weak areas. +P0 +AI +Coach +US-054 +As an AI Coach student, I want a personalized daily study plan generated every +morning so that I know exactly what to study today. +P0 +AI +Coach +US-055 +As an AI Coach student, I want the study plan to adapt based on what I actually +completed yesterday so that it stays relevant. +P0 +AI +Coach +US-056 +As an AI Coach student, I want to see my Exam Readiness Score (0-100) so +that I know how prepared I am. +P0 +AI +Coach +US-057 +As an AI Coach student, I want the readiness score to show component +breakdown so that I know which factor is pulling me down. +P0 +AI +Coach +US-058 +As an AI Coach student, I want to chat with the AI tutor to ask doubts and get +explanations so that I can learn at my own pace. +P1 +AI +Coach +US-059 +As an AI Coach student, I want the AI tutor to be context-aware (knows my +weak areas) so that explanations are personalized. +P1 +AI +Coach +US-060 +As an AI Coach student, I want a personalized exam day strategy based on my +mock performance so that I can maximize my score. +P1 +AI +Coach +US-061 +As an AI Coach student, I want a college predictor that shows which IITs/NITs I +can target so that I stay motivated. +P1 +AI +Coach +US-062 +As an AI Coach student, I want the AI to analyze my study patterns and +suggest optimal study times so that I study when I'm most effective. +P2 +AI +Coach +PragatiVeer — Product Requirements Document +Page 17 of 27 +8.6 Parent Dashboard +ID +User Story +Priority +Tier +US-070 +As a parent, I want to create my own login linked to my child's account so that I +can monitor progress without accessing their account. +P0 +Pro+ +US-071 +As a parent, I want to see a simple weekly progress summary so that I know if my +child is studying regularly. +P0 +Pro+ +US-072 +As a parent, I want to see my child's accuracy trend so that I can see if they're +improving. +P0 +Pro+ +US-073 +As a parent, I want to see "Areas of Concern" — topics where my child is weak so +that I can arrange extra help. +P0 +Pro+ +US-074 +As a parent, I want to receive a weekly WhatsApp/Email report automatically so +that I don't have to log in to check. +P0 +Pro+ +US-075 +As a parent, I want the dashboard to be in Hindi so that I can understand it easily. +P1 +Pro+ +US-076 +As a parent with two children preparing for exams, I want to track both from a +single parent account. +P1 +Pro+ +8.7 Gamification & Engagement +ID +User Story +Priority +Tier +US-080 +As a student, I want to see my daily streak so that I feel motivated to practice +every day. +P0 +All +US-081 +As a student, I want to earn badges for milestones (7-day streak, 100 questions, +etc.) so that I feel a sense of achievement. +P1 +All +US-082 +As a student, I want to see my rank on the city/school leaderboard so that I can +compete with peers. +P1 +All +US-083 +As a student, I want to share my progress card on social media so that my friends +can see my hard work. +P1 +Pro+ +US-084 +As a student, I want to challenge a friend to beat my test score so that we can +motivate each other. +P2 +Pro+ +US-085 +As a student, I want to receive a notification when I'm about to lose my streak so +that I don't break it. +P1 +All +PragatiVeer — Product Requirements Document +Page 18 of 27 +8.8 Payments & Subscription +ID +User Story +Priority +Tier +US-090 +As a Free student, I want to upgrade to Pro with UPI so that I can start my +subscription easily. +P0 +Pro+ +US-091 +As a Pro student, I want to choose between monthly, quarterly, and annual billing +so that I can pick what suits my budget. +P0 +Pro+ +US-092 +As a student, I want a 7-day free trial of Pro so that I can try before I buy. +P0 +Pro+ +US-093 +As a student, I want to apply a coupon code during checkout so that I can get a +discount. +P1 +Pro+ +US-094 +As a student, I want to receive an invoice for my payment so that I can show my +parents. +P1 +Pro+ +US-095 +As a student, I want to pause my subscription during exam breaks so that I don't +waste paid days. +P2 +Pro+ +US-096 +As a parent, I want a 30-day money-back guarantee so that I can purchase without +risk. +P1 +Pro+ +8.9 Referral & Growth +ID +User Story +Priority +Tier +US-100 +As a student, I want to refer a friend using my unique link so that both of us get free +AI Coach access. +P1 +All +US-101 +As a student, I want to see how many friends have signed up through my referral +so that I can track my rewards. +P1 +All +US-102 +As a student, I want to share my referral link on WhatsApp and Telegram so that I +can easily invite friends. +P1 +All +8.10 School/B2B +ID +User Story +Priority +Tier +US-110 +As a school principal, I want to purchase bulk licenses for my students so that they +all get Pro access at a discount. +P1 +B2B +US-111 +As a school principal, I want a school dashboard showing aggregate performance +of all students so that I can identify weak batches. +P1 +B2B +US-112 +As a teacher, I want to assign DPS or tests to my entire class so that they practice +together. +P2 +B2B +PragatiVeer — Product Requirements Document +Page 19 of 27 +9. User Flows +9.1 New Student Onboarding Flow +Landing Page → Sign Up (Email/Phone) → OTP Verification → +Profile Setup (Class, Exam, Medium) → Welcome Tour → +First DPS → See Results → Streak Started → +Upgrade Prompt (after 3 DPS completions) +9.2 Daily Practice Flow +Login → Dashboard → "Today's DPS" CTA → +Attempt DPS (10-15 Qs, timed) → Submit → +Instant Results (Score + Answer Key) → +Review Mistakes → Check Leaderboard → +Logout or Continue (Micro-test / Analytics) +9.3 Weekly Test Flow +Login → Dashboard → "Weekly Test Available" Notification → +Enter Test Lobby (instructions, pattern info) → +Start Test → Attempt Sections (timed per section) → +Submit → Score Report → Detailed Analytics → +Compare with Peers → AI Coach Analysis (if AI Coach tier) +9.4 AI Coach Daily Flow +Login → AI Coach Dashboard → +1. View Today's Personalized Plan +2. Complete Mistake Review Session (5-10 Qs) +3. Attempt Recommended DPS/Micro-test +4. Check Exam Readiness Score Update +5. Chat with AI Tutor (if doubts) +6. Mark Plan Tasks as Complete +→ Plan Adapts for Tomorrow +PragatiVeer — Product Requirements Document +Page 20 of 27 +9.5 Parent Flow +Parent Login (linked to student) → +Dashboard: Weekly Summary, Accuracy Trend, +Areas of Concern, Time Spent → +Drill Down into Specific Topics → +Share Report with Family → +Receive Weekly WhatsApp Report (automated) +9.6 Upgrade Flow (Free → Pro) +Free User → CTA: "Unlock Unlimited Practice" → +Pricing Page (Free vs Pro vs AI Coach comparison) → +Select Pro Plan → Choose Billing (Monthly/Quarterly/Annual) → +Payment (UPI/Card/Netbanking) → +7-Day Free Trial Starts → +After Trial: Auto-charge or Downgrade +10. Technical Requirements +10.1 Platform +Type: Web application only (no native mobile app) +Responsive: Mobile-first responsive design (320px minimum) +PWA: Progressive Web App with service worker for offline DPS access +Browser Support: Chrome, Firefox, Safari, Edge (latest 2 versions) +• +• +• +• +PragatiVeer — Product Requirements Document +Page 21 of 27 +10.2 Tech Stack (Recommended) +Layer +Technology +Frontend +Next.js (React) — SSR for performance +Backend +FastAPI (Python) or Node.js +Database +PostgreSQL +Cache +Redis (session management, rate limiting) +File Storage +S3-compatible (MinIO or AWS S3) +AI/ML +LLM API (for AI Coach), custom spaced repetition engine +Payments +Razorpay +Email +SMTP (Hostinger) +SMS/WhatsApp +Twilio / WhatsApp Business API +Deployment +Docker on VPS (Gyannetra production server) +10.3 Performance Requirements +Page load time: < 2 seconds (desktop), < 3 seconds (mobile) +Test interface: < 1 second question transition +DPS submission results: < 2 seconds +AI Coach response: < 5 seconds +Concurrent users: Support 10,000 DAU in Phase 1 +Uptime: 99.5% (excluding scheduled maintenance) +10.4 Security Requirements +HTTPS everywhere +OTP-based authentication (rate limited: 3 attempts/min) +Password hashing (bcrypt) +Session management (JWT with 30-day expiry) +Rate limiting on all API endpoints +XSS and CSRF protection +SQL injection prevention (parameterized queries) +Data encryption at rest (database encryption) +GDPR/DPDP Act compliance for student data +Parental consent for users under 18 +10.5 Offline Capability (PWA) +Service worker caches DPS questions +Students can download DPS when online +Attempt DPS offline +Sync results when back online +• +• +• +• +• +• +• +• +• +• +• +• +• +• +• +• +• +• +• +• +PragatiVeer — Product Requirements Document +Page 22 of 27 +Cache previous day's DPS for review +11. Data Model (Key Entities) +11.1 User +Field +Type +Notes +id +UUID +Primary key +email +String +Unique, nullable +phone +String +Unique, nullable +password_hash +String +bcrypt hashed +name +String +class +Enum +11, 12, Dropper +target_exam +Enum +JEE_Main, JEE_Advanced, NEET +medium +Enum +English, Hindi, Bilingual +school +String +Optional +city +String +state +String +tier +Enum +Free, Pro, AI_Coach +trial_end +DateTime +7-day trial expiry +subscription_end +DateTime +streak_count +Integer +Current streak +longest_streak +Integer +created_at +DateTime +last_active +DateTime +• +PragatiVeer — Product Requirements Document +Page 23 of 27 +11.2 Parent +Field +Type +Notes +id +UUID +Primary key +email +String +phone +String +password_hash +String +name +String +language +Enum +Hindi, English +linked_students +UUID[] +Array of student user IDs +created_at +DateTime +11.3 Question +Field +Type +Notes +id +UUID +Primary key +subject +Enum +Physics, Chemistry, Maths, Biology +topic +String +e.g., "Electrostatics" +subtopic +String +e.g., "Coulomb's Law" +difficulty +Enum +Easy, Medium, Hard +type +Enum +MCQ_Single, MCQ_Multiple, Numerical +question_text +Text +Supports LaTeX +options +JSON +Array of options (for MCQ) +correct_answer +JSON +Correct answer(s) +solution_text +Text +Step-by-step solution +language +Enum +English, Hindi +year +Integer +For PYQs (nullable) +exam +Enum +JEE_Main, JEE_Advanced, NEET +tags +String[] +Custom tags +is_active +Boolean +Soft delete +created_by +UUID +Admin user ID +verified_by +UUID +Content reviewer ID +PragatiVeer — Product Requirements Document +Page 24 of 27 +11.4 DPS (Daily Practice Sheet) +Field +Type +Notes +id +UUID +Primary key +date +Date +DPS date +title +String +e.g., "DPS #127" +questions +UUID[] +Array of question IDs +difficulty +Enum +Easy, Medium, Hard, Mixed +time_limit +Integer +Minutes +is_active +Boolean +created_by +UUID +Admin user ID +11.5 Test +Field +Type +Notes +id +UUID +Primary key +title +String +type +Enum +Weekly, Mock, PYQ +exam_pattern +Enum +JEE_Main, JEE_Advanced, NEET +sections +JSON +Array of {name, questions[], time_limit} +total_time +Integer +Minutes +difficulty +Enum +scheduled_date +DateTime +For weekly tests +is_active +Boolean +created_by +UUID +Admin user ID +PragatiVeer — Product Requirements Document +Page 25 of 27 +11.6 Attempt (DPS or Test) +Field +Type +Notes +id +UUID +Primary key +user_id +UUID +Foreign key +source_type +Enum +DPS, Test, MicroTest +source_id +UUID +DPS or Test ID +started_at +DateTime +submitted_at +DateTime +time_taken +Integer +Seconds +answers +JSON +Array of {question_id, selected_answer, is_correct, time_spent} +score +Integer +Correct answers count +total_questions +Integer +accuracy +Float +Percentage +status +Enum +In_Progress, Submitted, Timed_Out +11.7 Mistake (AI Coach) +Field +Type +Notes +id +UUID +Primary key +user_id +UUID +Foreign key +question_id +UUID +Foreign key +attempt_id +UUID +Foreign key +error_type +Enum +Conceptual, Calculation, Reading, Time_Pressure +topic +String +subtopic +String +next_review +DateTime +Spaced repetition schedule +review_count +Integer +Times re-attempted +consecutive_correct +Integer +For mastery detection +is_mastered +Boolean +created_at +DateTime +PragatiVeer — Product Requirements Document +Page 26 of 27 +11.8 StudyPlan (AI Coach) +Field +Type +Notes +id +UUID +Primary key +user_id +UUID +Foreign key +date +Date +Plan date +tasks +JSON +Array of {type, description, duration_minutes, status} +is_completed +Boolean +generated_at +DateTime +feedback +Text +Student's feedback on plan +11.9 Subscription +Field +Type +Notes +id +UUID +Primary key +user_id +UUID +Foreign key +tier +Enum +Pro, AI_Coach +billing_cycle +Enum +Monthly, Quarterly, Annual +start_date +DateTime +end_date +DateTime +amount +Integer +Paise +payment_id +String +Razorpay payment ID +status +Enum +Active, Expired, Cancelled, Paused +auto_renew +Boolean +coupon_code +String +Nullable +End of PRD — Prepared by Maya, CEO's Office, Gyannetra Pvt Ltd +Approved by Kapil Panwar, CEO — 1 July 2026 +PragatiVeer — Product Requirements Document +Page 27 of 27 + diff --git a/src/app/cbt/[examId]/page.tsx b/src/app/cbt/[examId]/page.tsx index 3f1cba8..8548849 100644 --- a/src/app/cbt/[examId]/page.tsx +++ b/src/app/cbt/[examId]/page.tsx @@ -3,13 +3,15 @@ import { useEffect, useState, use, useRef } from "react" import { Button } from "@/components/ui/button" import { Badge } from "@/components/ui/badge" -import { Clock, Flag, ChevronLeft, ChevronRight, Pause as PauseIcon, MoreVertical, Calculator as CalculatorIcon, FlaskConical, Edit3, XCircle, Play, Shield, AlertTriangle } from "lucide-react" +import { Clock, Flag, ChevronLeft, ChevronRight, Pause as PauseIcon, MoreVertical, Calculator as CalculatorIcon, FlaskConical, Edit3, XCircle, Play, Shield, AlertTriangle, Moon, Sun } from "lucide-react" import Image from "next/image" +import { useTheme } from "next-themes" import { useCBTStore, QuestionStatus } from "@/store/cbtStore" import { useExamTimer } from "@/hooks/useExamTimer" import ReactMarkdown from "react-markdown" import remarkMath from "remark-math" import rehypeKatex from "rehype-katex" +import rehypeRaw from "rehype-raw" import "katex/dist/katex.min.css" import { Calculator } from "@/components/CBT/Calculator" import { Scratchpad } from "@/components/CBT/Scratchpad" @@ -35,9 +37,9 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri const [showPeriodicTable, setShowPeriodicTable] = useState(false); const [isPaused, setIsPaused] = useState(false); const [showSubmitConfirm, setShowSubmitConfirm] = useState(false); + const { theme, setTheme } = useTheme(); // Anti-cheat state - const [testStarted, setTestStarted] = useState(false); const [violationCount, setViolationCount] = useState(0); const [showWarning, setShowWarning] = useState(false); const hasShownWarning = useRef(false); @@ -45,6 +47,7 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri const { initExam, + startExam, questions, answers, currentQuestionIndex, @@ -57,7 +60,8 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri getAttemptPayload, submitAttemptToServer, resetExamState, - status + status, + attemptId } = useCBTStore(); const { formattedTime, isTimedOut } = useExamTimer(); @@ -109,14 +113,14 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri // Track time spent per question useEffect(() => { - if (testStarted) { + if (status === 'IN_PROGRESS') { setQuestionStartTime(Date.now()); } - }, [currentQuestionIndex, testStarted]); + }, [currentQuestionIndex, status]); // Anti-Cheat: Tab switching listener useEffect(() => { - if (!testStarted || status === 'SUBMITTED' || status === 'TIMED_OUT') return; + if (status !== 'IN_PROGRESS') return; const handleVisibilityChange = () => { if (document.visibilityState === 'hidden') { @@ -126,7 +130,7 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri document.addEventListener("visibilitychange", handleVisibilityChange); return () => document.removeEventListener("visibilitychange", handleVisibilityChange); - }, [testStarted, status]); + }, [status]); // Handle side-effects of violation count changing useEffect(() => { @@ -155,7 +159,7 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri } catch (e) { console.warn("Fullscreen API failed", e); } - setTestStarted(true); + startExam(); }; const handleNext = () => { @@ -199,7 +203,7 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri if (!mounted || questions.length === 0) return
Loading Exam Engine...
; - if (!testStarted && status !== 'SUBMITTED' && status !== 'TIMED_OUT') { + if (status === 'NOT_STARTED') { return (
@@ -216,6 +220,17 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri
  • Ensure your internet connection is stable before starting.
  • + +
    +
    +

    Preferred Theme

    +

    Choose dark or light mode for the exam

    +
    + +
    + @@ -231,6 +246,7 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri return ( { resetExamState(); window.location.reload(); @@ -346,7 +362,7 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri
    - + {currentQuestion.text_en}
    @@ -377,7 +393,7 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri {letter} - + {option} @@ -402,7 +418,7 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri
    - + {currentQuestion.text_hi}
    @@ -433,7 +449,7 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri {letter} - + {option} diff --git a/src/app/dashboard/cbt/page.tsx b/src/app/dashboard/cbt/page.tsx index 31bc64e..eb1d4ae 100644 --- a/src/app/dashboard/cbt/page.tsx +++ b/src/app/dashboard/cbt/page.tsx @@ -132,7 +132,7 @@ export default function CBTPage() { {exam.exam_pattern && ( - {exam.exam_pattern} + {exam.exam_pattern === 'JEE_Main' ? 'JEE Main' : exam.exam_pattern === 'JEE_Advanced' ? 'JEE Advanced' : exam.exam_pattern} )} @@ -218,7 +218,7 @@ export default function CBTPage() {
    {Math.round(attempt.accuracy)}%
    - diff --git a/src/app/dashboard/community/page.tsx b/src/app/dashboard/community/page.tsx index 2cc5b00..af01976 100644 --- a/src/app/dashboard/community/page.tsx +++ b/src/app/dashboard/community/page.tsx @@ -78,6 +78,26 @@ export default function CommunityPage() { return true }) + if (!hasAccessTo("ask-doubts-from-tutors")) { + return ( +
    +
    + +
    +

    Premium Feature

    +

    + The Doubt Forum is a premium feature. Upgrade your plan to ask doubts and interact with tutors and the community. +

    + +
    + ) + } + return (
    @@ -88,17 +108,9 @@ export default function CommunityPage() {

    Ask questions, share knowledge, and learn together with the community.

    - - {hasAccessTo("ask-doubts-from-tutors") ? ( - - ) : ( - - )} +
    diff --git a/src/app/upgrade/page.tsx b/src/app/upgrade/page.tsx index 05b59c3..9e18f94 100644 --- a/src/app/upgrade/page.tsx +++ b/src/app/upgrade/page.tsx @@ -3,7 +3,7 @@ import { useState } from "react" import { Card, CardContent, CardHeader, CardTitle, CardDescription, CardFooter } from "@/components/ui/card" import { Button } from "@/components/ui/button" -import { Check, X, ShieldCheck, Loader2 } from "lucide-react" +import { Check, X, ShieldCheck, Loader2, Minus } from "lucide-react" import { useActiveUser } from "@/hooks/useActiveUser" @@ -114,9 +114,9 @@ export default function UpgradePage() {
    Subject-wise diagnostics
    Basic progress tracking
    -
    Unlimited Tests
    -
    AI Spaced Repetition
    -
    Parent Analytics
    +
    Tests
    +
    AI Spaced Repetition
    +
    Parent Analytics
    @@ -136,8 +136,8 @@ export default function UpgradePage() {
    Unlimited Sectional Tests
    Performance Analytics
    Parent Dashboard
    -
    AI Mistake Heatmap
    -
    Spaced Repetition (SM-2)
    +
    AI Mistake Heatmap
    +
    Spaced Repetition (SM-2)
    + {attemptId && ( + + )}