Files
wonder d3cba0e23c feat: 初始化 CS 知识应试强化系统
- 纯 HTML/CSS/JS 单页应用,支持填空题和选择题交互
- 5 个主题共 100 道题(GC/JVM、AI 结构化输出、记忆管理、幻觉、工具链)
- 按主题组织、按题型拆分的 JSON 数据结构
- JSON Schema 校验 + 提示词模板 + 题型模板
- 自定义导入功能(粘贴/上传 JSON)
- 项目文档(需求 + 架构)

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-02 18:22:20 +08:00

250 lines
6.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 题目生成提示词模板
## 使用方法
将以下提示词中的 `{变量}` 替换为实际内容,发送给 LLM。
---
## 提示词
你是一个计算机科学教育专家。请根据以下要求生成题目:
**主题**: {topic_name}
**领域**: {domain_name} > {subdomain_name}
**题型**: {question_type}
**数量**: {count}
**难度范围**: {min_difficulty}-{max_difficulty}
**知识点标签**: {tags}
### 输出格式要求
请严格按照以下 JSON Schema 输出,不要添加任何额外内容:
```json
{
"topic": "{topic_slug}",
"type": "{question_type}",
"schema_version": "1.0.0",
"generated": "{ISO-8601 timestamp}",
"questions": [
// 根据题型填写,参见下方题型说明
]
}
```
### 题型说明
#### 单选题 (single_choice)
- 4 个选项,只有 1 个正确答案
- 选项应具有合理的干扰性
- 解析应说明为什么正确答案正确,其他选项为什么错误
```json
{
"id": "domain-subdomain-topic-sc-001",
"type": "single_choice",
"difficulty": 3,
"tags": ["tag1", "tag2"],
"question": "题目内容?",
"options": {
"A": "选项 A",
"B": "选项 B",
"C": "选项 C",
"D": "选项 D"
},
"answer": "A",
"explanation": "详细解析...",
"source": null,
"related": []
}
```
#### 多选题 (multiple_choice)
- 4-6 个选项,2-3 个正确答案
- 解析应说明每个选项的对错原因
```json
{
"id": "domain-subdomain-topic-mc-001",
"type": "multiple_choice",
"difficulty": 3,
"tags": ["tag1", "tag2"],
"question": "以下哪些是正确的?(多选)",
"options": {
"A": "选项 A",
"B": "选项 B",
"C": "选项 C",
"D": "选项 D"
},
"answer": ["A", "C"],
"explanation": "A 正确因为...,B 错误因为...,C 正确因为...,D 错误因为...",
"source": null,
"related": []
}
```
#### 判断题 (true_false)
- 陈述一个明确的事实或概念
- answer 为 true 或 false
- 解析应解释为什么对或错
```json
{
"id": "domain-subdomain-topic-tf-001",
"type": "true_false",
"difficulty": 2,
"tags": ["tag1", "tag2"],
"question": "判断以下陈述是否正确:某概念的描述。",
"answer": true,
"explanation": "该陈述正确/错误,因为...",
"source": null,
"related": []
}
```
#### 填空题 (fill_blank)
- 题目中用 `______` 标记空白处
- answer 数组可包含多个可接受的答案
- answer_rule: "any"(任一匹配)、"all"(全部匹配)、"ordered"(按顺序匹配)
- 解析应说明答案的来源和上下文
```json
{
"id": "domain-subdomain-topic-fb-001",
"type": "fill_blank",
"difficulty": 3,
"tags": ["tag1", "tag2"],
"question": "______ 协议工作在 OSI 模型的第 ______ 层。",
"answer": ["HTTP", "7"],
"answer_rule": "ordered",
"explanation": "HTTP 是应用层协议,工作在 OSI 模型的第 7 层(应用层)。",
"source": null,
"related": []
}
```
#### 简答题 (short_answer)
- 提出开放性问题
- 提供参考答案和评分关键词
- keywords 用于自动评分匹配
- scoring_rubric 描述评分标准
- 解析应包含完整的回答思路
```json
{
"id": "domain-subdomain-topic-sa-001",
"type": "short_answer",
"difficulty": 4,
"tags": ["tag1", "tag2"],
"question": "请简述某概念的原理和应用场景。",
"answer": "参考答案内容...",
"keywords": ["关键词1", "关键词2", "关键词3"],
"scoring_rubric": "答对核心原理得 60 分;举出应用场景得 20 分;说明优缺点得 20 分。",
"explanation": "完整解析...",
"source": null,
"related": []
}
```
#### 代码阅读题 (code_reading)
- 提供完整的代码片段
- 设置 2-3 个子问题(可以是任何题型)
- 解析应逐步分析代码执行过程
```json
{
"id": "domain-subdomain-topic-cr-001",
"type": "code_reading",
"difficulty": 4,
"tags": ["tag1", "tag2"],
"question": "阅读以下代码,回答问题。",
"code": "// 代码片段",
"language": "python",
"sub_questions": [
{
"index": 1,
"type": "single_choice",
"question": "子问题 1",
"options": { "A": "...", "B": "...", "C": "...", "D": "..." },
"answer": "A",
"explanation": "解析..."
},
{
"index": 2,
"type": "short_answer",
"question": "子问题 2",
"answer": "参考答案",
"keywords": ["关键词"],
"explanation": "解析..."
}
],
"explanation": "整体代码解析...",
"source": null,
"related": []
}
```
#### 场景分析题 (scenario)
- 描述一个实际的技术场景
- 设置 2-3 个分析性子问题
- 解析应提供系统性的分析框架
```json
{
"id": "domain-subdomain-topic-sn-001",
"type": "scenario",
"difficulty": 5,
"tags": ["tag1", "tag2"],
"question": "请分析以下技术场景。",
"context": "详细场景描述...",
"code": null,
"sub_questions": [
{
"index": 1,
"type": "short_answer",
"question": "分析性问题 1",
"answer": "参考答案",
"keywords": ["关键词"],
"scoring_rubric": "评分标准",
"explanation": "解析..."
},
{
"index": 2,
"type": "multiple_choice",
"question": "选择性问题 2",
"options": { "A": "...", "B": "...", "C": "...", "D": "..." },
"answer": ["A", "C"],
"explanation": "解析..."
}
],
"explanation": "整体场景分析...",
"source": null,
"related": []
}
```
### ID 命名规则
题目 ID 格式:`{domain}-{subdomain}-{topic}-{type_code}-{number}`
- domain: 领域缩写(如 os, net, db, algo, ai)
- subdomain: 子领域缩写
- topic: 主题缩写
- type_code: 题型代码(sc/mc/tf/fb/sa/cr/sn)
- number: 三位数字序号(001-999)
### 注意事项
1. 每道题必须包含完整的 explanation(解析)
2. 难度等级 1-5:1=基础概念,2=理解应用,3=分析综合,4=评价设计,5=创新拓展
3. tags 应包含具体知识点,便于后续统计和筛选
4. source 字段可填 null,如有参考资料请填写
5. related 字段可填空数组,如有相关题目 ID 请填写