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

Interval

Consider the case that the answer to a problem is an interval.

The solution is defined by a left boundary ([ for closed and ] for open), two semicolon separated numbers or variables,
and a right boundary (] for closed or [ for open).

Here is an example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
\begin{problem}
 
        \begin{question}
                \text{Write down the Interval from 1 to 3:}
                \explanation{Test test Test}
                \type{input.interval}
                \field{rational}
 
                \begin{answer}
                        \text{ A = }
                        \solution{[1;3]} % or ] for open type, the boundaries should be separated by ";"
                \end{answer}
        \end{question}
 
\end{problem}

There is the optional TeX command \allowIntervalUnionsForInput[<boolean, default: true>] with which you can enable
the option that the student's answer can be given by the union of multiple intervals.

1
2
3
4
5
\begin{answer}
  \text{input.interval: $[1;4) = $}
  \allowIntervalUnionsForInput
  \solution{[1;4)}
\end{answer}

Capture

Furthermore as an author you can give the correct solution as an union of multiple disjoint intervals by separating
them with a comma, an example: \solution{(-infinity;2],[3;infinity)}

Be aware that this is only possible if the optional command \allowIntervalUnionsForInput is used.

More Examples