Data Export
Sunschool provides a simple data export feature that allows parents to download complete learner information as JSON files. This supports data portability, backup, and offline analysis.What is Data Export?
Data export generates a comprehensive JSON file containing all data for a specific learner:- Learner account information
- Profile including grade level and settings
- Complete lesson history with scores and timestamps
- All achievements earned
- Export metadata (date, exported by)
Access and Permissions
Data export is available to PARENT and ADMIN role users. Parents can export data for their own children; admins can export for any learner.
server/routes.ts:1360-1408:
How to Export Data
From the Parent Dashboard
Fromparent-dashboard.tsx:228-236:
From the Reports Page
Fromreports-page.tsx:70-73:
Navigate to Learner
Go to the parent dashboard or learners page and locate the child whose data you want to export.
Export File Format
The exported JSON file has this structure:What Data is Included
Learner Information
From thelearner object:
Account Details
- User ID
- Username
- Email address
- Display name
- Role (always LEARNER)
- Parent ID
Timestamps
- Account created date
- Last updated date
Passwords are never included in exports for security.
Profile Data
From theprofile object:
- Grade Level - Current grade (0 for K, 1-12)
- Subjects - Active learning subjects
- Recommended Subjects - AI-suggested topics
- Struggling Areas - Topics needing attention
- Knowledge Graph - Visual representation of learned concepts
- Preferences - Custom settings and configurations
Lesson History
From thelessons array (up to 1000 most recent):
- Lesson ID and timestamps
- Subject and topic
- Grade level
- Completion status (ACTIVE, DONE, ABANDONED)
- Score (percentage)
- Full lesson specification:
- Title and description
- Learning objectives
- Content sections
- Quiz questions and answers
- Images and media
The export fetches the 1000 most recent lessons. For learners with more lessons, consider using the database sync feature for complete history.
Achievements
From theachievements array:
- Achievement ID and type
- Award date and time
- Payload containing:
- Title
- Description
- Additional metadata
Export Metadata
- exportDate - When the export was generated (ISO 8601 timestamp)
- exportedBy - User ID of the parent who requested the export
Using Exported Data
Backup and Archival
Analysis and Reporting
You can process the JSON data with:Python Example
JavaScript Example
Data Portability
The JSON format is:- Universal - Works with any programming language
- Human-readable - Can be opened in text editors
- Machine-parseable - Easy to process programmatically
- Structured - Clear organization of related data
- Import into spreadsheet applications
- Load into databases
- Process with analytics tools
- Share with schools or tutors
- Archive for long-term storage
Privacy and Data Ownership
GDPR and Data Rights
Data export supports:- Right to access - View all data Sunschool has about a learner
- Right to portability - Take data to another platform
- Right to erasure - Export before account deletion
- Transparency - See exactly what information exists
Comparison: Export vs. Database Sync
- Data Export
- Database Sync
Best for:
- Quick backups
- One-time data retrieval
- Sharing with third parties
- Simple analysis
- No infrastructure required
- Manual download
- JSON file format
- Point-in-time snapshot
- Limited to 1000 lessons
- Immediate availability
Limitations
Lesson History Limit
Lesson History Limit
Exports include up to 1000 most recent lessons. For complete history:
- Use multiple exports over time
- Or use database sync feature
- Or contact support for custom exports
No Automatic Scheduling
No Automatic Scheduling
Exports are manual. To automate:
- Use the database sync feature
- Or build custom API integration
- Or use a scheduled script to trigger exports
File Size
File Size
Large lesson histories can result in big files:
- 1000 lessons ≈ 5-10 MB typically
- Includes full lesson specs and quiz data
- May take a moment to generate
Best Practices
Regular Exports
Export data monthly to maintain backup history and track long-term progress.
Secure Storage
Store exports in encrypted or password-protected locations. They contain personal information.
Meaningful Filenames
Keep the auto-generated filenames - they include date and learner ID for easy organization.
Verify Downloads
After exporting, open the file to verify it contains expected data before relying on it.
Troubleshooting
Export button doesn't work
Export button doesn't work
File won't open
File won't open
The export is a JSON file:
- Open with a text editor (VS Code, Notepad++, etc.)
- Or use online JSON viewers
- Or process with programming languages
- Check file wasn’t corrupted during download
Missing data in export
Missing data in export
Verify:
- The learner actually has data (check dashboard)
- You exported the correct learner
- Data wasn’t recently added (try refreshing and re-exporting)
- No errors occurred during export (check browser console)
403 Forbidden error
403 Forbidden error
This means:
- You don’t have permission for this learner
- The learner isn’t one of your children (for parents)
- Session expired - try logging out and back in