<< Part 10 - Part 12 >>

Part 11: Answer Placeholder

In the context of generic problems or quickchecks you may want to add an input field inline to your question text.

Example:
Given are $a = 2, b = 3, c = 2, d = 1$
$a + b = $ <input field>, and $c + d = $ <input field>.

For this purpose you can use the command \ansref in the question text. The placeholder will then be replaced by the answer defined in the answer environment. Make sure you define as many answers as the number of \ansref used.

\begin{question}
  ...
  \text{Given are $a = \var{a}, b = \var{b}, c = \var{c}, d = \var{d}$\\ 
        $a + b$ = \ansref, and $c + d = $\ansref
  }

  \begin{answer}
   \solution{a+b}
  \end{answer}

  \begin{answer}
   \solution{c+d}
  \end{answer}
\end{question}

Add picture from clipboard (Maximum size: 500 MB)