examark
v0.7.0
Published
Create exams from Markdown and export to Canvas QTI format
Maintainers
Readme
Examark
Write exams in Markdown. Export to Canvas in seconds.
Documentation · Getting Started · Report Bug
Why Examark?
Stop clicking through Canvas forms. Write once, export anywhere.
┌─────────────────┐ ┌──────────┐ ┌─────────────────┐
│ quiz.md │ ───▶ │ examark │ ───▶ │ quiz.qti.zip │
│ (Markdown) │ │ │ │ (Canvas-ready) │
└─────────────────┘ └──────────┘ └─────────────────┘
│
▼
┌─────────────────┐
│ quiz.txt │
│ (Printable) │
└─────────────────┘Perfect for: Instructors, TAs, and course developers who want version-controlled, portable exam files.
Quick Start
No installation needed — try it now:
npx examark quiz.md -o quiz.qti.zipWrite Your Exam
# Statistics Midterm
1. [MC] What is the mean of 2, 4, 6? [2pts]
a) Three
b) Four [x]
c) Five
2. [TF] Variance can be negative. [1pt]
a) True
b) False [x]
3. [Essay, 10pts] Explain the Central Limit Theorem.Convert & Import
examark midterm.md -o midterm.qti.zip # For Canvas
examark midterm.md -f text # For printingThen: Canvas → Settings → Import Content → QTI .zip
Or Import to Item Banks (New Quizzes)
For random question selection across quizzes:
- Quizzes → ⋮ → Manage Item Banks
- + Add Bank → Name your bank
- ⋮ → Import Content → Upload
.qti.zip - Create quiz → Add from Item Bank → Randomly select N questions
Features
📝 Clean Syntax
Write questions naturally without complex markup.
1. [MC] Question here [2pts]
a) Wrong
b) Right [x]🧮 LaTeX Math
Full equation support, auto-converted for Canvas.
Find $\bar{x}$ given:
$$\bar{x} = \frac{\sum x_i}{n}$$📦 8 Question Types
- Multiple Choice (
[MC]) - True/False (
[TF]) - Multiple Answer (
[MA]) - Short Answer (
[Short]) - Numerical (
[Num]) - Essay (
[Essay]) - Matching (
[Match]) - Fill-in-Multiple-Blanks (
[FMB])
🔧 Powerful CLI
examark *.md -o output/ # Batch convert
examark quiz.md -f text # Paper exams
examark verify pkg --strict # New Quizzes check
examark check quiz.md # Lint syntax🖼️ Image Bundling
Local images automatically packaged into QTI.
🔬 Quarto Integration
Dynamic questions with R/Python.
format: exam-gfm
exam:
qti: trueInstallation
🚀 Choose Your Path
📝 Markdown Only
Write .md files → Canvas
📊 Quarto Only
Author .qmd → HTML/PDF
📊🎯 Quarto + Canvas
Author .qmd → Canvas
One-Line Install:
npx examark quiz.mdNo install needed!
One-Line Install:
quarto add Data-Wise/examarkExtension only.
Two Steps:
quarto add Data-Wise/examark
npm install -g examarkExtension + CLI.
📦 Detailed Installation Guide
For Markdown users who want to convert .md → QTI immediately:
npx examark quiz.md -o quiz.qti.zipWhat this does:
- Downloads
examarktemporarily to npm cache - Converts your markdown file to QTI
- No permanent installation
Requirements: Node.js ≥18 (see Windows/Mac setup below)
When to use: Quick one-off conversions, trying examark without committing
For Markdown Users (Static Exams)
Install once, use forever:
macOS:
# Option A: Homebrew (recommended)
brew install data-wise/tap/examark
# Option B: npm
npm install -g examarkWindows:
npm install -g examarkLinux:
npm install -g examarkUsage:
examark quiz.md -o quiz.qti.zip
examark *.md -o output/ # Batch convertFor Quarto Users (Preview Only - No QTI)
Install Quarto extension for authoring and preview:
quarto add Data-Wise/examarkWhat you get:
- Formats:
exam-html,exam-pdf,exam-odt,exam-docx,exam-typst - LaTeX math support
- Solution toggle (
exam.solutions: true/false)
What you DON'T get: QTI conversion (see "Quarto + QTI" below)
Usage:
quarto render exam.qmd --to exam-html # Preview in browser
quarto render exam.qmd --to exam-pdf # Print versionFor Quarto Users (Full Workflow - Preview + QTI)
Install both extension (authoring) and CLI (QTI conversion):
# Step 1: Quarto extension
quarto add Data-Wise/examark
# Step 2: CLI tool
npm install -g examark # Windows/Linux
brew install data-wise/tap/examark # macOS (alternative)Complete workflow:
# 1. Author exam
vim exam.qmd
# 2. Render to markdown
quarto render exam.qmd --to exam-gfm
# 3. Convert to QTI
examark exam.md -o exam.qti.zip
# 4. Upload to Canvas
open exam.qti.zip # Drag to Canvas → Import Content💡 Tip: Use
npx examarkinstead of installing globally if you prefer
Windows Users
If you've never used Node.js:
Install Node.js → nodejs.org
- Click green "LTS" button
- Run installer, accept all defaults
- Click through everything
Open Terminal:
- Press
Windows + R - Type
cmdand press Enter
- Press
Test it works:
node --versionShould show:
v18.x.xor higherUse examark:
npx examark quiz.md -o quiz.qti.zip
Permanent install:
npm install -g examarkmacOS Users
Recommended: Homebrew (easiest)
Install Homebrew (if not installed):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Install examark:
brew install data-wise/tap/examark
Alternative: npm
Install Node.js → nodejs.org
Install examark:
npm install -g examark
Install from Source
git clone https://github.com/Data-Wise/examark.git
cd examark
npm install
npm run build
npm linkInstall Specific Version
npm install -g [email protected]Update to Latest
npm update -g examark # npm
brew upgrade examark # HomebrewUninstall
npm uninstall -g examark # npm
brew uninstall examark # HomebrewCommands
| Command | Description |
|---------|-------------|
| examark <file.md> | Convert to QTI (default: file.qti.zip) |
| examark <file.md> -f text | Export as printable plain text |
| examark *.md -o output/ | Batch convert multiple files |
| examark verify <pkg> | Validate QTI package |
| examark verify <pkg> --strict | Strict validation for New Quizzes |
| examark emulate-canvas <pkg> | Simulate Canvas import |
| examark check <file.md> | Lint markdown for errors |
| examark --preview | Preview parsed questions (JSON) |
Options: -o <output> · -p <points> · -t <title> · --no-answers · -v · --strict
Configuration
Create .examarkrc.json for project defaults:
{
"defaultPoints": 2,
"outputDir": "output",
"validate": true
}Templates
Markdown (no Quarto needed):
| Template | Description | |----------|-------------| | minimal.md | 3 questions — quickest start | | starter.md | One of each question type | | all-question-types.md | Comprehensive — all 8 types |
Quarto (for R/Python users):
| Template | Description | |----------|-------------| | minimal.qmd | Simplest Quarto template | | starter.qmd | Full-featured starter | | dynamic.qmd | Randomized questions with R | | with-figures.qmd | R-generated plots |
Quarto Integration
Generate dynamic, randomized questions with R or Python code.
Quick Start
# Add extension to existing project
quarto add Data-Wise/examark
# Or start from template
quarto use template Data-Wise/examark⚠️ Note: This only installs the Quarto extension (for authoring/preview). To export QTI packages, also install the CLI:
npm install -g examark
Example: Dynamic Questions
---
title: "Statistics Exam"
format: exam-html # Preview in browser
exam:
solutions: false
default-points: 1
---
## 1. Random Calculation [2pts]
What is `r x <- sample(1:10, 1); x` + `r y <- sample(1:10, 1); y`?
a) `r x + y - 2`
b) `r x + y` [x]
c) `r x + y + 2`Available Formats
| Format | Output | Use Case |
|--------|--------|----------|
| exam-html | HTML | Browser preview |
| exam-pdf | PDF | Print exams |
| exam-gfm | Markdown | QTI conversion (use with CLI) |
| exam-odt | ODT | Google Docs, LibreOffice |
| exam-docx | DOCX | Microsoft Word |
| exam-typst | PDF | Modern typesetting |
Complete QTI Workflow
# 1. Render to markdown
quarto render exam.qmd --to exam-gfm
# 2. Convert to QTI (requires CLI installed)
examark exam.md -o exam.qti.zip
# 3. Upload to Canvas📖 Full Quarto Guide → · Dynamic Examples →
Claude Code Plugin
Use examark directly from Claude Code with slash commands.
Commands
| Command | Description |
|---------|-------------|
| /exam:convert <file> | Convert .md or .qmd to QTI package |
| /exam:check <file> | Lint markdown or verify QTI package |
| /exam:preview <file> | Show formatted question summary table |
Auto-Lint Hook
The plugin includes a PostToolUse hook that automatically lints exam files after edits, catching errors as you write.
Installation
Copy or symlink the .claude-plugin/ directory and commands/ directory to use with Claude Code. The plugin also includes migrated skills for exam generation and formatting knowledge.
Documentation
| | | |---|---| | 📚 Full Docs | Complete reference | | 🚀 Getting Started | Install + first quiz | | 📝 Markdown Syntax | Question syntax | | 🏦 Item Banks | Random quizzes | | ⚙️ Configuration | Project settings | | 🎓 Tutorials | R/Quarto, VS Code |
Made with ❤️ by Data-Wise · MIT License
