Interactive video và storage health
Ngoài video HLS/DASH thông thường, LMS có lớp interactive video kiểu H5P-like: hotspot, fill blank, drag drop và event tracking.
Interactive video
| Thành phần | File | Ý nghĩa |
|---|---|---|
| Type model | fe/src/app/api/types/interactive-video.types.ts |
Định nghĩa hotspot, fill_blank, drag_drop |
| Runtime logic | fe/src/app/core/utils/interactive-video-runtime.ts |
Evaluate đáp án, require correct before continue |
| Activity API | LearningActivityControllerV3 |
POST /api/v3/learning/interactive-video/events |
| Teacher preview/spec | docs/superpowers/specs/2026-05-07-h5p-like-interactive-video-design.md |
Thiết kế interactive video |
Storage health/offline recovery
| Thành phần | File | Vai trò |
|---|---|---|
| IndexedDB schema | fe/src/app/core/db/lms-offline.db.ts |
Courses, lessons, quizData, progress, syncQueue |
| Health service | offline-storage-health.service.ts |
Kiểm tra/reset offline storage |
| Course download | course-download.service.ts |
Download metadata/video/quiz cho offline |
| Offline sync | offline-sync.service.ts |
Đẩy queue khi online lại |
| PWA repair | pwa-repair.component.ts, clear-site-data.component.ts |
Màn tự sửa khi service worker/storage lỗi |
Vì sao cần storage health?
Offline learning dùng browser storage, nên có thể gặp quota, corruption, service worker stale hoặc cache cũ. LMS có recovery surface để user tự sửa thay vì kẹt màn trắng.
Khi debug
- Kiểm tra
Application > IndexedDBtrong DevTools. - Kiểm tra service worker và Cache Storage.
- Mở route
/pwa-repair,/reset-sw, hoặc/clear-site-data. - Chạy e2e offline smoke nếu có thay đổi lớn:
fe/e2e/offline-learning-smoke.spec.ts.
Offline downloads và settings là device-local, không phải dữ liệu roaming theo tài khoản.