Auto-Save & Offline Mode
BeamEdUp includes automatic answer saving and full offline support to protect your work during exams. Whether your internet drops or you accidentally close the tab, your answers are preserved and synchronized when connectivity is restored.
Auto-Save
The platform automatically saves your current answer every 30 seconds while you are on a question. The auto-save process works as follows:
- A background interval runs every 30 seconds and checks if the current question has an answer
- If an answer exists, it is sent to the server via the
learnerExamsApi.saveAnswer()endpoint - On success, a green "Saved Xs ago" badge appears in the header bar showing the last save time
- Navigating between questions also triggers an implicit save since your answer state is maintained in memory
Offline Mode (PWA)
BeamEdUp's Organization Portal is a Progressive Web App (PWA) with full offline support for exam-taking. If your internet connection drops during an exam, the platform seamlessly switches to offline mode.
1
Connection Lost
When your internet connection drops, the platform detects it automatically via the useOnlineStatus hook. An orange "Offline Mode Active" alert banner appears, and the header displays an "Offline Mode" badge.
2
Answers Saved Locally
Your answers are saved to IndexedDB (browser local storage) instead of the server. Each answer is stored with a synced: false flag, ensuring nothing is lost even if the browser crashes.
3
Sync Queue
Each saved answer is also added to a sync queue. The SyncProgress component shows the number of items waiting to be synced and the last sync timestamp.
4
Reconnection & Sync
When connectivity is restored, the useOfflineSync hook automatically processes the sync queue. Each queued answer is sent to the server in order, with retry logic for failed requests.
5
Offline Submission
If you submit while offline, the submission is queued and will be sent when you reconnect. A notification confirms that the exam will be submitted once you are back online.
Offline Exam Loading
For offline mode to work, the exam data must be available locally. When you start an exam online, the questions and metadata are cached in IndexedDB via the getOfflineExam() utility. If you go offline after starting, the cached exam data is used to display questions and accept answers.
Sync Progress
When there are items in the sync queue (answers saved while offline), a sync progress bar appears below the exam header. It displays:
- Whether a sync operation is currently in progress
- The number of items remaining in the queue
- The timestamp of the last successful sync
- Any sync errors, with a retry button to manually trigger a sync