Here is a typical quiz with a question and four alternative answers:
Question: What is the capital of Norway?
The above quiz can be specified by the compact text
!bquiz
Q: What is the capital of Norway?
Cw: Helsinki
Cw: Drammen
Cr: Oslo
Cw: Denmark
!equiz
!bquiz
("begin quiz") and !equiz
("end quiz") tags.Q:
("question").Cw:
, and right choices with Cr:
.!bquiz
, !equiz
, Q:
, Cw:
, and Cr:
must appear
at the beginning of a line.Cr:
) lasts up to the next
instruction (like Cw:
, Cr:
, !equiz
).Multiple correct choices are possible. Here is an example with three right choices:
!bquiz
Q: Which of the following cities are capitals?
Cw: Sidney
Cr: Kigali
Cw: Bonn
Cr: Bern
Cr: Ottawa
Cw: New York
!equiz
Question: Which of the following cities are capitals?
Sometimes it is desireable to give some explanation why certain choices are wrong (or right). If you click on the symbols in the quiz below, explanations will be shown for Choices 1 and 2.
Question: What is the capital of Norway?
E: ...
after the choice to
give an explanation of that choice.
!bquiz
Q: What is the capital of Norway?
Cw: Helsinki
E: Helsinki is the capital of Finland.
Cw: Drammen
E: Drammen is a small city close to Oslo.
Cr: Oslo
Cw: Denmark
!equiz
This time we also added some whitespace for enhanced reading of the text.
It is easy to use emphasize font, boldface, color, hyperlinks, etc., since the text in the specification of questions, choices, and explanations are rendered according to the DocOnce markup language. For simple typesetting (emphasize, boldface, links) DocOnce also accepts Markdown syntax. Here is an example:
Question: This is a very famous quote:
Premature optimization is the root of all evil.This quote is attributed to
The corresponding specification reads
!bquiz
Q: Here is a famous quote:
!bquote
*Premature optimization is the root of all evil.*
!equote
This quote is attributed to
Cw: Geroge W. Bush
Cr: Donald Knuth
E: According to "Wikiquote": "http://en.wikiquote.org/wiki/Donald_Knuth",
Donald Knuth wrote this statement in *Structured Programming with
Goto Statements*. Computing Surveys, _6_:4,
pp. 261-301, _1974_.
Cw: Ole-Johan Dahl
E: Ole-Johan Dahl was a famous Norwegian professor of computer
science and together with Kristen Nygaard the inventor of
object-oriented programming, but he is not the man behind this
quote.
!equiz
Question admonitions may well feature quizzes unless the output
format is reStructuredText (rst
, sphinx
). A plain question
admonition is
!bquestion
What is the capital of Norway?
!equestion
Putting a quiz inside the question admonition looks like
What is the capital of Norway?
!bquestion
!bquiz
Q: [] What is the capital of Norway?
Cw: [Answer:] Stockholm
E: Stockholm is the capital of Sweden, Norway's neighboring country.
Cw: Bergen
E: Some people from Bergen may claim so... It is just the second
largest city in Norway.
Cr: Oslo
Cw: Denmark
!equiz
!equestion
html
), questions are by default preceded by
Question:
and choices by Choice X:
, where X
is the
number of the choice.
The prefix appears inside square brackets. Empty brackets, as those
in the question, leads to no prefix. The choice Stockholm
has
a prefix [Answer:]
, and exactly the text inside the square brackets
precedes the text of this choice in the output.