Skip to content

Multi-Choice

The multi-choice function renders answer options with configurable markers and layouts.

#multi-choice(columns: <int|none>, marker: <str|fn>, label: <str>, ..choices)
ParameterTypeDefaultDescription
columnsint or none11 = vertical list, none = inline, > 1 = grid
markerstr or function"bubble"Marker preset or custom function
labelstr"A"Numbering pattern for choice labels
marker-fontstr, array, or nonenoneFont for marker letters
correct-emphasisfunction or noneFunction applied to correct text when answers shown
none-abovenone, bool, or autononeAppend “None of the above” option
choice-alignalignmenttopVertical alignment within each choice cell
MarkerDescription
"bubble"Empty circle (radio-style)
"bubble-letter"Circle with letter inside
"checkbox"Empty square
"checkbox-letter"Square with letter inside
"none"No marker, just the label
  • select-one(..) — alias for multi-choice(marker: "bubble", ..)
  • select-many(..) — alias for multi-choice(marker: "checkbox", ..)
  • correct[...] — marks the choice as the correct answer
  • bad[...] — marks a choice as “bad fill” (scribble overlay)
#question(points: 5)[
  What is the capital of France?
  #multi-choice(
    marker: "bubble-letter",
    [London],
    [Berlin],
    correct[Paris],
    [Madrid],
  )
]
#question(points: 5)[
  Which of these are prime numbers?
  #select-many(
    columns: 2,
    marker: "checkbox-letter",
    correct[7],
    [8],
    correct[11],
    [12],
  )
]
#question(points: 3)[
  Is the earth flat?
  #select-one(
    marker: "checkbox-letter",
    columns: none,
    [Yes],
    correct[No],
  )
]
#question(points: 5)[
  Which of these animals can fly?
  #multi-choice(
    marker: "bubble-letter",
    none-above: auto,
    [Dog],
    [Cat],
    [Fish],
  )
]

When show-answers is true, correct choices are filled and emphasized:

#examst-set(show-answers: true)

#question(points: 5)[
  What is 2 + 2?
  #multi-choice(
    marker: "bubble-letter",
    [3],
    correct[4],
    [5],
    [6],
  )
]

#examst-reset()