-
Notifications
You must be signed in to change notification settings - Fork 91
Test coderabbit 2 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sdcharly
wants to merge
112
commits into
leonvanzyl:master
Choose a base branch
from
sdcharly:test-coderabbit-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add complete quiz system with educator and student interfaces - Implement synchronous webhook-based question generation with N8N - Add document upload and processing for quiz content - Create quiz review/edit interface for educators - Add student quiz-taking and results tracking - Set webhook timeout to 100s (Cloudflare max) for optimal performance - Include graceful fallback to sample questions on timeout - Add role-based authentication for educators and students - Clean architecture with no redundant async code 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…ew UX ✨ Design System Implementation: - Add complete UI design system documentation (PRINCIPLES, TOKENS, COOKBOOK) - Implement friendly, modern design with cool blue tones and youthful aesthetic - Add Plus Jakarta Sans and Inter fonts for improved typography - Update all core components with mobile-optimized designs (44px touch targets) - Add gradient backgrounds and smooth animations throughout 🎨 Component Updates: - Enhanced buttons with gradients and hover effects - Improved cards with rounded corners and soft shadows - Mobile-optimized form inputs with focus states - New loading and empty state components with encouraging messages - Updated color palette: primary blues, success greens, playful purples 📚 Quiz Review Page Transformation: - Implement one-by-one question navigation with smooth transitions - Add dual view modes: Card view (focused) and Grid view (overview) - Create visual progress indicators and numbered navigation - Add show/hide explanation toggles for better content control - Implement inline editing with clear save/cancel actions - Add comprehensive quiz statistics panel - Color-coded difficulty and Bloom's taxonomy badges 🔧 Technical Improvements: - Fix authentication callback redirect issue with middleware - Remove redundant async processing code - Update global CSS with design tokens - Implement responsive layouts for all screen sizes The application now features a delightful, modern UI that's friendly, approachable, and optimized for both educators and students on all devices. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…ive functionality - Add shuffle option for quiz questions with seeded randomization - Fix quiz creation bug (was creating as 'published' instead of 'draft') - Add quiz listing to educator dashboard with status-based actions - Implement delete functionality for draft quizzes - Add archive/deactivate system for published quizzes with student activity - Create quiz management page for student enrollment - Add Replace Question feature during quiz review - Implement proper publishing workflow with post-publish restrictions - Add quiz cleanup functionality and database maintenance - Update UI with cleaner, more intuitive design - Fix Google OAuth authentication issues - Remove redundant Quiz Overview section from review page Key Features: - Draft quizzes can be deleted permanently - Published quizzes with student activity get archived (not deleted) - Archived quizzes can be reactivated - Students cannot see archived quizzes - Educators can manage student enrollment for published quizzes - Questions can be replaced during review phase - Quiz questions can be shuffled for each student attempt 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
…ement system - Fixed quiz retake prevention for students - Implemented timer-based review access (students must wait until quiz time expires) - Created detailed educator analytics dashboard with visual KPIs - Added student management system with invitations - Built comprehensive performance analytics page with charts - Created detailed student profile pages with performance tracking - Added educator attempt detail view with question-by-question analytics - Reorganized educator dashboard with graphical performance indicators - Fixed View Details button functionality for students - Added Results button to educator dashboard for easy access - Created all quizzes page for better quiz management - Fixed runtime errors with proper null checks - Improved navigation and internal linking throughout the application Key Features: - Visual performance charts on dashboard - Real-time activity tracking - Topic-based performance analysis - Student progress monitoring - Grade distribution analytics - Time-based access controls - Comprehensive quiz result views
## Major Features Implemented:
### 🎨 Complete UI Redesign & Theme Consistency
- Replaced "BibleQuiz" with "Scrolls of Wisdom - Biblical Knowledge Quest"
- Implemented consistent amber/orange biblical theme across all pages
- Migrated from Lucide React to Heroicons for consistent icon system
- Applied professional typography system (Playfair Display + Inter fonts)
- Updated all authentication pages with biblical terminology
- Fixed dashboard typography and spacing inconsistencies
- Eliminated all blue theme elements throughout the application
### 🌍 Production-Ready Timezone System
- Added timezone fields to users and quizzes database tables
- Created comprehensive timezone utilities with IST as default
- Built smart timezone selector component with regional grouping
- Implemented timezone-aware quiz scheduling and validation
- Added live preview of quiz schedule in selected timezone
- Enhanced quiz creation with simplified date/time picker
### 📅 Improved Date/Time Selection
- Replaced complex datetime picker with simple date + time inputs
- Added duration dropdown with preset options
- Implemented timezone validation and future-time checking
- Created visual schedule preview with proper timezone display
### 🛠 Technical Infrastructure
- Generated database migrations for timezone support
- Updated APIs to handle timezone data
- Created reusable UI components following design system
- Implemented proper error handling and fallbacks
- Added comprehensive timezone conversion utilities
### 📱 Enhanced User Experience
- Biblical terminology throughout ("Sacred Guide", "Disciples", "Quests")
- Consistent amber focus states and transitions
- Professional card designs with hover effects
- Improved typography hierarchy and spacing
- Better form validation and user feedback
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
## Major Features Added: ### 🔐 Super Admin Authentication System - Secure fixed credentials authentication for super admin - Separate admin login page at /admin/login - JWT-based session management with 30-minute timeout - Admin credentials configurable via environment variables ### 📊 Admin Dashboard (/admin/dashboard) - Real-time statistics overview (educators, students, quizzes, enrollments) - Tabbed interface for managing different entities - Pending educator approvals with quick actions - Direct view of educators and students in dashboard tabs - Activity monitoring and recent actions display ### 👥 Educator Management System - Complete educator lifecycle management (pending → approved → suspended) - Granular permission controls per educator: - Boolean permissions (publish, edit, delete quizzes, etc.) - Numeric limits (max students, quizzes, questions) - Individual educator detail pages with full profile - Editable permissions with real-time updates - Approval/rejection workflow with reasons ### 🎓 Student Management System - Comprehensive student profiles with performance metrics - View enrollments, quiz attempts, and scores - Connected educators display - Student deletion with cascade removal - Individual student detail pages with statistics ### 📝 Activity Logging & Audit Trail - Complete activity logging for all admin actions - Searchable and filterable activity logs - Export to CSV functionality - Detailed JSON data for each action - IP address and user agent tracking ### 🛠️ Database Schema Updates - Added admin and pending_educator roles - Approval status tracking (pending, approved, rejected, suspended) - Granular permissions JSON storage - Activity logs table for audit trail - Admin settings table for system configuration ### 🎨 UI Components Added - Tabs component for dashboard navigation - Alert component for notifications - Checkbox component for permission editing - Approval status banner for educators - Responsive design across all admin pages ### 🔧 API Endpoints Created - Admin authentication (login/logout) - Educator approval/rejection/suspension/reactivation - Permission updates for individual educators - Student deletion with cascade - Activity logging for all actions ## Technical Improvements: - Fixed cookie path issue for API authentication - Proper error handling with user feedback - Session-based admin authentication - Comprehensive permission checking system - Clean UI with no redundant buttons - Smart "View all" links only when needed This implementation provides complete control over the platform with: - Full educator lifecycle management - Granular permission controls - Comprehensive audit trail - Secure admin authentication - Intuitive dashboard interface 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Removed conflicting pnpm-lock.yaml file - Keep only package-lock.json for npm - Ensures proper installation of @types/jsonwebtoken on Vercel 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Moved @types/jsonwebtoken from devDependencies to dependencies - Fixes TypeScript compilation issue on Vercel - Ensures types are available during production build 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Added super admin configuration section - Updated documentation for each section - Added security notes and best practices - Included all required environment variables for production deployment - Added helpful comments for Gmail SMTP setup 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Updated package.json with new project name - Updated README.md with correct repository URLs - Removed references to original boilerplate in site-footer - Updated package-lock.json with new project name - Replaced all references throughout the codebase 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add job tracking store for managing quiz generation jobs - Create async quiz creation endpoint with immediate response - Add webhook callback endpoint for n8n to send results - Implement status polling endpoint for frontend progress tracking - Update frontend with real-time progress modal during generation - Solve Cloudflare timeout issues with immediate response pattern This allows n8n webhooks to process longer without hitting timeouts by: 1. Responding immediately with 'processing' status 2. Processing quiz generation in background 3. Sending results via callback when complete 4. Frontend polls for status and shows progress 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
- Add async replace question endpoint with immediate response - Create dedicated webhook callback for replace operations - Implement progress tracking for question replacement - Add real-time progress modal for better UX during replacement - Reuse job tracking infrastructure for consistency This ensures question replacement also avoids timeouts by: 1. Responding immediately to the request 2. Processing replacement in background via n8n 3. Updating question when callback receives result 4. Showing progress to keep user informed 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
- Extend polling timeout to 3 minutes for quiz creation - Extend polling timeout to 2 minutes for question replacement - Add progressive status messages based on elapsed time - Increase job store expiry to 60 minutes for slow processing - Add 'Continue Working' option after 30 seconds of waiting - Improve error handling to allow background completion - Show gradual progress increments during long waits This ensures the async pattern properly handles longer n8n processing times: - Users can wait longer for complex AI generation - Better feedback keeps users informed during wait - Option to continue working while generation happens in background - Jobs persist longer to accommodate slow webhook responses 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
…ment - Add jobId prefix validation to ensure correct callback routing - Add logging to identify which callback endpoint is being called - Prevent quiz creation callback from processing replacement jobs - Prevent replacement callback from processing non-replacement jobs - Add clear error messages when wrong endpoint is called This ensures that: - Replacement operations UPDATE existing questions (not INSERT) - n8n callbacks go to the correct endpoint based on job type - Clear debugging information when routing issues occur 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
- Added subtle biblical-themed super admin login link (✝ symbol) in homepage footer - Fixed quiz review page navigation and breadcrumb functionality - Created comprehensive README with complete project documentation including: * Detailed feature descriptions for all user roles * Full tech stack breakdown * Complete setup and deployment instructions * API documentation and database schema * Security measures and troubleshooting guide * Contributing guidelines and support information 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Fixed polling interval management using useRef to prevent memory leaks - Added hasShownTimeoutAlert flag to prevent duplicate timeout notifications - Implemented proper cleanup on component unmount - Added "Cancel Generation" button for manual polling termination - Improved "Continue in Background" functionality Database handling improvements for both quiz generation and question replacement: - Added text length validation (5000 chars for questions/explanations, 1000 for options) - Implemented proper error handling with try-catch blocks around DB operations - Added data sanitization to handle special characters in theological content - Skip invalid questions instead of failing entire operation - Track and report partial success when some questions fail - Added default values for missing fields These changes ensure: - No more persistent error popups after timeout - Safe handling of complex theological text with quotes and special characters - Graceful degradation when some questions have issues - Better debugging information for troubleshooting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…ement polling Fixed "job expired" errors appearing after successful completion for both: - Quiz generation flow - Question replacement flow Changes: - Converted local interval variables to useRef for proper cleanup - Added isCompletingRef flag to prevent race conditions during success - Clear jobId immediately on completion (not after UI delay) - Added early exit checks before making API calls - Ignore 404 errors during completion phase - Added cleanup on component unmount to prevent memory leaks - Fixed conditional error handling to distinguish real errors from race conditions Also fixed: - Escaped quotes in homepage footer to resolve React linting warning This ensures users no longer see confusing "job expired" errors after successful operations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Auto-approve students upon registration (no pending status needed) - Make phone number optional for student registration - Enable direct quiz assignment via educator invitations - Enforce proper access control: students only see their educator's quizzes - Require enrollment verification before students can start quizzes - Add educator-student relationship validation to all student APIs - Implement complete data isolation between different educators - Add migration script to fix existing student approval status This ensures students have a streamlined onboarding experience while maintaining strict boundaries between educators' content and students. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Scripts are utility files not part of the main application - Prevents TypeScript compilation errors during Vercel builds - Updates import paths to reference src directory 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Better visual hierarchy with proper sections and borders - Improved spacing and padding for better readability - Enhanced color scheme for better visual distinction - Responsive design for mobile and desktop views - Clearer button organization in footer - Better contrast for enrolled vs available students - Improved search bar and action buttons layout 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Created /api/student/quizzes/[id]/enroll endpoint - Validates student-educator relationship before enrollment - Prevents duplicate enrollments - Adds proper error handling and user feedback - Fixes 'Enroll in Quiz' button functionality 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add timezone-aware quiz scheduling with proper UTC storage and user timezone display - Implement UserContext and useTimezone hook for consistent timezone management - Add timezone validation with 5-minute future time requirement - Enhance security with expanded .gitignore patterns for scripts and credentials - Update quiz creation forms to use user's timezone for input and display - Add relative time displays for better user experience - Ensure all quiz times stored as UTC in database with timezone reference 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Made UserContext more resilient to prevent throwing errors - Added proper client-side checks for localStorage access - Return default values instead of throwing when context unavailable - Fix hydration issues between server and client rendering
- Fixed useEffect infinite loop caused by function dependencies - Memoized all functions in useTimezone hook to prevent recreation - Changed quiz create useEffect to only run on mount - This was causing the 'Application error' on quiz create page
- Fixed Date.toISOString() error by avoiding parsing locale strings with Date constructor - Properly format dates using toLocaleDateString and toLocaleTimeString separately - Added validation for invalid dates with proper fallbacks - This fixes the 'Uncaught RangeError: Invalid time value' on quiz create page
- Fixed race condition where webhook callbacks arrived before jobs were stored - Enhanced error handling for non-existent jobs in both quiz creation and question replacement flows - Added comprehensive logging with prefixes ([CREATE-ASYNC], [QUIZ CREATE CALLBACK], [REPLACE-ASYNC], [REPLACE CALLBACK]) - Ensured jobs are created in store BEFORE webhook calls to prevent timing issues - Improved error messages and user feedback in polling status endpoint - Added graceful handling for error callbacks when jobs don't exist - Created test scripts for debugging webhook flows - Added WEBHOOK_FIX_SUMMARY.md with detailed documentation This fix ensures reliable communication between the application and n8n workflows for both quiz generation and question replacement features. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
## Quiz Generation & Polling System - Extended polling timeouts for AI workflows (30 min for quiz, 20 min for replacements) - Fixed webhook callbacks to properly return success responses - Added duplicate quiz prevention with frontend and backend safeguards - Improved job status tracking and error handling - Added time-aware progress messages for long-running AI operations ## Modal & UI Fixes - Fixed modal backdrop click issues with proper event handling - Resolved modal z-index stacking problems (backdrop: 9998, content: 9999) - Fixed scroll behavior and body locking when modals are open - Added subtle admin access link in header (cross icon) - Improved modal animations and transitions ## Content & Messaging - Replaced all n8n workflow references with biblical literature theme - Updated progress messages to reflect theological content processing - Enhanced user feedback during quiz generation with contextual messages ## Database Maintenance - Fixed duplicate "1 Peter Quiz" entries in database - Cleaned up all database maintenance scripts for production - Removed unnecessary dotenv dependency ## Document Management - Improved document selection UX with better visual feedback - Enhanced modal behavior in document pages - Fixed selection state management ## Student Management - Fixed enrollment modal behavior and layout - Improved student management interface responsiveness 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…ality
🚀 Major Analytics Improvements:
**Fixed Critical Issues:**
- ✅ Working export functionality (JSON format with timestamp)
- ✅ Proper error handling with retry capabilities
- ✅ Real-time refresh button with loading states
- ✅ Improved chart visualization with tooltips and legends
- ✅ Better date formatting using timezone utilities
**Enhanced User Experience:**
- 📊 Interactive timeline chart with hover tooltips
- 🎨 Proper scaling and gradient colors for visual appeal
- 📅 Human-readable relative dates ("2 hours ago")
- ⏱️ Better time formatting ("5m 30s" instead of "5m")
- 🔄 Loading states and refresh indicators
**Meaningful Empty States:**
- 📋 Actionable empty states instead of "No data available"
- 🎯 Context-specific guidance for each tab
- 🔗 Quick action buttons to relevant pages
- 💡 Educational messaging for new educators
**Professional Polish:**
- 🎯 Consistent amber theming throughout
- ⚡ Better error boundaries and fallbacks
- 📱 Improved responsive design
- 🧭 Clear visual hierarchy and spacing
**Performance Optimizations:**
- 🔄 Efficient data loading with proper null checks
- 💾 Smart export with proper blob handling
- ⚡ Reduced re-renders and improved state management
The analytics page now provides a professional, insightful experience
that helps educators understand student performance and quiz effectiveness.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
- Add intelligent educator activity tracking with anti-spam safeguards - Create biblical-themed email templates for gentle reminders - Implement sophisticated eligibility checking (max 1 email/day, 2/week) - Add comprehensive testing suite for admins - Configure Vercel cron jobs for automated daily reminders - Include complete documentation and setup guides - Database migrations for activity metrics and email history 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add centralized branding configuration in src/lib/branding.ts - Update email service to use branding constants for consistency - Add EMAIL_BRANDING_REFACTOR.md documenting the changes - Update .env.example with branding configuration options - Ensure consistent brand identity across all email templates 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Fixed missing 'import {' prefix in 13+ files
- Corrected TypeScript type errors in admin debug-env route
- Added missing logger import in educator quiz create route
- Resolved build compilation errors for successful deployment
- All import statements now properly formatted with correct syntax
The cleanup script had incorrectly removed parts of import statements
while cleaning console.log statements, breaking the build process.
This commit restores proper import syntax throughout the codebase.
🤖 Generated with Claude Code
Co-Authored-By: Claude <[email protected]>
- Move logger imports to top of file for consistent loading - Add navigation verification documentation for admin panel refactor - Ensure logger is available before other imports that might use it - Part of admin panel performance optimization effort 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…plates - Created comprehensive Privacy Policy page at /privacy - Created detailed Terms of Service page at /terms - Both pages feature biblical theme styling and professional legal content - Added promotional email templates for educator acquisition (free-forever campaign) - Updated site footer to include legal links (Privacy, Terms, Contact) - All pages are mobile-responsive and follow app's amber/orange biblical theme Key features: - Privacy Policy covers data collection, usage, security, and user rights - Terms emphasizes free-forever commitment for 2025 educators - Email templates include mobile optimization and spiritual messaging - Footer now provides easy access to legal pages from anywhere in the app 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
- Removed 52 outdated documentation files - Consolidated essential information into main README - Cleaned up 21 legacy scripts no longer in use - Updated .gitignore and scripts README with current structure - Streamlined documentation for better maintainability 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Use centralized getQuizAvailabilityStatus function for consistency - Filter out ended quizzes from student panel unless already attempted - Update dashboard to only count non-expired quizzes as available - Add availability status and message fields to quiz response - Ensure data quality matches educator-side validation logic This ensures expired quizzes don't appear as "Available" when they've already ended. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Created safe-data-utils.ts with comprehensive null/undefined handling - Fixed missing score data display issues (totalCorrect vs correctAnswers) - Applied safe processing across all student panel components - Preserved all performance optimizations (caching, memoization) - Ensures mobile device stability with proper fallbacks - Maintains high availability with error resilience Key improvements: - SafeQuizResult and SafeQuiz interfaces with guaranteed non-null fields - Single-pass array processing for performance - Compatible with existing React optimizations - Prevents runtime errors from null/undefined values 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…d dynamic YouTube integration Major Updates: - Complete redesign of homepage with international religious website design standards - Implemented modern, clean layout with better typography and visual hierarchy - Added dynamic YouTube URL management through admin panel - Fixed duplicate footer issue and removed all payment/subscription references - Optimized space usage with compact, professional design Technical Changes: - Added youtubeVideoUrl field to system_config in admin settings - Created public API endpoint (/api/public/youtube-url) for fetching video URL - Updated CSP in middleware to allow YouTube iframe embeds - Implemented automatic YouTube URL to embed format conversion - Added responsive video display with lazy loading for performance UI/UX Improvements: - Hero section with email capture and trust indicators - Enhanced feature cards with hover effects - Simplified 3-step onboarding process - Added testimonials section for social proof - Fixed button color contrast issues for better accessibility - Maintained consistent biblical amber/orange theme throughout 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
…c role management - Add comprehensive permission templates system with default template support - Create migration scripts for existing educators to use default template - Implement template management in admin panel with creation, editing, and deletion - Add API endpoints for educator template assignment and updates - Enhance educator details page with template selection and override capabilities - Update signup process to auto-assign default permission template - Add documentation for admin panel testing and quiz limit logic - Improve performance monitoring with better template handling - Fix quiz creation routes to respect educator quiz limits - Refactor permissions page to use new PermissionTemplatesV2 component 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…error - Fixed API route to always return embed URLs instead of watch URLs - Updated fallback URL in homepage to use embed format - Removed deprecated frameBorder attribute from iframe element - Ensures YouTube videos display correctly without iframe security errors 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Root Folder Cleanup: - Organized backup files into backups/ directory - Moved log files to logs/ directory - Migrated SQL files from migrations/ to drizzle/ folder - Removed unnecessary vercel/ MCP server example - Updated .gitignore with new organized directories Mobile Quiz Improvements: - Added responsive mobile quiz interface with swipe navigation - Implemented smart autosave system with 30-second intervals - Added browser compatibility checks with warnings - Improved touch interactions and gesture support Diagnostics & Telemetry System: - Added comprehensive telemetry tracking for user behavior - Implemented lightweight diagnostics for performance monitoring - Created admin diagnostics dashboard with real-time metrics - Added quiz failure analysis tools and reports - Integrated Sentry for error tracking and monitoring Performance Enhancements: - Added database performance indexes for concurrent quiz attempts - Implemented cleanup scripts for stuck quiz attempts - Optimized enrollment queries with proper error handling - Added autosave functionality to prevent data loss 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Skip time constraints (start time/end time) for reassigned quiz enrollments - Reassigned students can now take the quiz anytime after reassignment - Original enrollments still respect the scheduled time window - Both original and reassigned students are blocked if quiz is archived - Reassigned quizzes always have shuffled question order for security This fixes the issue where reassigned quizzes were incorrectly showing as "not available" due to original quiz time constraints being applied. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add 'use client' directive and dynamic import to quiz page - Disable SSR for ImprovedQuizPage to prevent server-side rendering errors - Add browser checks to QuizDiagnostics constructor to prevent window/navigator access during SSR - Add localStorage safety checks to QuizAutoSaveService methods - Fix all browser-only API accesses that were causing server-side rendering failures The quiz page was failing in production because browser-only APIs (window, navigator, localStorage) were being accessed during server-side rendering. This fix ensures these APIs are only accessed in the browser environment. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Fixed variable reference error in quiz API when returning existing attempts. Changed quiz[0].property to quiz.property since quiz was already destructured. This resolves the empty quiz page issue for reassigned students. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Removed duplicate quiz fetch inside existingAttempt block that was shadowing the main quiz variable and causing TypeScript errors. Now uses the single quiz instance fetched at the start of the function. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Removed the filter that checks for questionText and options existence as it was preventing questions from being displayed. The filter was too strict and unnecessary since we know questions exist in the database. Also removed debug logging statements that could cause issues in production. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…d mapping Root cause: Drizzle ORM returns database field names in snake_case (question_text, order_index, blooms_level) but the code was trying to access camelCase properties (questionText, orderIndex, bloomsLevel). This caused all questions to be undefined, making quizzes unusable. Solution: Map both snake_case (from DB) and camelCase (TypeScript types) to handle the mismatch properly. Uses type assertion (any) to access the actual database field names. This fixes the critical production bug preventing students from taking quizzes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Explicitly handle snake_case database field names - Add fallback values for all fields to prevent undefined - Add error logging when no questions are found - Return proper error if quiz has no questions - Use explicit return statements in map functions for clarity This ensures questions are always properly mapped regardless of how Drizzle returns the data. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add detailed logging in API to track what's being sent - Add frontend logging to track what's being received - Debug why questions aren't displaying for reassigned quizzes 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
- Fix enrollment map to prioritize reassignments over original enrollments - Include all enrolled quizzes in dashboard, not just educator quizzes - Properly handle multiple enrollments for same quiz - Add reassignment indicators to quiz list 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
- Dashboard should only show educator quizzes, not all enrolled quizzes - Keep the enrollment map fix to prioritize reassignments - Add reassignment indicators to help identify reassigned quizzes - Fix handles multiple enrollments for same quiz correctly 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
- Reassignments now bypass quiz expiration time constraints - Show reassigned quizzes as 'active' even if original quiz expired - Override availability status for reassignments to allow access - This fixes the critical issue where reassigned quizzes weren't showing 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
- Add detailed logging to track why quiz questions aren't loading - Improve error screen with Try Again button - Debug current question selection logic - Track quiz data state at each step 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
Major fixes: - Fixed blank quiz pages caused by incorrect share URL validation - Resolved expired quiz access issues with proper reassignment detection - Fixed group page blank screen with error boundary implementation - Improved error handling across all student quiz components Technical improvements: - Added comprehensive error boundaries for all quiz-related pages - Enhanced share URL validation with proper error messages - Improved quiz data compatibility checks - Added extensive debugging scripts for troubleshooting - Created detailed documentation for quiz expiry system UI/UX improvements: - Better error messages for invalid or expired quiz links - Proper loading states for all quiz components - Consistent error handling across student interface Documentation: - Added comprehensive technical docs for troubleshooting blank pages - Created quiz expiry system reference guide - Documented frontend-backend quiz compatibility requirements 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
This commit addresses critical issues with quiz attempt and enrollment status tracking: Problems Fixed: - Students could retake completed quizzes due to missing enrollment status updates - Multiple attempts were allowed on the same enrollment - Dashboard showed incorrect available quiz count (3 instead of 1) - Enrollment statuses were inconsistent with actual quiz completion Solutions Implemented: 1. Quiz Start Logic (/api/student/quiz/[id]/start): - Now checks for ANY completed attempt before allowing new attempts - Properly handles multiple enrollment scenarios - Prevents retaking completed quizzes 2. Quiz Submit Logic (/api/student/quiz/[id]/submit): - Automatically updates enrollment status to 'completed' on quiz submission - Ensures database consistency between attempts and enrollments 3. Maintenance Scripts: - Added fix-enrollment-statuses.js for correcting inconsistent statuses - Added debug scripts for monitoring quiz availability 4. Documentation: - Updated CLAUDE.md with Quiz Enrollment Status Management section - Documented status rules and dashboard logic Impact: - Available quiz count now correctly shows only non-attempted, available quizzes - Completed quizzes can no longer be retaken - Database maintains consistent enrollment/attempt status tracking 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
- Refactor ImprovedQuizPage.tsx to reduce complexity and improve performance - Remove unused debug and check scripts (7 files) - Add quiz page optimization plan documentation - Preserve original quiz page implementation as backup - Update dependencies and project instructions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add .coderabbit.yaml with project-specific review rules - Configure to enforce shadcn/ui components usage - Set up logger utility enforcement (no console.log) - Add path-specific instructions for different parts of codebase - Create comprehensive setup documentation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@coderabbitai review