feat(相似题): 做对中等、困难题后不再只推一串简单题,每道推荐写出和原题共同的标签

- 共同标签一样多时先给难度最接近的,再并列才先简单的(原来一律简单的在前,
  做对困难题时五条里三条多是简单题)
- 每行第二行写共同的标签(知识点在前、主题在后)和做对人数;带类型标签、
  做过没对的红「−」,写法照题目列表
- 题面里的标题和「提示」「来源」一样,结果页签里的和「还能挑战」对齐

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-11-03 13:06:49 +08:00
1 parent da360e2f68
commit 8c5399755e
6 files changed
+194 -43

No files matched your search

+9
View File
@@ -484,6 +484,14 @@ export const problemListItemSchema = z.object({
export const problemListSchema = paginatedSchema(problemListItemSchema)
/**
* 相似题推荐的一条。`sharedTags` 是它和原题共有的标签(知识点在前、主题在后),
* 学生不点开就知道练的是什么
*/
export const similarProblemSchema = problemListItemSchema.extend({
sharedTags: z.array(z.string()),
})
/** 题目列表「全部类型」下拉:SQL / 有参考图 / 画流程图 / 语法要求 */
export const problemTypeFilterSchema = z.enum(['sql', 'reference', 'flowchart', 'ast'])
@@ -601,6 +609,7 @@ export type ChallengeList = z.infer<typeof challengeListSchema>
export type ProblemDifficulty = z.infer<typeof problemDifficultySchema>
export type ProblemListItem = z.infer<typeof problemListItemSchema>
export type ProblemList = z.infer<typeof problemListSchema>
export type SimilarProblem = z.infer<typeof similarProblemSchema>
export type ProblemTypeFilter = z.infer<typeof problemTypeFilterSchema>
export type ProblemListSort = z.infer<typeof problemListSortSchema>
export type ProblemProgress = z.infer<typeof problemProgressSchema>