feat: 獨立測驗模式 + 掌握度雲端教師鑽取 + 母港疊實景背景 - #117
Merged
Merged
Conversation
收尾三項 ROADMAP 延伸候選(對應 GAME_DESIGN §19): 1) 獨立測驗模式(#exam) - 新增純函式引擎 state/exam.ts:buildExam(可決定性種子、跨類別 round-robin 均衡抽題、排除需輔助圖者以純文字公平作答)、gradeExam(A–F 等第/各類別對錯/ 錯題清單)、isCorrect/examGrade。 - ExamModal:固定 10/20 題、作答不給提示不揭示對錯,結束才公布總分+各類別 表現條+錯題覆盤(揭示正解與教訓)。入口在 ⚙ 課程模式。 - 新增 RECORD_EXAM action:批次計入知識點掌握度+錯題本,但不動 xp/answerStreak → 評量與遊戲經濟隔離。最佳成績 bestExam 存 records(只增不減、union 取大), 個人檔案頁顯示。 2) 掌握度雲端同步・教師端個別鑽取(#mastery-cloud) - mastery.ts:masterySummary/parseMasterySummary(只帶 n>0 的格、[n,ok] 元組、 容錯解析)。 - 存檔上傳夾帶掌握度摘要(GameContext + ProgressSummary.mastery);ClassRow 增讀 選填 mastery。 - TeacherModal:點任一學生列展開鑽取,沿用 ProfileModal 同一套 masteryRows 顯示各科別/類別正確率條與最弱項;無資料時優雅降級並提示需後端 v2.2。 - 後端 Code.gs v2.2:saves 新增第 9 欄 mastery,save 寫入、teacher 回傳; CLOUD_SETUP.md 註明需「新版本」重部署(向後相容)。 3) 母港建設疊實境/漫畫背景(#port) - PortScene 接受 mode:實境→harbor.jpg、漫畫→comic_harbor.jpg 作底,建設 sprite 疊其上+下半暗化保可讀;模擬維持原 CSS 漸層(向後相容)。App→PortModal→PortScene 傳遞全域背景模式,並顯示目前背景提示。 測試/驗證: - test/run.mjs +5 測試(164 passed):exam buildExam/gradeExam/RECORD_EXAM、 masterySummary 往返、records bestExam。 - typecheck / build 通過。 - Playwright 端到端實測:訪客登入→課程→測驗 10 題→結果頁(100% A、各類別 對錯、個人最佳、錯題本整合);母港建設於實境模式疊 harbor.jpg 背景。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AC7ERcxjL7dhsYv9PncydP
dofliu
marked this pull request as ready for review
July 10, 2026 09:09
dofliu
pushed a commit
that referenced
this pull request
Jul 14, 2026
README.md / README.zh-TW.md: - 更新測試數 154→164、故障型錄「5 種」→「25 種、五大科別」。 - 戰情室補「人力短缺/罷工實效化」(缺工折抵現場作業面)。 - 教學設計補「獨立測驗模式」與「教師檢視面板+掌握度個別鑽取」。 - 技術補「母港建設疊實境/漫畫背景」與 PWA/啟動安全網。 - 專案結構補 exam.ts/mastery.ts/records.ts、ExamModal/TeacherModal/PortModal、cloud/api.ts。 docs/HANDOFF.md: - 全面刷新:現況(main=PR #117、164 測試、dev branch 名)。 - 把 bearing/crew/exam/mastery-cloud/port 五項由「下一步候選」移到「已完成」。 - 重寫「後續接續工作」(立即可做/需後端/願景)並保留視覺驗證與模擬器蝴蝶效應備忘。 docs/ROADMAP.md: - 補 PR #116/#117 完成註記,更新測試數 154→164、複審日期。 - 新增「後續接續工作 — Next」接手清單章節。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AC7ERcxjL7dhsYv9PncydP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
收尾三項 ROADMAP「後續延伸候選」,對應 GAME_DESIGN.md §19。三者相互獨立、皆向後相容。
1. 獨立測驗模式(#exam)
把判斷型題庫抽成一份正式評量:
src/state/exam.ts:buildExam(可決定性種子、跨類別 round-robin 均衡抽題、排除需輔助圖者以純文字公平作答)、gradeExam(A–F 等第/各類別對錯/錯題清單)、isCorrect/examGrade。ExamModal:固定 10/20 題、作答不給提示不揭示對錯,結束才公布總分+各類別表現條+錯題覆盤(揭示正解與教訓)。入口在 ⚙ 課程模式。RECORD_EXAMaction:批次計入知識點掌握度+錯題本(供主動回想),但不動 xp/answerStreak → 評量與遊戲經濟隔離。最佳成績bestExam存 records(只增不減、cloud union 取大),個人檔案頁顯示。2. 掌握度雲端同步・教師端個別鑽取(#mastery-cloud)
masterySummary/parseMasterySummary(只帶 n>0 的格、[n,ok]元組、容錯解析);存檔上傳夾帶掌握度摘要(ProgressSummary.mastery);ClassRow增讀選填mastery。masteryRows(disc/cat)顯示各科別/類別正確率條與最弱項;無資料時優雅降級並提示需後端 v2.2。Code.gsv2.2:saves新增第 9 欄mastery(save 寫入、teacher 回傳)。需「新版本」重部署才會有鑽取資料;未升級時前端照舊運作(見 CLOUD_SETUP.md)。3. 母港建設疊實境/漫畫背景(#port)
PortScene依全域背景模式選底——實境→harbor.jpg、漫畫→comic_harbor.jpg,母港建設 sprite 疊其上+下半暗化保可讀;模擬模式維持原 CSS 漸層(向後相容)。App→PortModal→PortScene 傳遞背景模式並顯示提示。呼應 §16「後續可把 PortScene 疊到母港實景背景」。測試與驗證
npm test:164 passed / 0 failed(新增 5 項:exambuildExam/gradeExam/RECORD_EXAM、masterySummary往返、recordsbestExam)npm run typecheck/npm run build:通過harbor.jpg背景、hint 顯示「背景:實境」✅變更檔案
src/state/exam.ts、src/ui/ExamModal.tsxgame.ts(RECORD_EXAM)、records.ts(bestExam)、mastery.ts(雲端摘要)、cloud/api.ts(ProgressSummary/ClassRow)、GameContext.tsx(上傳摘要)CourseModal(測驗入口)、TeacherModal(鑽取)、PortScene/PortModal/App(疊實景)、ProfileModal(bestExam)Code.gs(v2.2)、CLOUD_SETUP.md、GAME_DESIGN.md(§19)、ROADMAP.md、STATUS.yamltest/run.mjs相容性 / 部署備註
bestExam/mastery皆選填,舊檔預設空)。🤖 Generated with Claude Code
https://claude.ai/code/session_01AC7ERcxjL7dhsYv9PncydP
Generated by Claude Code