# Part 6: FiniteNumberSets¶

It's possible to have finite number sets as solutions for certain questions of generic tex problems. The corresponding question type is "input.finite-number-set". Each answer of a question of that type has a finite number set as solution. The solution is specified by means of the \solution command, as usual. The argument of the command must be a comma-separated list of variable names. Each variable denotes an element of the set. Of course, the variables must be defined somewhere in the problem. Please note: it is not possible to use literal numbers in the solution. You have to use variables.

Here is an example:

\usepackage{mumie.genericproblem}

\title{Scratch}

Test Test Test

\begin{problem}

\begin{question}

\begin{variables}
\number{a}{1/2}
\number{b}{1/3}
\number{c}{1/5}
\end{variables}

\text{\textit{Write down the set A of numbers $\var{a}$, $\var{b}$, and $\var{c}$}:}
\explanation{Test test Test}
\type{input.finite-number-set}
\field{rational}

\text{ A = }
\solution{a, b, c}

\end{question}

\end{problem}


If the user has not edited the problem before, the problem applet of this example looks like the following:

The user has to click the button "Define set" to edit the set. Immediately after clicking the button an empty set shows up:

Elements can be added by means of the "+" button. The "-" button removes the last element:

Please note: The technique with the initial "Define set" button is needed to distinguish a not-edited set from an empty set. Initially, the set is not edited. Immediately after clicking the "Define set" buttun the set is considered edited, but empty.

Add picture from clipboard (Maximum size: 500 MB)