feat: 初始化 CS 知识应试强化系统
- 纯 HTML/CSS/JS 单页应用,支持填空题和选择题交互 - 5 个主题共 100 道题(GC/JVM、AI 结构化输出、记忆管理、幻觉、工具链) - 按主题组织、按题型拆分的 JSON 数据结构 - JSON Schema 校验 + 提示词模板 + 题型模板 - 自定义导入功能(粘贴/上传 JSON) - 项目文档(需求 + 架构) Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"topic": "example-topic",
|
||||
"type": "code_reading",
|
||||
"schema_version": "1.0.0",
|
||||
"generated": "2026-01-01T00:00:00Z",
|
||||
"questions": [
|
||||
{
|
||||
"id": "dom-sub-top-cr-001",
|
||||
"type": "code_reading",
|
||||
"difficulty": 4,
|
||||
"tags": ["example", "template", "javascript"],
|
||||
"question": "阅读以下 JavaScript 代码,回答子问题。",
|
||||
"code": "function fibonacci(n) {\n if (n <= 1) return n;\n let a = 0, b = 1;\n for (let i = 2; i <= n; i++) {\n [a, b] = [b, a + b];\n }\n return b;\n}\n\nconsole.log(fibonacci(6));",
|
||||
"language": "javascript",
|
||||
"sub_questions": [
|
||||
{
|
||||
"index": 1,
|
||||
"type": "short_answer",
|
||||
"question": "这段代码的输出是什么?",
|
||||
"answer": "8",
|
||||
"explanation": "fibonacci(6) 的计算过程:f(0)=0, f(1)=1, f(2)=1, f(3)=2, f(4)=3, f(5)=5, f(6)=8。最终输出 8。"
|
||||
},
|
||||
{
|
||||
"index": 2,
|
||||
"type": "single_choice",
|
||||
"question": "该算法的时间复杂度是什么?",
|
||||
"options": {
|
||||
"A": "O(1)",
|
||||
"B": "O(n)",
|
||||
"C": "O(n^2)",
|
||||
"D": "O(2^n)"
|
||||
},
|
||||
"answer": "B",
|
||||
"explanation": "该实现使用迭代方式,for 循环执行 n-1 次,每次操作是常数时间,因此时间复杂度为 O(n)。"
|
||||
}
|
||||
],
|
||||
"explanation": "这段代码实现了斐波那契数列的迭代求解。与递归实现相比,迭代版本避免了重复计算,时间复杂度从 O(2^n) 降低到 O(n),空间复杂度为 O(1)。",
|
||||
"source": null,
|
||||
"related": []
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user