feat(看板娘): 接上全班进度、难度、提示、知识点、排名等数据,说的话更贴每个人
Deploy / deploy (push) Successful in 50s

- 题目页:这节课同班做对的人多就说「全班已经 N 个人做对了」、都卡着就安慰、第一个做对的夸一句;
  通过率不到三成的题错了说「本来就难」、高于七成的说「再看看题」;AI 提示开了没用就提一句;
  做对了还有挑战就问敢不敢;流程图分低、拿 S 各有话
- 常点「太难了」的学生错了换软话;这周交得多、例子跑得少的念一句;卡住却从不举手的劝举手;
  这周要提示多的劝先自己想
- 首页(这节课没要做的时)每次戳随机说一件:知识点差几道升级、周榜差几道超过前一名、
  今天明天的比赛、三天内的新公告;两周以上没来说「好久不见」,只说一回
- 排名页第一名、差前一名几道;成就页差一点的;自学没全对的练一练;专题差最后一道拿奖章
- 运行例子、自己输入、举手也记进 mascot_event(trial、help),GET /mascot/profile
  多给「太难了」次数和这一周交、跑例子、举手、要提示的次数

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-11-03 16:33:35 +08:00
1 parent 81ef4dca6b
commit aa7e0a6eb8
12 files changed
+296 -25

No files matched your search

+15 -2
View File
@@ -10,9 +10,13 @@ import { z } from 'zod'
* - `overclick`:连点到她嫌烦
* - `move`:被拖到了别处(line 记落点贴的边,比如 `right bottom`)
*
* 只记看板娘这边的事,不记代码、不记按键。
* 另外两种不是对她做的,是她要看的行为,别处没有存:
* - `trial`:在题目页运行了例子 / 自己输入(action 记 `samples` / `custom`)
* - `help`:在题目页举了手
*
* 不记代码、不记按键。
*/
export const MASCOT_EVENT_KINDS = ['open', 'action', 'speak', 'pat', 'overclick', 'move'] as const
export const MASCOT_EVENT_KINDS = ['open', 'action', 'speak', 'pat', 'overclick', 'move', 'trial', 'help'] as const
export const mascotEventKindSchema = z.enum(MASCOT_EVENT_KINDS)
export type MascotEventKind = z.infer<typeof mascotEventKindSchema>
@@ -37,6 +41,15 @@ export const mascotProfileSchema = z.object({
pokes: z.number().int(),
/** 今天(东八区)做对了几道不同的题 */
todaySolved: z.number().int(),
/** 一共点过几次「太难了」(做对后的点评) */
tooHard: z.number().int(),
/** 这一周(东八区周一零点起):题库里交了几次、跑了几次例子、举了几次手、要了几次 AI 提示 */
week: z.object({
submits: z.number().int(),
trials: z.number().int(),
helps: z.number().int(),
aiHints: z.number().int(),
}),
recent: z.object({
total: z.number().int(),
wrongAnswer: z.number().int(),