question-bank-formatter

Question bank formatter. Converts raw question text into structured JSON question-bank format, supporting single-choice, multiple-choice, true/false, and fill-in-the-blank questions, with automatic chapter mapping and difficulty rating. Outputs a format compatible with any quiz system, LMS, or flashcard app.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "question-bank-formatter" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-7d6f161bed82c62857f136aac62b0973511767361dca9f3eeb5cb6a0aa5f545f. Verify the upstream source and version against https://skillhub.cn/skills/user_97acf6d1/question-bank-formatter before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Question bank formatter. Converts raw question text into structured JSON question-bank format, supporting single-choice, multiple-choice, true/false, and fill-in-the-blank questions, with automatic chapter mapping and difficulty rating. Outputs a format compatible with any quiz system, LMS, or flashcard app.

0 Downloads

Introduction source: third_party · user_97acf6d1 · 1.1.0 Reference

SkillPi interpretation

Tasks
Convert raw question text (from textbooks, PDFs, or pasted content) into a strict JSON question bank format.
Audience
Translation pending; see source documentation.
Inputs and outputs
Not specified in the source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
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).

Current listing version

1.1.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value90/100

Highlights

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

Highlights

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

Highlights

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

Areas to improve

  • 缺少输入验证说明 Reported severity: Minor

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

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

Highlights

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

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

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

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • localhost

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.