teaching: run lessons in-app through an iframe-driven console
The teaching console now lives inside Web FreeCAD: web/teaching-console.html hosts the workbench in a same-origin iframe and drives its DOM directly, with no Node server and no spawned Chrome. The driver modules run in the framed page's own realm (bridge.ts publishes window.__teaching), so the proven driver/assembly code is reused unchanged and the CSP without 'unsafe-eval' is never crossed. - steps.ts globs both courses' ui-steps records (skipping their index.json manifests) so each lesson downloads only its own chunk - runner.ts checks prerequisites in dependency order, then runs part or assembly lessons; a pass stores the FCStd in OPFS freecad-documents under the course document name, which is what assembly lessons consume - assembly lessons insert, joint, solve and save through lib/assembly.mjs; insertLink falls back to UI-suffixed object names (Body1 for Body) - check-inapp-console.mjs (npm run check:console-inapp) is green: preflight, P01 volume within 6e-13, OPFS evidence, both viewports - run-inapp-lessons.mjs runs a whole course in one browser; reducer 23 parts + assembly and carrier 20 parts + assembly all pass in-browser Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
"check:tools-manual": "node ../tools/build-tools-manual.mjs --verify && node ../tools/check-tools-manual.mjs",
|
||||
"build:console": "node tools/teaching-console/build-console.mjs",
|
||||
"check:console": "node tools/teaching-console/build-console.mjs --check && node tools/teaching-console/self-test.mjs",
|
||||
"check:console-inapp": "node tools/teaching-console/check-inapp-console.mjs",
|
||||
"teach:console": "node teaching/server.mjs",
|
||||
"reducer:list": "node ../tools/reducer/list.mjs",
|
||||
"reducer:part": "node ../tools/reducer/create-part.mjs",
|
||||
|
||||
Reference in New Issue
Block a user