question-bank-formatter

试题库格式化工具。将原始题目文本转换为结构化 JSON 题库格式,支持单选、多选、判断和填空题,并自动映射章节与难度评级,输出与任意测验系统、学习管理系统或抽认卡应用兼容的格式。

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "question-bank-formatter":https://skillpi.com/zh/skills/deepskill-7d6f161bed82c62857f136aac62b0973511767361dca9f3eeb5cb6a0aa5f545f。安装前核对上游来源和版本:https://skillhub.cn/skills/user_97acf6d1/question-bank-formatter。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

skillhub.cn

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

试题库格式化工具。将原始题目文本转换为结构化 JSON 题库格式,支持单选、多选、判断和填空题,并自动映射章节与难度评级,输出与任意测验系统、学习管理系统或抽认卡应用兼容的格式。

0 下载

介绍来源: third_party · user_97acf6d1 · 1.1.0 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
适合谁
User provides question text and asks to "转换成题库" or "生成题库" User says "题库格式转换" or references the specific JSON output format User attaches a document with exam questions to be structured
输入和输出
来源文档未说明。
软件、账号及付费要求
来源文档未说明。
限制与区别
来源文档未说明。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: question-bank-formatter
slug: question-bank-formatter
displayName: "题库格式化:原始题目 → 结构化 JSON(支持单选/多选/判断/填空)"
description: "Convert raw question text into structured JSON question bank format. Handles single-choice, multi-choice, true/false, and fill-in-the-blank questions with auto chapter mapping and difficulty rating. Framework-agnostic — output works with any quiz system, LMS, or flashcard app."
version: 1.0.0
author: Hermes Agent
license: MIT
platforms: [windows]
metadata:
  hermes:
    tags: [question-bank, json, exam, format-conversion, quiz]
    related_skills: [textbook-learning, lab-assignment-implementation]

Question Bank Formatter (题库格式化)

Convert raw question text (from textbooks, PDFs, or pasted content) into a strict JSON question bank format.

When to Use

  • User provides question text and asks to "转换成题库" or "生成题库"
  • User says "题库格式转换" or references the specific JSON output format
  • User attaches a document with exam questions to be structured

Output JSON Format

{
  "questions": [
    {
      "id": "subject.ch1.001",
      "content": "题目内容(去掉末尾的括号或空格)",
      "options": ["选项A文本", "选项B文本", "选项C文本", "选项D文本"],
      "answer": "正确答案字母(单选如A,多选如BCD)",
      "explanation": "解析(可为空字符串)",
      "type": "single_choice",
      "difficulty": 3,
      "source": "来源书名或课程名",
      "nodes": ["subject.ch1"],
      "formulas": [],
      "siblings": []
    }
  ]
}

Type Rules

JSON type field CryptoForge DB type options answer Notes
single_choice → choice 各选项文本数组 单个字母如 "A" 单选
multi_choice → choice 各选项文本数组 字母组合如 "BCD" 多选,字母必须按顺序排列
true_false → choice 固定为 ["对", "错"] "对" 或 "错" 判断题
fill → fill 单项数组如 ["响应"] 填空答案文本 填空题

CRITICAL for CryptoForge import: The type field stored in the DB must be choice or fill, NOT single_choice/multi_choice/true_false. The import script handles this remapping automatically.

ID Format Rules

Pattern: subject.chapter.number

  • Subject: lowercase abbreviation must match CryptoForge nameMap (see Integration section). Verify before creating new subjects.
  • Chapter: ch0 (绪论), ch1-ch8+, or type suffix (tf, sc, mc, fill) for generic question banks
  • Number: three-digit zero-padded (001, 015, 123)

Examples: marxism.ch1.001, cisa.ch3.015, computer_org.ch1.003, computer_org.ch9.fill.001

Chapter Mapping

Infer the chapter from question content:

  • 绪论/导论 → ch0
  • 第一章 → ch1
  • 第二章 → ch2
  • 第三章 → ch3
  • 第四章 → ch4
  • 第五章 → ch5
  • 判断题无法判断 → tf

If the source material uses domain-based structure (like CISA), map domains to chapters:

  • Domain 1 → ch1
  • Domain 2 → ch2
  • etc.

