Bỏ qua, tới nội dung chính

Kiến trúc · ADR 0036

ADR-0036: Student-only resource reading and durable resume

Trạng thái
Ngày
Người quyết định

Decision

Read existing Document metadata through a Student GET endpoint. Check course access, published lesson and ENROLLED visibility for every read. Return an explicit metadata allowlist; never return storage keys or provider credentials. Only validated HTTPS links are offered. P2 does not fetch arbitrary external file bytes on the server. External links retain the hosting service's own access policy. Storage-key-only files show an unavailable message until P1 provides a supported file endpoint.

Embed valid YouTube links with the existing player. Load its SDK after a student clicks play. Document-backed video positions persist in LessonProgress. Legacy Markdown videos embed but have no document ID for durable playback saving.

Add only lastAccessedAt, videoDocumentId and lastPositionSeconds to LessonProgress. Opening a lesson touches visit order atomically. Playback saves preserve completion and visit order, avoiding late writes that select the previous lesson on resume. Resume finds the most recently accessed published lesson, falling back to the first.

The migration adds missing columns without dropping data. If an earlier draft's migration was already applied, preserve that historical file; the new migration accepts its existing fields. It does not remove any earlier file payloads.

No upload/create/delete resource endpoint, file payload table, new storage provider, instructor UI or new quiz behavior is introduced by this Student-only revision. The pre-existing optional-value TypeScript issue in quiz-builder receives only a null fallback so the whole application can build.