by aceofspadesomelette
Turn quaestio code blocks into interactive multiple-choice questions in Reading view, with answers saved in the note.
Quaestio
Turn quaestio code blocks into interactive multiple-choice questions in Obsidian Reading view (and Live Preview). Selections are saved as [x] markers; Check is saved as answer-checked: true|false; Show/Hide answer is saved as answer-revealed: true|false.
Install
- Copy this folder into your vault’s
.obsidian/plugins/directory (folder name:quaestio). - Run
npm installandnpm run buildinside the plugin folder. - Enable Quaestio under Settings → Community plugins.
Required format
All structure is driven by flags (flag names are never shown in Reading view). Option lines use [ ] / [x]. Flag values support plain text or markdown.
```quaestio
number-of-correct-answers: 1
correct-index: [2]
question-title: Question 1
question-stem: What is 1 + 1?
[ ] A. 1
[ ] B. 2
[ ] C. 3
[ ] D. 4
correct-answer: B. 2
explanation: 1 plus 1 is equal to 2.
```
Flags
| Flag | Required | Meaning |
|---|---|---|
number-of-correct-answers: N | yes | 1 = single-select; N > 1 = multi-select |
correct-index: [...] | yes | 1-based indexes of correct options (e.g. [2] or [2, 4]) |
question-title: | yes | Title shown at the top |
question-stem: | yes | Question body |
correct-answer: | no | Body under the UI label Correct Answer: |
explanation: | no | Body under the UI label Explanation: |
answer-revealed: true|false | no | Whether the answer panel is open (false / omitted = hidden) |
answer-checked: true|false | no | Whether Check has been applied (false / omitted = not graded). Restores the Correct / Incorrect / Unanswered banner |
Machine flags and content flags may appear in any order before the first option line. correct-answer, explanation, answer-revealed, and answer-checked may also appear after the options. Each flag key may appear only once.
Inline values and multi-line bodies both work:
question-stem: What is 1 + 1?
correct-answer:
B. 2
explanation:
1 plus 1 is equal to 2.
Validation errors (shown in place of the block) if:
- Required flags are missing
- A flag key is duplicated or unknown
Ndoes not match the length ofcorrect-index- Any index is out of range or duplicated
Nis greater than the number of options- Fewer than 2 options
Grading uses indexes only. Option labels (A. / 1. / anything else) and the correct-answer / explanation bodies are for display.
Multi-correct example
```quaestio
number-of-correct-answers: 2
correct-index: [2, 4]
question-title: Question 2
question-stem: Which numbers are even?
[ ] A. 1
[ ] B. 2
[ ] C. 3
[ ] D. 4
correct-answer: B. 2, D. 4
explanation: 2 and 4 are divisible by 2.
```
Numbered labels (optional style)
```quaestio
number-of-correct-answers: 1
correct-index: [2]
question-title: Question 3
question-stem: Pick the prime.
[ ] 1. 4
[ ] 2. 7
[ ] 3. 9
[ ] 4. 15
correct-answer: 2. 7
explanation: 7 is prime.
```
Using Quaestio
- Open the note in Reading view.
- Select options — hollow circle = empty, filled circle = selected. Single-select: click again to clear.
- Check — grades your selection, highlights correct / incorrect / missed options, and shows Correct / Incorrect / Unanswered (saved as
answer-checked: true). Does not open Correct Answer or Explanation. Reopening the note restores that banner. - Show answer / Hide answer — toggles Correct Answer and Explanation (saved in the note as
answer-revealed). Hide only closes the panel; it does not re-enable picking. - After Check or Show answer, options cannot be changed until Reset.
- Reset — clears selections, grading highlights, the answer panel, and unlocks options (also clears
[x], setsanswer-checked: false, and setsanswer-revealed: false).
Title, stem, options, Correct Answer body, and Explanation body support markdown; flag names never appear in Reading view.
Dashboard
A quaestio-dashboard block controls and scores every quaestio block in the same note. Flag order is the display order. Several dashboards in one note stay consistent (same counts and the same Check / Show / Reset results) but can list different flags.
```quaestio-dashboard
live-update: true
include-unanswered: true
check-answered
check-all
show-hide-all
reset-all
correct-score: Correct: {count} / {total} ({pct}%)
incorrect-score: Incorrect: {count} / {total} ({pct}%)
unanswered-score: Unanswered: {count} / {total} ({pct}%)
```
| Flag | Meaning |
|---|---|
live-update: true|false | Config only (not shown). Default true: score lines refresh as answers change. false freezes scores until Update. |
include-unanswered: true|false | Config only (not shown). Default true. When false, correct and incorrect {total} is answered questions only (correct + incorrect). Unanswered {total} is always every quaestio block. |
check-answered | Check blocks that already have a selection |
check-all | Check every block (empty selections become Unanswered) |
show-hide-all | Show all answers, or hide them if any answer panel is open |
reset-all | Reset every block |
correct-score | Correct count. Tokens: {count} numerator, {total} denominator, {pct} percent (at most 2 decimals). {x} and {y} still work as aliases of {count} and {total}. |
incorrect-score | Incorrect count. Same tokens |
unanswered-score | Unanswered count. {total} is always the number of quaestio blocks |
Action buttons sit on one wrapping row until a score line. Scores are recomputed from current selections, not from whether Check was pressed. Action buttons always run immediately; only the score lines follow live-update.
Develop
npm install
npm run build
npm test
CI runs build + Jest on push/PR. Tag a version matching manifest.json (for example 1.0.0) to create a draft GitHub release with main.js, manifest.json, and styles.css when present.
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.