choicesfunction
#choices(
body,
correct: none,
bubble: "circle",
inline: auto,
columns: auto,
gap: auto,
size: auto,
outset: auto,
stroke: auto,
label-font: auto,
solution-color: auto,
solution-background-color: auto,
enumerate: auto,
)Used for creating multiple-choice questions. Accepts a list, with each list item becoming a #choice[..] with a bubble. Correct choices start with + and incorrect choices with -.
For example, to specify a list of choices, a, b, c, with c being the correct choice, use:
#choices[
- a
- b
+ c
]
When solutions are shown, the correct choices are filled in and checked.
Arguments
bodycontent | arrayrequiredpositionalThe choices, as a list (one
- .. item per choice, or + .. for a correct one) or the choices as an array of content.correctdefaultnone| int | str | content | arrayThe correct choice, by index (
0-indexed) or, when the bubbles are labelled (see enumerate), by label (e.g. "A"), or an array of indices/labels. Additive with choices marked with +.bubbledefault"circle"| "square"The shape of the bubbles:
"circle" for "select one", "square" for "select all that apply".Show the choices inline in a paragraph. If you would like a grid of choices, consider using columns instead. Setting to auto uses config's choices-inline.
Note: inline and columns are taken together: giving either one ignores both of config's choices-inline and choices-columns.
Split the choices into the specified number of columns. Setting to
none results in a single column (i.e., each choice on its own line). Cannot be combined with inline. Setting to auto uses config's choices-columns.The space between the choices. A fraction (e.g.
1fr) spreads side-by-side choices across the line. Setting to auto uses config's choices-gap.The space around each bubble, specified like
#choice[..]'s outset. Sides given replace those of config's bubble-outset; the others are kept. Setting to auto uses config's bubble-outset.The outline of the bubbles, specified like
config's bubble-stroke (e.g. .15em, blue, or .15em + blue). What it leaves out, its thickness or its color, is config's. Setting to auto uses config's bubble-stroke.The font of the labels inside the bubbles, relevant when
enumerate: true is set. Setting to auto uses config's bubble-label-font.The primary color for the correct bubbles; i.e., the color of their outlines, check marks, and text when filled in. Setting to
auto uses config's solution-color.The background color for the correct bubbles when filled in. Setting to
auto uses config's solution-background-color.Determines how the bubbles are labelled. Setting to
false results in no labels; true results in A, B, C, …. A numbering pattern, function, or array of labels can be used (e.g., "a" or ("x", "y", "z")). Setting to auto uses config's choices-enumerate.