中国中小学试卷生成器。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. 试卷生成、出题、考试卷。
专业试卷生成工具,支持中国中小学各学科,遵循官方课程标准,确保试题准确性。
| 学科 | 年级 | 题型 |
|---|---|---|
| 语文 | 小学/初中 | 选择、填空、阅读、作文 |
| 数学 |
请提供以下信息:
学科:语文/数学/英语/物理/化学...
年级:小学X年级/初中X年级
知识点:具体要考察的知识点
题型:选择题/填空题/简答题...
题量:各题型数量
难度:简单/中等/困难
时间:考试时长(分钟)
使用网络搜索技能获取准确的知识点和标准答案:
Agent自动调用网络搜索技能搜索:
生成试题
↓
搜索标准答案
↓
交叉验证
↓
标记置信度
↓
输出试题
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 addchoicequestion(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 addfillblank(self, question, answer, score=2):
添加填空题
self.questions.append({
type: fill,
question: question,
score: score
})
self.answers.append({
type: fill,
answer: answer,
score: score
})
def addtruefalse(self, question, answer, score=1):
添加判断题
self.questions.append({
type: true_false,
question: question,
score: score
})
self.answers.append({
type: true_false,
answer: answer,
score: score
})
def addshortanswer(self, question, answer, score=10):
添加简答题
self.questions.append({
type: short_answer,
question: question,
score: score
})
self.answers.append({
type: short_answer,
answer: answer,
score: score
})
def add_calculation(self, question, answer, score=15):
添加计算题
self.questions.append({
type: calculation,
question: question,
score: score
})
self.answers.append({
type: calculation,
answer: answer,
score: score
})
def add_essay(self, question, requirements, score=30):
添加作文题
self.questions.append({
type: essay,
question: question,
requirements: requirements,
score: score
})
self.answers.append({
type: essay,
answer: 见评分标准,
score: score
})
def generate_exam(self, lang=zh):
生成试卷
total_score = sum(q[score] for q in self.questions)
if lang == zh:
return self.generatechinese(total_score)
else:
return self.generateenglish(total_score)
def generatechinese(self, total_score):
生成中文试卷
output = []
output.append(f┌{─*60}┐)
output.append(f│ {self.title})
output.append(f│ {self.subject} · {self.grade})
output.append(f│ 考试时间:90分钟 · 满分:{total_score}分)
output.append(f└{─*60}┘)
output.append()
output.append(姓名: 班级: 学号:)
output.append()
choice_num = 1
fill_num = 1
tf_num = 1
other_num = 1
for q in self.questions:
if q[type] == choice:
output.append(f一、选择题(每题{q[score]}分))
output.append()
output.append(f{choice_num}. {q[question]})
for i, opt in enumerate(q[options]):
output.append(f {chr(65+i)}. {opt})
output.append()
choice_num += 1
elif q[type] == fill:
output.append(f二、填空题(每空{q[score]}分))
output.append()
output.append(f{fill_num}. {q[question]})
output.append( 答案:)
output.append()
fill_num += 1
elif q[type] == true_false:
output.append(f三、判断题(每题{q[score]}分))
output.append()
output.append(f{tf_num}. {q[question]} ( ))
output.append()
tf_num += 1
elif q[type] == short_answer:
output.append(f四、简答题(每题{q[score]}分))
output.append()
output.append(f{other_num}. {q[question]})
output.append()
output.append()
output.append()
other_num += 1
elif q[type] == calculation:
output.append(f五、计算题(每题{q[score]}分))
output.append()
output.append(f{other_num}. {q[question]})
output.append()
output.append()
output.append()
other_num += 1
elif q[type] == essay:
output.append(f六、作文({q[score]}分))
output.append()
output.append(f{q[question]})
output.append(f要求:{q.get(requirements, )})
output.append()
output.append()
output.append()
return \n.join(output)
def generateanswersheet(self, lang=zh):
生成答案
output = []
output.append(f{=*60})
output.append(f{self.title} - 参考答案)
output.append(f{=*60})
output.append()
for i, a in enumerate(self.answers, 1):
output.append(f{i}. {a[answer]} ({a[score]}分))
return \n.join(output)
def save(self, output_dir):
保存试卷和答案(Word格式)
from docx import Document
from docx.shared import Pt, Cm
from docx.enum.text import WDALIGNPARAGRAPH
os.makedirs(outputdir, existok=True)
# 生成试卷Word文档
doc = Document()
# 设置页面
section = doc.sections[0]
section.top_margin = Cm(2.54)
section.bottom_margin =
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 exam-generator-1776010921 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 exam-generator-1776010921 技能
skillhub install exam-generator-1776010921
文件大小: 4.75 KB | 发布时间: 2026-4-13 10:12