Questions and Answers

Questions and answers are the basic building blocks of a valid document. This section explains the syntax and structure of questions and answers.

Questions#

Defining a question consists of: a distinct paragraph, starting with a number immediately followed by a dot "." or a closing parenthesis ")" and finally the text of the question.

For example:

12. What is the capital of France?

Now every question, in order to be valid, must be accompanied by a list of answers.

Answers#

Similarly to a question, an answer consist of: a distinct paragraph, starting with an alphabetic character (a-z) immediately followed by a dot "." or a closing parenthesis ")" and finally the text of the answer.

A complete example:

12. What is the capital of France?
a. Paris
b. Amsterdam
c. Vienna
d. Moscow
e. Bucharest

The above example, uses the dot and "a, b, c, d, e" letters for defining the answers. At the same time, it would work just fine if any other letter is used and instead of the dot the closing parenthesis. Mixing dots and parenthesis is also valid.

Another example:

123. What is the capital of France?
a) Paris
b. Amsterdam
x. Vienna
w) Moscow
f) Bucharest

Marking the correct answer#

Last but not least, one of the answers must be marked as the correct answer. In order to do that, add the "[true]" token right after "a)" or at the end of the answer's text.

Single choice question example:

123. What is the capital of France?
a) [true] Paris
b. Amsterdam
x. Vienna
w) Moscow
f) Bucharest

Multi choice question example:

14. Select the fruits:
a) [true] Avocado
b. [true] Guava
x. Carrot
w) Melons
f) Tomates

Answers count#

By default, each question is expected to be followed strictly by a list of 5 answers. This can be changed on the document level but also per question.

Use the "Answers count:" token followed by a number in order to change the required amount of answers.

For changing the answers count once for every question, add the token at the very top of your document, before all chapters, questions or answers.

Example:

Answers count: 3
1. Which of the following options is the right way to change the answers count?
a. Answers: 3
b. Answerscount: 4
c. [true] Answers count: 3

The other option, is to change the required amount of answers for a single, particular question. Using the same token in the paragraph following the question definition.

Example:

1. Which of the following options is the right way to change the answers count?
Answers count: 3
a. Answers: 3
b. Answerscount: 4
c. [true] Answers count: 3

Attaching images#

It is possible to attach images, one or many, to questions and answers. Attaching images does not require any special tokens. Simply insert the image below the question paragraph and similarly insert after any answer paragraph.

Explanation#

The text of an explanation, obviously, is supposed to clarify, in some detail, the correct answer.

As usual, in a distinct paragraph, use the "Explanation: " token and then add the text. Explanations are optional, and if present should be placed right after the last answer of a question.

Example:

Chapter: Capitals
1. Select the fruit
a) [true] Avocado
b) Tomatos
c) Watermelon
Explanation: Avocado is a fruit. More specifically, botanists define it as a large berry with a single seed. Although it's not nearly as sweet as many other fruits, it falls under the definition of fruit, which is “the sweet and fleshy product of a tree or other plant that contains seed and can be eaten as food”

Validation rules#

  • Minimum question text length is 5 characters
  • Maximum question text length is 1,000 characters
  • Questions must have at least 5 answers
  • In a list of answers at least one item must be marked as the correct answer