Difficulty Rules

Level Value Criteria
简单 2 Basic definition recall, straightforward fact questions
中等 3 Understanding and application, requires some reasoning
较难 4 Comprehensive analysis, multi-step reasoning, scenario-based

Cleaning Rules

  1. Strip option prefixes: Remove leading letter labels like "A. ", "B、", "A)", "B."
  2. Trim whitespace: Remove leading/trailing spaces from options and content
  3. Sort multi-choice answers: "BD" not "DB", "ACD" not "CDA"
  4. Split true/false inline: If question text contains "对/错" at the end, separate it
  5. Remove trailing markers: Strip trailing parentheses, brackets, or spaces from content
  6. Skip invalid questions: If content or answer is missing, skip the question

Workflow

Step 1: Parse Source

  • If from PDF/EPUB: use pdf-deep-reading or EPUB extraction first
  • If pasted text: parse directly

Step 2: Identify Question Type

Look for:

  • A. ... B. ... C. ... D. ... with one correct → single_choice
  • A. ... B. ... C. ... D. ... with multiple correct → multi_choice
  • Statements ending with 对/错 or √/× → true_false

Step 3: Determine Subject and Chapter

  • Infer subject from the source (e.g., Marxism → marxism, CISA → cisa)
  • Map question content to chapter using the chapter mapping rules

Step 4: Clean and Format

Apply all cleaning rules. Ensure:

  • JSON is valid (no trailing commas, proper escaping)
  • All required fields present: id, content, options, answer, explanation, type, difficulty, source, nodes, formulas, siblings

