by XXJ
读取本地md知识库,调用Ollama/OpenAI兼容API自动生成试题,支持导出MD、Word、PDF,AI识别试卷、错题本、间隔复习
English
What is it?
Smart Question Tutor turns your Obsidian Markdown notes into an active-study machine. It reads your local knowledge base, uses AI (local Ollama or any OpenAI-compatible API) to generate quiz questions, records wrong answers into a spaced-repetition review loop, builds a knowledge-tag graph, and lets you export to Markdown / Word / PDF.
Features
AI Question Generation
- Generate quizzes from any Markdown note with 5 question types: single choice, multiple choice, true/false, fill-in-the-blank, short answer.
- Supports Ollama (local, private) and OpenAI-compatible endpoints (DeepSeek, etc.) via custom base URL, model, API key and temperature.
- AI auto-extracts knowledge tags and writes
[[wikilinks]]so everything appears in your Obsidian graph view. - Customize per-type counts, run in batch over multiple files, and sort results by source / tag / date.
Full Exam Recognition
- Extract every question from a complete exam paper or question bank via AI, preserving original question types and formatting.
- Large files are chunked (15,000 chars per chunk, 2,000 overlap) to avoid truncation.
- Existing answers are kept as-is; missing answers are auto-generated by the AI.
- Handles Markdown, txt, RTF, docx, PDF and images.
Answering Mode
- Start answering any generated result or saved question file in one click.
- Instant grading with the correct answer and explanation.
- Objective questions are auto-scored; subjective questions can be manually marked correct/wrong — missed ones go straight to the wrong-answer book.
Wrong Answer Book (SM-2 spaced repetition)
- Answer correctly → interval advances; answer wrong → resets to day 1.
- A single difficulty factor (SM-2 EF) per module controls interval growth, with Fewer reviews / Standard / More reviews one-click presets and a recommended range.
- Wrong answers carry
[[knowledge tags]]and sync into the knowledge folder for the graph. - Automatic review reminders when the plugin loads.
Study Notes
- Generate condensed study notes from any Markdown file, any existing question/wrong-answer/note.
- Notes participate in the same spaced-repetition review schedule.
- Search, filter and export.
Review Dashboard
- One unified list of every due review item (wrong answers + questions + notes), filterable and sortable by source / tag / date.
- One-click Done per item advances it to the next review cycle.
Learning Heatmap
- GitHub-style annual contribution graph on the Home tab.
- Horizontal scrollbar, auto-positioned to today; follows the sidebar width, always staying pinned to the current day.
- Color intensity tiers by activity count.
Knowledge Graph
- A single knowledge-tag index folder; each tag gets an auto-generated MOC note with 相关题目 / 相关笔记 / 相关错题 sections.
- Rebuild the index on demand: it scans every folder's tags, recreates all index notes, and cleans up stale ones in one pass.
- Handwritten notes in the knowledge folder are never touched.
Export
- Export to Markdown, Word (.docx) or PDF.
- Answer-free exports are available for self-testing.
💬 AI Assistant Chat
- A built-in chat panel embedded in the Smart Question Tutor sidebar (the AI tab).
- Workspace & multi-chat management: organize chats into workspaces, each containing many independent conversations (switch / create / rename / delete via the header dropdowns and the ☰ drawer). Old single-history data migrates into a default workspace automatically.
- Answers are grounded in your notes via retrieval; each conversation remembers its own scope between plugin knowledge base only and entire vault.
- Reference notes: attach the current selection/note (or pick multiple notes) as context for the answer; references show as removable chips and are cleared automatically after sending.
- The reference budget setting caps how much referenced text is fed to the model (default 60000; lower it for small local models). The budget is shared fairly across references: short files are included whole, long files keep their opening plus a few query-relevant snippets, and cuts land on natural boundaries.
- Replies render as Markdown; each message can be copied or regenerated.
🔒 Privacy
- Local-first: with Ollama, nothing leaves your machine.
- When you use an OpenAI-compatible endpoint (including the built-in chat), the selected context is sent to that endpoint:
- Question generation sends the chosen source text / exam file.
- Chat scope plugin knowledge base sends matched snippets; scope entire vault may send matched note contents from any folder.
- Referenced notes are sent in full (up to the reference budget).
- No telemetry and no hidden network calls. Only the endpoint you configure is contacted.
🌐 Bilingual UI (Chinese / English)
- One-click interface language switch in Settings — the whole UI flips between 中文 and English instantly.
- The switch is also available right inside the sidebar settings; command palette names update after a plugin restart.
- AI prompts are bilingual too while keeping the "language follows the material" rule: Chinese material still produces Chinese questions, English material produces English questions.
- English parsing & export support (
Answer:,Explanation:,Answer Summary, ...) — English-material exams parse and export correctly. - Missing translations fall back to the original Chinese text, so the UI never goes blank.
Repository
GitHub: https://github.com/xxinjie21/Smart-Quiz-Tutor
Installation
From Obsidian Community Plugins
- Open Settings → Community plugins → Browse
- Search for Smart Question Tutor
- Click Install, then Enable
Manual Installation (GitHub Release)
Download the main.js, manifest.json and styles.css from the latest Release, then copy them into:
your-vault/.obsidian/plugins/smart-quiz-tutor/
├── main.js
├── manifest.json
└── styles.css
Then enable the plugin in Settings → Community plugins → Installed plugins.
Quick Start
- Configure AI — open Settings → Smart Question Tutor; choose Ollama or OpenAI and set the API URL, model, and API key (if needed).
- Generate questions — click the ribbon icon to open the sidebar; in the 题目 tab pick a Markdown source file, choose question types & counts, click Generate.
- Start answering — click 开始答题 after generation finishes.
- Review mistakes — wrong answers are auto-saved with spaced-repetition scheduling; open the 错题 tab to review now.
- Track progress — check the 复习 tab for due items, or read the heatmap on 首页.
Commands
| Command | Action |
|---|---|
| 打开智学助手侧边栏 | Open the main sidebar |
| 基于当前文档生成试题 | Open the file picker to generate questions |
| 基于当前文档直接生成试题 | Generate questions directly from the active Markdown note |
| 识别当前文件试卷 | Run full-exam recognition on the active file |
| 查看错题本 | Open the wrong-answer list |
| 查看题目生成历史记录 | Open generation history |
| 重建知识点索引 | Rebuild all knowledge-index MOC notes |
Hotkeys
No default hotkey is bound. Bind one in Settings → Hotkeys (for example Ctrl+Q to 基于当前文档直接生成试题).
Settings
Core
| Setting | Description | Default |
|---|---|---|
| 界面语言 | Interface language (中文 / English) | 中文 |
| 接口类型 | Ollama or OpenAI-compatible | Ollama |
| 接口地址 | API service URL | http://127.0.0.1:11434 |
| 模型名称 | AI model | qwen2:7b |
| API Key | Required only for hosted providers | (empty) |
| Temperature | Randomness (0–2) | 0.1 |
| 根文件夹 | Parent folder for all modules | 智学助手 |
| 题目文件夹 | Generated-question folder | 题目 |
| 错题文件夹 | Wrong-answer folder | 错题 |
| 笔记文件夹 | Study-note folder | 笔记 |
| 知识点文件夹 | Knowledge-index folder | 知识点 |
| 排除文件夹 | Folders excluded from scanning | .trash, 模板, templates |
Review Interval Factor
Intervals are controlled by a single difficulty factor (SM-2 EF) per module. SM-2 grows the interval as 1 day → 6 days → previous × factor; the factor is then nudged by each review's grade. Recommended 2.0–2.8 (standard 2.5); input is clamped to 1.3–3.0.
| Module | Default factor | Presets (Fewer reviews / Standard / More reviews) |
|---|---|---|
| 错题 | 2.3 | 2.7 / 2.5 / 2.3 |
| 题目 | 2.5 | 2.7 / 2.5 / 2.3 |
| 笔记 | 2.5 | 2.7 / 2.5 / 2.3 |
Interface
The sidebar has 7 tabs:
| Tab | Content |
|---|---|
| 🏠 首页 | Stats overview (4 cards) + learning heatmap + review reminders + quick actions |
| 📝 题目 | Generation settings, question files, file picker |
| 📋 笔记 | Create study notes from files, note management |
| ❌ 错题 | Wrong-answer list, detail, manual add, review, export, regeneration |
| 📊 复习 | Unified due-review dashboard with filter / sort / SM-2 grading |
| 💬 AI | Built-in retrieval-grounded assistant chat |
| ⚙️ 设置 | All configuration |
Tech Stack
| Technology | Purpose |
|---|---|
| Obsidian API | Plugin platform |
| TypeScript | Development |
| esbuild | Bundler |
| docx | Word document generation |
| SM-2 | Spaced-repetition algorithm |
Support
If this plugin helps your studies, consider giving it a star on GitHub!
GitHub: https://github.com/xxinjie21/Smart-Quiz-Tutor
For issues and feature requests, please open an issue.
License
中文文档
这是什么?
智学助手 把你的 Obsidian Markdown 笔记变成一台主动学习机:读取本地知识库,用 AI(本地 Ollama 或任意 OpenAI 兼容接口)生成试题,把错题纳入间隔重复的复习循环,构建知识点图谱,并可导出 Markdown / Word / PDF。
功能
🧠 AI 试题生成
- 基于 Markdown 笔记原文,AI 自动出题,支持 5 种题型:单选 / 多选 / 判断 / 填空 / 简答。
- 支持 Ollama(本地、离线、隐私)与 OpenAI 兼容接口(如 DeepSeek 等),可自定义接口地址、模型、API Key、Temperature。
- AI 自动提取知识点标签并写入
[[双向链接]],融入 Obsidian 图谱视图。 - 每种题型可独立设置数量,支持多文件批量生成,结果可按源文件 / 知识点 / 时间排序。
📄 整卷识别
- 从完整试卷 / 题集中 AI 提取全部题目,保留原题型与格式。
- 大文件自动分块处理(每块 15000 字符、重叠 2000 字符),避免内容截断。
- 原卷已有答案原样保留,缺答案由 AI 自动补全。
- 支持 Markdown、txt、RTF、docx、PDF 与图片。
✍️ 答题模式
- 一键开始对刚生成的结果或已保存的题目文件答题。
- 即时批改,展示正确答案与解析。
- 客观题自动计分,主观题可手动标记正误;答错自动进入错题本。
📘 错题本(SM-2 间隔重复)
- 答对 → 间隔递增;答错 → 重置为第 1 天。
- 每个模块用一个**难度因子(SM-2 的 EF)**控制间隔增长,附带 少复习 / 标准 / 多复习 一键预设与推荐范围。
- 错题携带
[[知识点标签]],自动同步到知识点文件夹,图谱可见。 - 插件启动时自动提醒到期复习。
📓 学习笔记
- 从任意 Markdown 文件,或已有题目 / 错题 / 笔记一键生成浓缩知识点笔记。
- 笔记同样纳入间隔重复复习体系。
- 支持搜索、筛选、导出。
📊 复习看板
- 统一展示所有到期复习项(错题 + 题目 + 笔记),可按源文件 / 知识点 / 时间筛选排序。
- 每项一键「已完成」,自动推进到下一复习周期。
📈 学习热力图
- 首页 GitHub 风格年度活跃图。
- 横向滑动条,自动定位到当天;随侧边栏宽度自适应,始终钉在当天。
- 颜色按活动频次分级。
🔗 知识点图谱
- 统一的知识点索引文件夹;每个知识点自动生成 MOC 索引笔记,含 相关题目 / 相关笔记 / 相关错题 三个分区。
- 支持一键重建知识点索引:扫描各文件夹标签、重建全部索引、并一次性清理过期索引。
- 知识点文件夹中的手写笔记永远不会被误删。
📤 专业导出
- 支持导出 Markdown、Word (.docx)、PDF。
- 可导出无答案版用于自测。
💬 AI 助手对话
- 内嵌在智学助手侧边栏的 AI 页签里。
- 工作区 + 多会话管理:用工作区分区,每个工作区内可建多个独立会话;通过头部下拉与 ☰ 抽屉新建 / 切换 / 重命名 / 删除。旧版单一聊天历史会自动迁移为一个「默认」工作区里的会话。
- 回答基于你的笔记检索结果;检索范围可在 仅插件知识库 与 整个 vault 间切换,且每个会话独立记忆各自的检索范围。
- 引用笔记:把当前选区/笔记(或从文件选择器挑多篇)挂为回答上下文;以可移除的 chip 展示,发送后自动清空。
- 设置项「引用总预算(字)」限制带入模型的引用文本量(默认 60000,本地小模型建议调小)。预算在各引用间公平分配:短文件整篇带上,长文件保留开头并补充与提问相关的片段,截断落在自然边界。
- 回复按 Markdown 渲染;每条消息可复制、可重新生成。
🔒 隐私说明
- 本地优先:使用 Ollama 时全部在你本机完成。
- 使用 OpenAI 兼容接口(含内置对话)时,会把所选上下文发送到该接口:
- 生成试题:发送你选择的源文本 / 试卷文件。
- 对话范围「仅插件知识库」:发送命中的片段;「整个 vault」:可能发送任意文件夹中命中的笔记内容。
- 被引用的笔记会完整发送(受引用预算限制)。
- 无遥测、无隐藏网络请求;只会访问你配置的接口地址。
🌐 中英文双语界面
- 设置页一键切换界面语言,整个界面在 中文 / English 间即时切换。
- 侧边栏设置内也可直接切换;命令面板中的命令名在重启插件后更新。
- AI 提示词同样双语化,同时保留「语言与材料一致」规则:中文材料仍出中文题,英文材料出英文题。
- 英文解析与导出兼容(
Answer:、Explanation:、Answer Summary等)——英文材料的试卷可正常解析与导出。 - 漏翻的文案自动回退显示中文原文,界面永不空白。
仓库地址
GitHub: https://github.com/xxinjie21/Smart-Quiz-Tutor
安装
从 Obsidian 社区插件安装
- 打开 设置 → 社区插件 → 浏览
- 搜索 Smart Question Tutor
- 点击 安装,然后 启用
手动安装(GitHub Release 下载)
从最新 Release 下载 main.js、manifest.json 和 styles.css,放入:
your-vault/.obsidian/plugins/smart-quiz-tutor/
├── main.js
├── manifest.json
└── styles.css
然后在 设置 → 社区插件 → 已安装插件 中启用。
快速开始
- 配置 AI — 打开 设置 → Smart Question Tutor,选择 Ollama 或 OpenAI,设置接口地址、模型、API Key(如需要)。
- 生成题目 — 点击左侧栏图标打开侧边栏,在「题目」Tab 选择 Markdown 源文件,选择题型与数量,点击「生成」。
- 开始答题 — 生成完成后点击「开始答题」。
- 复习错题 — 错题自动按间隔重复计划保存;打开「错题」Tab 可立即复习。
- 跟踪进度 — 在「复习」Tab 查看待复习项,或在首页查看热力图。
命令
| 命令 | 说明 |
|---|---|
| 打开智学助手侧边栏 | 打开主界面侧边栏 |
| 基于当前文档生成试题 | 打开文件选择器出题 |
| 基于当前文档直接生成试题 | 基于当前活动 Markdown 笔记直接生成试题 |
| 识别当前文件试卷 | 对当前文件执行整卷识别 |
| 查看错题本 | 打开错题列表 |
| 查看题目生成历史记录 | 打开生成历史 |
| 重建知识点索引 | 重建所有知识点索引笔记 |
快捷键
不预设任何快捷键。请在 设置 → 快捷键 中自行绑定(例如把 Ctrl+Q 绑定到 基于当前文档直接生成试题)。
配置
核心设置
| 设置项 | 说明 | 默认值 |
|---|---|---|
| 界面语言 | 界面语言(中文 / English) | 中文 |
| 接口类型 | Ollama 或 OpenAI 兼容 | Ollama |
| 接口地址 | API 服务地址 | http://127.0.0.1:11434 |
| 模型名称 | AI 模型 | qwen2:7b |
| API Key | 仅在托管服务需要时填写 | (空) |
| Temperature | 随机性 (0–2) | 0.1 |
| 根文件夹 | 所有模块文件夹的父目录 | 智学助手 |
| 题目文件夹 | 生成题目保存路径 | 题目 |
| 错题文件夹 | 错题保存路径 | 错题 |
| 笔记文件夹 | 学习笔记保存路径 | 笔记 |
| 知识点文件夹 | 知识点索引保存路径 | 知识点 |
| 排除文件夹 | 不参与扫描的文件夹 | .trash, 模板, templates |
复习间隔因子
间隔由每个模块的**难度因子(SM-2 的 EF)**控制:SM-2 按 1 天 → 6 天 → 上一间隔 × 因子递增长,因子再随每次评分微调。推荐 2.0–2.8(标准 2.5);输入限制在 1.3–3.0。
| 模块 | 默认因子 | 预设(少复习 / 标准 / 多复习) |
|---|---|---|
| 错题 | 2.3 | 2.7 / 2.5 / 2.3 |
| 题目 | 2.5 | 2.7 / 2.5 / 2.3 |
| 笔记 | 2.5 | 2.7 / 2.5 / 2.3 |
界面
侧边栏共有 7 个 Tab:
| Tab | 功能 |
|---|---|
| 🏠 首页 | 统计概览(4 卡片)+ 学习热力图 + 复习提醒 + 快捷操作 |
| 📝 题目 | 出题设置、题目文件管理、文件选择器 |
| 📋 笔记 | 从文件创建学习笔记、笔记管理 |
| ❌ 错题 | 错题列表、详情、手动添加、复习、导出、重生成 |
| 📊 复习 | 统一到期复习看板,支持筛选 / 排序 / SM-2 评分 |
| 💬 AI | 内置基于笔记检索的对话助手 |
| ⚙️ 设置 | 所有配置项 |
技术栈
| 技术 | 用途 |
|---|---|
| Obsidian API | 插件平台 |
| TypeScript | 开发语言 |
| esbuild | 构建工具 |
| docx | Word 文档生成 |
| SM-2 | 间隔重复算法 |
支持
如果这个插件对你的学习有帮助,欢迎在 GitHub 上给一个 ⭐!
GitHub: https://github.com/xxinjie21/Smart-Quiz-Tutor
如有问题或建议,请 提交 Issue。
许可
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.