Quaestio

approvedunreviewed

by aceofspadesomelette

Turn quaestio code blocks into interactive multiple-choice questions in Reading view, with answers saved in the note.

Updated todayMIT

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

  1. Copy this folder into your vault’s .obsidian/plugins/ directory (folder name: quaestio).
  2. Run npm install and npm run build inside the plugin folder.
  3. 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

FlagRequiredMeaning
number-of-correct-answers: Nyes1 = single-select; N > 1 = multi-select
correct-index: [...]yes1-based indexes of correct options (e.g. [2] or [2, 4])
question-title:yesTitle shown at the top
question-stem:yesQuestion body
correct-answer:noBody under the UI label Correct Answer:
explanation:noBody under the UI label Explanation:
answer-revealed: true|falsenoWhether the answer panel is open (false / omitted = hidden)
answer-checked: true|falsenoWhether 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
  • N does not match the length of correct-index
  • Any index is out of range or duplicated
  • N is 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

  1. Open the note in Reading view.
  2. Select options — hollow circle = empty, filled circle = selected. Single-select: click again to clear.
  3. 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.
  4. 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.
  5. After Check or Show answer, options cannot be changed until Reset.
  6. Reset — clears selections, grading highlights, the answer panel, and unlocks options (also clears [x], sets answer-checked: false, and sets answer-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}%)
```
FlagMeaning
live-update: true|falseConfig only (not shown). Default true: score lines refresh as answers change. false freezes scores until Update.
include-unanswered: true|falseConfig 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-answeredCheck blocks that already have a selection
check-allCheck every block (empty selections become Unanswered)
show-hide-allShow all answers, or hide them if any answer panel is open
reset-allReset every block
correct-scoreCorrect count. Tokens: {count} numerator, {total} denominator, {pct} percent (at most 2 decimals). {x} and {y} still work as aliases of {count} and {total}.
incorrect-scoreIncorrect count. Same tokens
unanswered-scoreUnanswered 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.