# Part 7: Interval¶

Consider the case that the answer to a problem is an interval.
The syntax is similar to the one for sets

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

\begin{problem}

\begin{question}
\text{Write down the Interval from 1 to 3:}
\explanation{Test test Test}
\type{input.interval}
\field{rational}

\text{ A = }
\solution{[1;3]} % or ] for open type, the boundaries should be separated by ";"
\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.

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

\solution{(-infinity;2],[3;infinity)}
Be aware that this is only possible if the optional command \allowIntervalUnionsForInput is used.