Step 5: Output

  • Output raw JSON, NOT wrapped in markdown code blocks (```json)
  • Save to file if user requests: C:\Users\13657\Desktop\{name}_题库.json

Integration

User Intent Skill Chain
Feed book → generate questions textbook-learning → question-bank-formatter
Pasted exam questions → format question-bank-formatter directly
PDF of exam → format questions pdf-deep-reading → question-bank-formatter
Translate English bank → Chinese question-bank-formatter + model translation
Import into CryptoForge DB question-bank-formatter → direct SQLite script (see below)

CryptoForge DB Direct Import

For "导入到X科目" requests, use the direct SQLite import script not the HTTP API (which requires a file upload + confirm two-step). Full operational guide: references/cryptoforge-import.md. Template script: scripts/import_questions.js.

Mandatory rules:

  1. Subject prefix MUST match nameMap in server/index.js (e.g., computer_org not comp_org) — verify the map first
  2. DB type field: use choice or fill (NOT single_choice/multi_choice/true_false)
  3. sql.js is in-memory — direct .db file writes are invisible to running server. You MUST restart the server after every import
  4. After restart, verify with API: curl http://localhost:8967/api/questions?subject=XXX&chapter=N
  5. Before starting, check existing chapter count: curl http://localhost:8967/api/questions?subject=XXX&limit=200 to avoid duplicates

Server restart procedure:

# 1. Find PID
netstat -ano | grep 8967 | grep LISTENING
# 2. Kill
taskkill //F //PID <PID>
# 3. Start (use foreground timeout trick — background=true causes "stdin is not a tty")
cd C:/Users/13657/Desktop/cryptoforge && node start_server.js
# 4. Wait, then verify
sleep 3 && curl http://localhost:8967/api/health

Fill-in-the-blank (填空题) format for CryptoForge:

  • type: fill
  • options: single-element array with the answer, e.g., ["响应"] or multi-blank array ["WCR", "MAR", "DAR", "0"]
  • answer: comma-joined answer text, e.g., "响应" or "WCR,MAR,DAR,0"
  • Short answer (简答题) also uses type: fill

HTTP API fallback (only if import script unavailable): POST /api/import/upload (multipart file) → POST /api/import/confirm with {filePath, subject, chapter, overwrite}

Pitfalls

  1. Don't wrap in markdown code blocks — output raw JSON unless saving to file
  2. Multi-choice answer sorting — "BD" not "DB", use alphabetical order
  3. True/false must use Chinese — options are ["对", "错"], answer is "对" or "错"
  4. Don't change the chapter mapping mid-batch — use the same subject.chapter scheme throughout
  5. When book has domain structure (like CISA) — map Domain 1→ch1, Domain 2→ch2, etc., and note the mapping
  6. Don't lose the explanation — even if from the source material, carry it through
  7. Difficulty should be consistent within a batch — basic recall=2, applied=3, scenario/analysis=4
  8. EPUB HTML class variants — McGraw-Hill practice exam books use BOTH class="ques" AND class="ques1" for question blocks in the answer section. Always search for both: <p class="ques[^"]*". Similarly, answer sections may use tick (correct) + check (incorrect explanation) instead of explicit answer letter markers. See references/mcgraw-hill-epub-patterns.md for the full HTML structure.
  9. Parse answers from the ANSWER section, not the Q section — for practice exam books, the answer section contains the most reliable correct-answer data (via tick markers). The question section alone lacks answer data.
  10. CTF/domain-heavy books can be imported as layered knowledge — map broad book parts to coarse chapter nodes first, then add finer subnodes from section headings so the database stays navigable without exploding node count.
  11. Keep source names user-facing — if the book title is long or noisy, use the concise display title in source, but keep the full title in the generated file name when saving the bank.
  12. For large EPUBs, extract a concise knowledge index first — chapter titles + key subtopics are often enough to drive question generation and node mapping without fully mirroring every paragraph.
  13. When importing into CryptoForge, preserve importable fields exactly — options should stay JSON-encoded text, nodes/formulas/siblings arrays should be present, and novel node ids are created automatically from nodes during import.
  14. Subject prefix must match existing nameMap — check server/index.js nameMap before inventing a new subject ID. Wrong prefix = questions land under an invisible subject (e.g., comp_org vs computer_org).
  15. Server restart is mandatory after direct DB writes — sql.js loads the .db file into memory at startup. Writing the file from an external script while the server runs has zero effect until restart. Use netstat -ano | grep 8967 | grep LISTENING to find PID, then taskkill //F //PID <PID>, then node start_server.js.
  16. Background mode fails for server startup — Hermes TUI terminal(background=true) causes "stdin is not a tty" error with the CryptoForge Node.js server. Instead, use the foreground timeout trick: run node start_server.js as a foreground command with a short timeout. The server continues running in the background after the terminal call times out.
  17. Deduplicate before import — Check existing questions via API (curl http://localhost:8967/api/questions?subject=XXX&chapter=N&limit=200) before bulk-inserting. If the same chapter already has questions from a prior batch (e.g., old ID format ch9.q01 vs new ch9.sc.001), delete the old batch first to avoid duplicates showing up in the UI.
  18. Fill-in-the-blank (填空题) import format — For CryptoForge: type must be fill (not fill_blank), options should be a single-element array or multi-blank array with the answer text, answer is the answer text (comma-joined for multi-blank). Short answer / 简答题 also uses type: fill. The import script does NOT shuffle fill question options (only shuffles choice type).

当前收录版本

1.1.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值90/100

亮点

  • 解决教育、考试、学习场景中的核心需求,将原始题目文本转换为结构化JSON格式
  • 支持单选、多选、判断、填空等多种题型,具有广泛的实用价值
  • 框架无关设计,输出兼容任何测验系统、LMS或闪卡应用
触发精准85/100

亮点

  • 触发词覆盖全面,包括'转换成题库'、'生成题库'、'题库格式转换'等多种表达
  • 边界清晰,能够准确识别用户需要进行题库格式转换的场景
结构规范90/100

亮点

  • 工作流程清晰划分为5个步骤,每个步骤都有详细说明
  • 包含完整的JSON输出格式示例和类型规则说明
  • frontmatter完整,版本、作者、许可证等信息齐全
执行可靠80/100

待提升项

  • 缺少输入验证说明 原报告严重程度:轻微

    未详细说明对输入文本格式的验证机制和错误处理策略

    改进建议:建议增加输入验证规则和异常处理机制,提高执行可靠性

亮点

  • 提供了详细的清理规则和ID格式规范
  • 包含CryptoForge数据库直接导入的完整操作指南
  • 列出了18个常见陷阱和注意事项,提高执行成功率
证据可验 (前四项均值)86/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • localhost

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

来源文档未说明。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。