Question blocks¶
The questions: | block supports four notations.
Any line may carry a # comment, and a line holding nothing but a comment is
skipped — including inside a multi-line group or a pool. See
Comments.
Simple¶
Repeat the same question n times:
Pipe¶
Pick randomly among alternatives on each repetition. Use | with no spaces
inside braces:
The pipe can be applied to identifiers, sources, or both sides independently.
It also works on the value of an option, with the same rules — one draw per question, no space inside the group:
See Option alternatives for the
details, in particular the default value and the two forms that are not
supported: a group nested inside a source group, and a group on a bare flag.
Mix¶
Pair a fixed set of identifiers with a fixed set of sources, randomly
shuffled at generation time. The count must equal the number of identifiers
and the number of sources. Identifiers are space-separated; sources are
separated by spaces or ;:
Options can be given to a single source, inside the group — which requires the
; separator, since spaces separate the sources themselves:
Groups can span multiple lines:
(6) {multi_direct
multi_direct
multi_hole
multi_hole
multi_reversed
multi_reversed}{
2×6-9
3×5-9
4×4-8
5×5-9
6×7
7×8}
Options after a group¶
Options written after a source group apply to every source of that group, whichever notation it uses:
(2) {multi_direct multi_hole} {2-9×2-9; 3-9×3-9} -- variant=x
(3) multi_direct {2-5×2-5|6-9×6-9} -- variant=x
A source carrying its own options keeps them: the more specific value wins. In
the line below, the first source is generated with variant=y and the second
with variant=x:
Anything other than options after a group is an error — the group closes the source part of the line.
Pool¶
Sample n questions at random from a weighted pool. Each line adds (weight)
copies of a question to the pool; n must not exceed the total weight:
(1) {{ multi_direct 6×6 (1)
multi_reversed 6×6 (1)
multi_hole 6×6 (1)
multi_direct 4×9 (1)
multi_reversed 4×9 (1)
multi_hole 4×9 (1) }}
A pool item can be commented out like any other line — the total weight the count is checked against follows what is left:
Pool lines can also use pipe notation: