mirror of
https://github.com/THU-MAIC/OpenMAIC.git
synced 2026-10-29 00:46:40 +08:00
* feat(export): give PBL scenes a placeholder slide in the PPTX PBL scenes now get a placeholder slide at their position in the lesson, in the standalone PPTX and in the Resource Pack PPTX, like interactive and quiz scenes. A project runs only online, so the slide carries the same "Open online" button, QR code, URL and link hotspots, and no offline link (the pack has no page for it). The slide shows the project's briefing: the goal (learning objective, else the scenario goal), the milestone count and up to four milestone titles in order, cut to one line by display width. The briefing comes from the projection the standalone HTML export uses, now shared in lib/export/pbl-briefing.ts, so legacy projects are upgraded the same way and role prompts, evaluations, submissions and chat history never reach the slide. A project that is missing or unreadable falls back to the title and description. PBL narration is not copied into the notes. A lesson with only PBL scenes now exports a PPTX instead of reporting nothing to export. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(export): let users turn PPTX placeholder slides off The export menu gets an "Include placeholder slides" setting next to "Export PPTX" and "Export Resource Pack". A tooltip (on hover and on keyboard focus) explains that interactive pages, quizzes and PBL projects get a slide at their place in the lesson, with an "Open online" button and a QR code. Toggling it keeps the menu open and starts no export. The setting is on by default and remembered per browser in localStorage; unreadable storage falls back to on. It reaches the exports as an explicit option (useExportPPTX({ includePlaceholders }), planPptxDeck, buildResourcePackZip): - Off: both PPTX exports hold the slide scenes only, and the Resource Pack still ships the interactive HTML pages. - Off with no slide scenes: "Export PPTX" reports there are no slides, and the Resource Pack ships the HTML pages without a PPTX and says so (the "PPTX skipped" message is restored for this case). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(export): cut placeholder text by grapheme cluster Placeholder titles, quiz stems and PBL lines were cut by UTF-16 code units or code points, which could split an accented letter, a ZWJ emoji sequence or a surrogate pair, and emoji counted as narrow. Text is now split into grapheme clusters with Intl.Segmenter (code points where it is unavailable). Width-limited lines count wide characters and emoji clusters (flags, skin tones, ZWJ sequences, keycaps) as two columns, reserve room for the ellipsis, and never cut inside a cluster. Length-limited titles count clusters, so no lone surrogate is left behind. The export-menu e2e spec now waits on the elements it uses instead of network idle, keeps its download counter across the reload, and checks the setting from the keyboard (focus shows the tooltip; Space and Enter toggle it without closing the menu or exporting). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(export): choose placeholder slides per export in submenus The "Include placeholder slides" checkbox read like another export action. "Export PPTX" and "Export Resource Pack" are now submenus, built like "Download Script": - Export PPTX: "With placeholder slides (recommended)" or "Slides only", each with a short explanation. - Export Resource Pack: "PPTX with placeholders + interactive pages (recommended)" or "Slides-only PPTX + interactive pages". The choice is made per export, so nothing is remembered: the stored preference, its tooltip and its tests are removed. exportPPTX() and exportResourcePack() take { includePlaceholders } per call (default true) instead of the hook-level option. Gating, the exporting state and the slides-only fallbacks (no slides to export; HTML pages without a PPTX) are unchanged. The e2e spec covers both submenus by pointer and keyboard and checks the slide count of every downloaded deck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(i18n): match the Resource Pack submenu wording to its parent item Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>