<< Part 1 - Part 3 >>

Part 2: Create multiple choice problems

Problems and questions

The content of every generic TeX problem is included in a problem environment which must be contained only once in TeX files. The use of the \usepackage declaration is mandatory too. Every question is defined in a question environment inside problem. The structure looks as following:

\usepackage{mumie.genericproblem}
\begin{problem}
    \begin{question} % start of question 1
      ...
    \end{question}

    \begin{question} % start of question 2
      ...
    \end{question}
\end{problem}

Within the question environment, one must define a type using the \type{<option>} command. For multiple choice problems (MC problems) it must be one of the following options:
  • mc.unique: only one choice can be selected
  • mc.multiple: multiple choices are selectable
  • mc.yesno: every choice allows a yes or no answer
And regarding MC problems, one must / can also use the following commands within the question environment:
  • \text{<description>}: (mandatory), shows the task for the specific question.
  • \explanation{<description}: (optional), shows an explanation on the correction page if the answers were not fully correct.
    • By default the explanation will only be shown when the users answer is not fully correct. One can use the command \showExplanation{always} for the explanation to always be visisble.
\begin{question}
    \text{This will show the task description for this question.}
    \explanation{This will show the explanation in the corrector, using this command is optional.}

    % If the command below is left out, explanations will only be shown when the users answer is not fully correct
    \showExplanation{always}

    % One of the options must be chosen
    \type{mc.multiple | mc.unique | mc.yesno}
\end{question}

Choices

For each MC problem type one has to define choices. Every choice must be declared by an own choice environment, containing a text and a solution. The solution can be either:
  • true: this choice must be selected for a correct answer (or yes must be selected for yesno type)
  • false: this choice must NOT be selected for a correct answer (or no must be selected for yesno type)
  • compute: the correct answer will be computed automatically. The use of an additional \iscorrect command is required (see part 3 for more information).
For all MC problem types mc.multiple, make sure that there is at least one answer that is set (or evaluates) to true, otherwise an error will occur when correcting the question.
For mc.unique exactly one answer hast to evaluate to true
For mc.yesno no restriction applies
\begin{choice}
  \text{The text (or math $4 != -4$) belonging to the choice}

  % One of the options must be chosen
  \solution{true | false | compute}
\end{choice}

Choices may be permutated automatically by using the command \permutechoices{<begin>}{<end>} which requires 2 arguments: they describe the starting and ending index of the choices which should be permutated.
If a question contains 5 choices and the choices one to four should be permutated, then the following code is required:

\permutechoices{1}{4}

Complete example

\usepackage{mumie.genericproblem}
\begin{problem}

    \begin{question} % start of question 1
      \text{Exercise - choose the correct answer}
      \type{mc.unique}

      \begin{choice}
        \text{1+2=3}
        \solution{true}
      \end{choice}

      \begin{choice}
        \text{2+3=7}
        \solution{false}
      \end{choice}

    \end{question}

\end{problem}

Add picture from clipboard (Maximum size: 500 MB)