| name | exam-generator |
| description | 中国中小学试卷生成器。Use when teacher needs to create exam papers for Chinese primary/middle school. Supports all subjects, multiple question types, official curriculum standards, and accurate answers. Uses web search for latest knowledge. 试卷生成、出题、考试卷。 |
中国中小学试卷生成器
专业试卷生成工具,支持中国中小学各学科,遵循官方课程标准,确保试题准确性。
Features
- 📚 全学科支持: 语文、数学、英语、物理、化学、生物、历史、地理、政治
- 📊 多种题型: 选择题、填空题、判断题、简答题、计算题、作文题
- 🎯 精准出题: 根据知识点和难度要求生成
- 🌐 联网验证: 使用web search获取最新知识和标准答案
- 📐 专业排版: 标准试卷格式,可直接打印
- ✅ 答案准确: 交叉验证确保答案正确
支持的学科
| 学科 | 年级 | 题型 |
|---|
| 语文 | 小学/初中 | 选择、填空、阅读、作文 |
| 数学 | 小学/初中 | 选择、填空、计算、应用 |
| 英语 | 小学/初中 | 选择、填空、阅读、写作 |
| 物理 | 初中 | 选择、填空、实验、计算 |
| 化学 | 初中 | 选择、填空、实验、计算 |
| 生物 | 初中 | 选择、填空、简答 |
| 历史 | 初中 | 选择、填空、简答 |
| 地理 | 初中 | 选择、填空、读图 |
| 政治 | 初中 | 选择、填空、简答 |
Trigger Conditions
- "生成一份试卷" / "Create an exam"
- "出一套数学题" / "Generate math problems"
- "帮我出英语试卷" / "Create English test"
- "根据知识点出题" / "Generate questions for topics"
- "exam-generator"
Step 1: 理解用户需求
请提供以下信息:
学科:语文/数学/英语/物理/化学...
年级:小学X年级/初中X年级
知识点:具体要考察的知识点
题型:选择题/填空题/简答题...
题量:各题型数量
难度:简单/中等/困难
时间:考试时长(分钟)
Step 2: 获取最新知识(联网验证)
使用web-search skill获取准确的知识点和标准答案:
Agent自动调用web-search skill搜索:
- 学科知识点
- 标准答案
- 官方课程标准
知识验证流程
生成试题
↓
搜索标准答案
↓
交叉验证
↓
标记置信度
↓
输出试题
Step 3: 生成试卷
Python代码示例
import os
from datetime import datetime
class ExamGenerator:
def __init__(self, subject, grade, title='考试试卷'):
self.subject = subject
self.grade = grade
self.title = title
self.questions = []
self.answers = []
def add_choice_question(self, question, options, answer, score=2):
"""添加选择题"""
self.questions.append({
'type': 'choice',
'question': question,
'options': options,
'score': score
})
self.answers.append({
'type': 'choice',
'answer': answer,
'score': score
})
def add_fill_blank(self, question, answer, score=2):
"""添加填空题"""
self.questions.append({
'type': 'fill',
'question': question,
'score': score
})
self.answers.append({
'type': 'fill',
'answer': answer,
: score
})
():
.questions.append({
: ,
: question,
: score
})
.answers.append({
: ,
: answer,
: score
})
():
.questions.append({
: ,
: question,
: score
})
.answers.append({
: ,
: answer,
: score
})
():
.questions.append({
: ,
: question,
: score
})
.answers.append({
: ,
: answer,
: score
})
():
.questions.append({
: ,
: question,
: requirements,
: score
})
.answers.append({
: ,
: ,
: score
})
():
total_score = (q[] q .questions)
lang == :
._generate_chinese(total_score)
:
._generate_english(total_score)
():
output = []
output.append()
output.append()
output.append()
output.append()
output.append()
output.append()
output.append()
output.append()
choice_num =
fill_num =
tf_num =
other_num =
q .questions:
q[] == :
output.append()
output.append()
output.append()
i, opt (q[]):
output.append()
output.append()
choice_num +=
q[] == :
output.append()
output.append()
output.append()
output.append()
output.append()
fill_num +=
q[] == :
output.append()
output.append()
output.append()
output.append()
tf_num +=
q[] == :
output.append()
output.append()
output.append()
output.append()
output.append()
output.append()
other_num +=
q[] == :
output.append()
output.append()
output.append()
output.append()
output.append()
output.append()
other_num +=
q[] == :
output.append()
output.append()
output.append()
output.append()
output.append()
output.append()
output.append()
.join(output)
():
output = []
output.append()
output.append()
output.append()
output.append()
i, a (.answers, ):
output.append()
.join(output)
():
docx Document
docx.shared Pt, Cm
docx.enum.text WD_ALIGN_PARAGRAPH
os.makedirs(output_dir, exist_ok=)
doc = Document()
section = doc.sections[]
section.top_margin = Cm()
section.bottom_margin = Cm()
section.left_margin = Cm()
section.right_margin = Cm()
exam_text = .generate_exam()
line exam_text.split():
line.strip():
line line:
doc.add_paragraph(line)
line.startswith() line.startswith() line.startswith():
doc.add_heading(line, level=)
line.startswith() line.startswith() line.startswith():
doc.add_paragraph(line)
:
doc.add_paragraph(line)
exam_path = os.path.join(output_dir, )
doc.save(exam_path)
doc_answer = Document()
answer_text = .generate_answer_sheet()
line answer_text.split():
line.strip():
doc_answer.add_paragraph(line)
answer_path = os.path.join(output_dir, )
doc_answer.save(answer_path)
exam_path, answer_path
exam = ExamGenerator(, , )
exam.add_choice_question(, [, , , ], , )
exam.add_fill_blank(, , )
exam.add_true_false(, , )
exam.add_calculation(, , )
exam.save()
试卷格式标准
试卷结构
┌─────────────────────────────────────────────────────────┐
│ 2026年春季期中考试 │
│ 数学 · 初中一年级 │
│ 考试时间:90分钟 · 满分:100分 │
└─────────────────────────────────────────────────────────┘
姓名:__________ 班级:__________ 学号:__________
一、选择题(每题2分,共20分)
1. 下列哪个是质数?
A. 4 B. 6 C. 7 D. 9
二、填空题(每题2分,共20分)
1. 12的平方根是__________
三、计算题(共60分)
1. 解方程:2x + 5 = 13(10分)
使用示例
生成数学试卷
User: "帮我出一套初中一年级数学试卷,5道选择题,5道填空题,2道计算题"
Agent:
1. 搜索初中数学知识点
2. 生成试题
3. 验证答案
4. 排版输出
生成语文试卷
User: "生成一份小学三年级语文试卷,包含阅读理解"
Agent:
1. 搜索小学语文课程标准
2. 选择合适的阅读材料
3. 生成题目
4. 输出试卷
试题准确性保证
验证流程
生成试题
↓
搜索标准答案
↓
多源交叉验证
↓
标记置信度
↓
输出试题+答案
置信度标记
- ✅ 高置信度:多源验证一致
- ⚠️ 中置信度:单源验证
- ❌ 低置信度:需要人工确认
Notes
- 使用web search获取最新知识
- 答案经过交叉验证
- 支持中英文输出
- 可直接打印