You're not reading the latest revision of this page, which is here.

Answer types

Two levels allow setting answer types within a question: at the question level, applying a uniform input type for all answer fields, or within each answer environment. Hence a question can for instance wrap an answer of type Multiple Choice and an answer of typy input fields.

There are Multiple Choice problems of different types (do not confuse that with the type of answers): unique, multiple, yes-no, .... For details see the corresponding paragraph below.

(see Different Answer Type)

Setting the type is done by the \type{...}-command, and the position of the command determines
how it works.

Example 1 (one type for all answers fields):

1
2
3
4
5
6
7
8
9
10
11
12
\begin{question}
    \type{input.number} % set for all answers
 
    \begin{answer}
        ...
    \end{answer}
 
    \begin{answer}
        ...
    \end{answer}
 
\end{question}

Example 2 (possibly different types for each answer):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
\begin{question}
    \type{input.generic} % optional
 
    \begin{answer}
        \type{input.number} % this answer has to be a number
        ...
    \end{answer}
 
    \begin{answer}
        \type{input.function} % this answer is a function
        ...
    \end{answer}
 
    \begin{answer}
        \type{mc.multiple} % this answer block consists of a MC-question.
        ...
    \end{answer}
 
\end{question}

In the second example, the command \type{input.generic} can be omitted, but each answer
environment needs to have a \type{...}-command. It is not possible to set a specific type
on question level and just overwrite it for some answers.

Notice that some features like [\permuteAnswers](input.fields.md#permutable-answers) won't be available if a question has different types of answers.

Multiple Choice types

More detailed information on MC questions can be found under the following link:
Multiple choice questions

Here is just an overview of the types:

Type Preview
mc.multiple


example
mc.multiple
mc.unique


example
mc.unique
mc.yesno


example
mc.yesno
mc.matrix


example or the full article here
mc.matrix

input-types

More detailed information on input field questions can be found under the following link:
Overview input field questions

Here is just an overview of the types:

Type Preview
input.number


example and detailed explanation
input.number
input.finite-number-set

example in WebMiau

By default only numbers (e.g. 1, 5, 1.2, 2/3) are accepted values for the user input. With the command \allowForInput the set of valid symbols for the input can be extended. That allows for example to ask for multiple of pi: \allowForInput{+ - * / pi}.
input.finite-number-set
input.function
Compare the user's answer numerically
with the pre-given solution or subject to given conditions

example and detailed explanation
input.function
input.cases.function
Designed for case differentiations of e.g. absolute value functions.
Note that you can only use this input type in an answer environment.

example and detailed explanation
input.cases.function
input.interval


Details
input.interval
input.matrix
If the solution to a question is a row vector, a column vector or a matrix,
the generic problem is of the type input.matrix.

example (cross product) and detailed explanation

Use checkAsFunction for comparing matrices with (multivariate) functions as matrix entries.

example (Jacobian matrix)
input.matrix
input.text


examples and detailed explanation
input.text
input.truth-table


Details
input.truth-table