# Examples for multiple choice questions - each choice say yes if the choice is correct, no if the choice is wrong¶

 % every choice allows a yes or no answer
\begin{question} % start of question
\text{choices: permutechoices; corrector: fixed }
\explanation{The following text shows up in the correction: See explanation presented in the lecture}
\permutechoices{1}{3} % permutes choices {1}{2}{3} randomly.
\type{mc.yesno} % every choice allows a yes or no answer

\begin{choice}
\text{-5 = -5}
\solution{true} % Correct answer is yes
\end{choice}

\begin{choice}
\text{5 = |-5|}
\solution{true} % Correct answer is yes
\end{choice}

\begin{choice}
\text{5 = -5}
\solution{false} % Correct answer is no
\end{choice}
\end{question}


% every choice allows a yes or no answer
\begin{question} % start of question
\text{variables:nunbers,functions; corrector:fixed }
\explanation{}
\type{mc.yesno} % every choice allows a yes or no answer

\begin{variables}
\function{f}{a+b} % defines a function named f
\number{a}{1}
\number{b}{2}
\number{c}{3}
\number{d}{4}
\number{e}{-1}
\end{variables}

\begin{choice}
\text{$f$ = $c$}
\solution{true} % Correct answer is yes
\end{choice}

\begin{choice}
\text{$f$ = $d$} % Correct answer is no
\solution{false}
\end{choice}

\begin{choice}
\text{$f$ = $e$} % Correct answer is no
\solution{false}
\end{choice}
\end{question}


% every choice allows a yes or no answer.
\begin{question} % start of question
\text{variables: randint; function[calculate]; corrector: fixed}
\explanation{}
\type{mc.yesno} % every choice allows a yes or no answer

\begin{variables}
\randint[Z]{b}{6}{12}
\randint[Z]{a}{0}{5}

\function{f}{a+b}
\function[calculate]{f_result}{a+b}

\function{g}{a-b}
\function[calculate]{g_result}{a-b +1}

\function{h}{a*b}
\function[calculate]{h_result}{(a+1)*b}
\end{variables}

\begin{choice}
\text{$f$ = $f_result$}
\end{choice}

\begin{choice}
\text{$g$ = $g_result$}
\end{choice}

\begin{choice}
\text{$h$ = $h_result$}
\end{choice}
\end{question}


\begin{question}
\explanation{Both expressions must have a common denominator before you compare them.}

\permutechoices{1}{2}
\type{mc.yesno}
\field{real}

\begin{variables}
\randint{a}{1}{25}
\randint{b}{2}{35}
\randint{c}{3}{45}
\randint{d}{4}{55}

% If you randomize variables, it could happen, that the random values do not
% satisfy the conditions in the question and have to be adjust.
% in the first bracket all variables you would like to adjust if necessary
\randadjustIf{a,b,c,d}{a<b OR c=d } % see Part 9 http://team.mumie.net/projects/support/wiki/GenericTexProblems
\end{variables}

\begin{choice}
\text{\frac{$a$}{$b$} < \frac{$c$}{$d$}}
\solution{compute}
\iscorrect{a/b}{<}{c/d}
\end{choice}

\begin{choice}
\text{\frac{$d$}{$a$} > \frac{$b$}{$c$}}
\solution{compute} % the correct answer will be calculate automatically.
\iscorrect{d/a}{>}{b/c} %The use of an additional \iscorrect command is required
\end{choice}
\end{question}


Add picture from clipboard (Maximum size: 500 MB)