Survey Sessions & Multi-Attempt Specifications
Overview
Survey sessions enable users to take surveys multiple times, track progress, save partial responses, and compare results across attempts. This is crucial for tracking personal development over time.
Related Flows: Session History | Active Session | Take Survey
Session Concept
What is a Session?
- A single instance of a user taking a survey
- Tracks attempt number (1st, 2nd, 3rd, etc.)
- Maintains state (not started, in progress, completed)
- Stores partial responses for resume capability
- Records timing and metadata
Session Lifecycle ✅
Attempt Management
Attempt Numbering ✅
- Sequential numbering per user per survey
- Starts at 1 for first attempt
- Increments for each new attempt
- Historical attempts preserved forever
Attempt Restrictions ✅
- Configurable max attempts per survey
- Time-based restrictions (e.g., once per month, min_days_between_attempts)
- Admin override capability
- Organization-level policies
Progress Tracking
Auto-Save Functionality ✅
- Saves after each question answered
- No data loss on browser crash
- Minimal performance impact
- Conflict resolution for concurrent edits
Progress Indicators ✅
- Question X of Y format
- Percentage complete
- Visual progress bar
- Estimated time remaining
Resume Capability ✅
- Direct link to continue
- Remembers last question viewed
- Shows previously answered questions
- Can modify previous answers before submission
Session States
Not Started
- Session created but no questions answered
- Expires after 30 days if untouched ✅
- Reminder emails scheduled
In Progress
- At least one question answered
- Not all required questions complete
- Can be resumed anytime
- Reminders active
Completed
- All required questions answered
- Final submission confirmed
- Results calculated and stored
- No further modifications allowed
Abandoned
- In progress but inactive for 30+ days
- Can be resumed or start fresh
- Marked differently in analytics
- Partial data preserved
Data Storage
Session Data Structure
{
session_id: "uuid",
user_id: "uuid",
survey_id: "uuid",
attempt_number: 3,
status: "in_progress",
started_at: "2024-01-15T10:00:00Z",
last_activity: "2024-01-15T10:15:00Z",
completed_at: null,
current_question_index: 5,
partial_responses: {
"q1": "answer",
"q2": 4,
"q3": ["option1", "option2"]
},
time_spent_seconds: 900, // ✅ Time tracking
metadata: {
browser: "Chrome 120",
device: "desktop",
ip_country: "US"
}
}
Comparison Features
Previous Attempts Display
- Show last attempt date
- Display previous scores
- Highlight changes
- Show improvement trends
Side-by-Side Comparison 🔲 Not yet
- Current vs Previous (backend models exist, no UI)
- Current vs First
- Current vs Best
- Any two attempts
Delta Calculations ✅
- Percentage change (in impact comparison)
- Absolute change
- Direction indicators
- Statistical significance
Visual Comparisons
- Line charts for trends
- Bar charts for categories
- Radar charts for Maslow
- Heat maps for patterns
Maslow-Specific Features
Score Tracking
- Five category scores per attempt
- Overall score calculation
- Historical score preservation
- Benchmark comparisons
Category Evolution
Attempt 1: Physiological: 60%, Safety: 70%, ...
Attempt 2: Physiological: 65%, Safety: 75%, ...
Delta: Physiological: +5%, Safety: +5%, ...
Insights Generation
- Biggest improvements
- Areas needing attention
- Consistency analysis
- Prediction modeling (future)
User Interface
Dashboard View ✅
- "Start New Attempt" button
- Previous attempts list
- Last attempt summary
- Quick comparison stats
During Survey
- Progress indicator
- Save & Exit option
- Previous answer review
- Time elapsed display
Results View
- Current attempt results
- Comparison with previous
- Historical trend charts
- Export/Share options
Technical Considerations
Performance
- Efficient partial save operations
- Optimized comparison queries
- Cached calculation results
- Pagination for history
Concurrency
- Handle multiple tabs/devices
- Conflict resolution strategy
- Real-time sync (future)
- Session locking mechanism
Data Integrity
- Validate partial responses
- Prevent duplicate submissions
- Audit trail for changes
- Backup and recovery
Analytics & Reporting
Individual Analytics
- Attempts over time
- Average time per attempt
- Completion rate
- Score progression
Organization Analytics
- Member attempt patterns
- Average attempts per member
- Completion rate by attempt number
- Time-based patterns
Behavioral Insights
- Drop-off points
- Question difficulty analysis
- Optimal survey length
- Best time to survey
Mobile Considerations
Responsive Design
- Touch-friendly interface
- Swipe navigation
- Auto-save on app background
- Offline capability (future) 🔲 Not yet
Cross-Device Resume 🔲 Not yet
- Start on phone, finish on desktop
- Sync across devices
- QR code for quick access
- Push notifications (future) 🔲 Not yet
Privacy & Security
Data Protection
- Encrypted storage
- Secure session tokens
- IP-based validation
- Rate limiting
User Control
- Delete attempts
- Export personal data
- Control visibility
- Consent management
Future Enhancements
Advanced Features 🔲 Not yet
- AI-powered insights
- Predictive scoring
- Peer comparisons (anonymous)
- Goal setting and tracking
Gamification 🔲 Not yet
- Streaks for regular attempts
- Badges for improvements
- Leaderboards (optional)
- Achievement system
Integration
- Calendar reminders
- Health app integration
- Coaching recommendations
- Action plan generation