A front-end e-learning platform: a course catalog, video lessons, progress tracking and a short quiz per course. No backend, no build step and no dependencies. Lessons are public YouTube videos, credited to their creators.
- Catalog: rendered from one data file (
js/course-data.js), with category filters and free-text search across course titles, descriptions, lesson titles and authors. Filters and search are kept in the URL. - Course page: a lesson list beside a YouTube player (iframe API). Clicking a lesson switches video without reloading the page.
- Progress: a lesson is marked done automatically when its video ends, or by hand. Progress bars on the catalog and course page.
- Resume: the playback position is saved every 5 seconds, so a lesson reopens where you stopped.
- Continue where you left off: shown on the catalog for the first unfinished course.
- Knowledge check: a 3-question quiz per course, unlocked when every lesson is done. The best score is saved.
- Robust storage: progress lives in
localStorageunderwl-progress. Reads go throughJSON.parseinsidetry/catch, and storage errors (private mode, full quota) are tolerated. - Fallback: if the YouTube API cannot load, the page offers a direct link to the video.
- Accessible: real buttons,
aria-pressedfilters, a labelled progress bar,aria-currenton the playing lesson, and text set withtextContentonly.
npx serve . # or: python3 -m http.serverUse a local server, not file://. The YouTube iframe API talks to the page with postMessage, which does not work from a null origin.
node --test test/The unit tests cover per-course progress, duplicate-proof completion, undoing a lesson, corrupt and old-format data, storage that throws, resume points, best quiz score, percentages, quiz scoring, filtering and search, and the shape of the catalog data.
The repository was also tested end to end in Chrome: filters, search, the YouTube player loading, completion, quiz unlocking and scoring, persistence across reloads, the "not found" page, phone width, and a real video playing to the end and marking its lesson done.
// localStorage['wl-progress']
{
"git-101": {
"done": ["git-101-l1", "git-101-l2"],
"quiz": 3,
"resume": { "git-101-l2": 312 }
}
}Add an object to courses in js/course-data.js with an id, title, category, level, description, lessons (each with id, title, videoId, author) and a quiz. Nothing else changes.
MIT for the code. Videos belong to their creators and are embedded with YouTube's player.