扩充江苏高考物理题库。生成高质量题目(含SVG图形),支持单选、实验、计算三种题型。 当用户提到"扩充题库"、"生成物理题"、"题库维护"、"添加题目"时触发。
题库在 OpenClaw workspace 的 .openclaw/question-bank/ 目录下:
.openclaw/question-bank/
├── summary.json # 题库统计
├── validate.js # 验证脚本
├── single/
│ ├── questions.json # 单选题(目标≥50题)
│ └── index.json # 轻量级索引
├── experiment/
│ ├── questions.json # 实验题(目标≥20题)
│ └── index.json
├── calculation/
│ ├── questions.json # 计算题(目标≥20题)
│ └── index.json
├── prompts/ # 生成提示词
│ ├── generate-single.md
│ ├── generate-experiment.md
│ └── generate-calculation.md
└── samples/ # 样本格式
├── single-sample.json
├── experiment-sample.json
└── calculation-sample.json
{
"id": "S153",
"q": "题目文本,含KaTeX公式: $v = v_0 + at$",
"opts": ["选项A", "选项B", "选项C", "选项D"],
"ans": 0,
"explain": "详细解析含公式",
"tag": "运动学",
"difficulty": 1,
"figure": "<svg width='280' height='150' viewBox='0 0 280 150'>...</svg>"
}
{
"id": "E007",
"q": "实验背景描述...",
"blanks": [
{"label": "(1) 测量结果为", "answer": "2.4", "accept": ["2.4","2.40"], "unit": "mm", "points": 3},
{"label": "(2) 实验结论", "answer": "成正比", "accept": ["正比","线性"], "points": 3}
],
"explain": "详细解析",
"tag": "实验",
"difficulty": 2,
"points": 12,
"figure": "<svg>...</svg>"
}
{
"id": "C007",
"q": "计算题背景...",
"blanks": [
{"label": "(1) 求加速度 a=", "answer": "6", "accept": ["6","6.0"], "unit": "m/s²", "points": 4},
{"label": "(2) 求位移 s=", "answer": "9", "accept": ["9","9.0"], "unit": "m", "points": 4}
],
"explain": "完整解题过程",
"tag": "运动学",
"difficulty": 1,
"points": 12,
"figure": "<svg>...</svg>"
}
读取 index.json 了解已有题目的知识点分布和数量。
运行 node validate.js 检查格式正确性。
更新 index.json 和 summary.json。