← 返回 Skills 市场
tobewin

Exam Generator

作者 ToBeWin · GitHub ↗ · v1.0.3 · MIT-0
cross-platform ✓ 安全检测通过
430
总下载
1
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install exam-generator
功能描述
中国中小学试卷生成器。Use when teacher needs to create exam papers for Chinese primary/middle school. Supports all subjects, multiple question types, official curriculu...
使用说明 (SKILL.md)

中国中小学试卷生成器

专业试卷生成工具,支持中国中小学各学科,遵循官方课程标准,确保试题准确性。

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': score
        })
    
    def add_true_false(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 add_short_answer(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._generate_chinese(total_score)
        else:
            return self._generate_english(total_score)
    
    def _generate_chinese(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 '\
'.join(output)
    
    def generate_answer_sheet(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 '\
'.join(output)
    
    def save(self, output_dir):
        """保存试卷和答案(Word格式)"""
        from docx import Document
        from docx.shared import Pt, Cm
        from docx.enum.text import WD_ALIGN_PARAGRAPH
        
        os.makedirs(output_dir, exist_ok=True)
        
        # 生成试卷Word文档
        doc = Document()
        
        # 设置页面
        section = doc.sections[0]
        section.top_margin = Cm(2.54)
        section.bottom_margin = Cm(2.54)
        section.left_margin = Cm(2.54)
        section.right_margin = Cm(2.54)
        
        # 生成内容
        exam_text = self.generate_exam()
        for line in exam_text.split('\
'):
            if line.strip():
                if '═' in line or '─' in line:
                    doc.add_paragraph(line)
                elif line.startswith('一、') or line.startswith('二、') or line.startswith('三、'):
                    doc.add_heading(line, level=2)
                elif line.startswith('1.') or line.startswith('2.') or line.startswith('3.'):
                    doc.add_paragraph(line)
                else:
                    doc.add_paragraph(line)
        
        exam_path = os.path.join(output_dir, 'exam.docx')
        doc.save(exam_path)
        
        # 生成答案Word文档
        doc_answer = Document()
        answer_text = self.generate_answer_sheet()
        for line in answer_text.split('\
'):
            if line.strip():
                doc_answer.add_paragraph(line)
        
        answer_path = os.path.join(output_dir, 'answer.docx')
        doc_answer.save(answer_path)
        
        return exam_path, answer_path

# 使用示例
exam = ExamGenerator('数学', '初中一年级', '2026年春季期中考试')
exam.add_choice_question('下列哪个是质数?', ['4', '6', '7', '9'], 'C', 2)
exam.add_fill_blank('12的平方根是____', '±2√3', 2)
exam.add_true_false('0是最小的自然数', '×', 1)
exam.add_calculation('计算:2x + 5 = 13,求x的值', 'x = 4', 10)

exam.save('/path/to/output')

试卷格式标准

试卷结构

┌─────────────────────────────────────────────────────────┐
│  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获取最新知识
  • 答案经过交叉验证
  • 支持中英文输出
  • 可直接打印
安全使用建议
This skill appears coherent and limited to exam generation. Before installing: (1) confirm you are comfortable with the agent performing web searches (exam content and sample queries may be sent to your configured web-search service), (2) do not expect the skill to require or handle secrets—none are requested, and (3) if you plan to run any of the provided Python locally, review the code first (it appears benign and uses only stdlib). If you need to limit external queries, ensure your agent's web-search integration or network policies are configured accordingly.
功能分析
Type: OpenClaw Skill Name: exam-generator Version: 1.0.3 The exam-generator skill is designed to create Chinese primary and middle school exam papers across various subjects. The SKILL.md file contains a Python implementation of an ExamGenerator class that handles question management and uses the python-docx library to export exams and answer keys to Word documents. The instructions guide the agent to use a web-search skill for content verification and provide a structured workflow for generating educational materials. No indicators of data exfiltration, malicious code execution, or harmful prompt injection were found.
能力评估
Purpose & Capability
Name/description (Chinese school exam generator) align with the content of SKILL.md. Required binaries (python3, curl) are reasonable for running the provided example code or making HTTP requests. No unrelated credentials, config paths, or extra binaries are requested.
Instruction Scope
Runtime instructions focus on collecting user parameters, generating questions, and using a web-search skill to verify answers. The SKILL.md does not instruct the agent to read arbitrary host files, environment variables, or send data to unknown endpoints beyond web search. The included Python sample is self-contained and only uses basic stdlib operations.
Install Mechanism
This is an instruction-only skill with no install spec and no code files to execute on install, which minimizes filesystem/install risk.
Credentials
No environment variables, credentials, or config paths are required. The skill's use of web search to validate answers is consistent with the purpose and does not demand extra secrets.
Persistence & Privilege
always is false and there are no claims of modifying other skills or system settings. The skill may be invoked autonomously by the agent (disable-model-invocation is false), which is the normal platform default and expected for skills.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install exam-generator
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /exam-generator 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
清理测试文件,重新发布
v1.0.2
修复安全问题:移除错误的wttr.in搜索示例,改用web-search skill
v1.0.1
输出Word格式:教师熟悉、可打印、可编辑、格式稳定
v1.0.0
中国中小学试卷生成器:支持全学科、多题型、联网验证、专业排版
元数据
Slug exam-generator
版本 1.0.3
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 4
常见问题

Exam Generator 是什么?

中国中小学试卷生成器。Use when teacher needs to create exam papers for Chinese primary/middle school. Supports all subjects, multiple question types, official curriculu... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 430 次。

如何安装 Exam Generator?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install exam-generator」即可一键安装,无需额外配置。

Exam Generator 是免费的吗?

是的,Exam Generator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Exam Generator 支持哪些平台?

Exam Generator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Exam Generator?

由 ToBeWin(@tobewin)开发并维护,当前版本 v1.0.3。

💬 留言讨论