Demonstration of the ‘feedback’ environment
Feedback
How to generate/use the feedback environment.
Feedback can be provided to students using the feedback environment within a problem-style environment. The feedback environment takes some optional arguments (see below) to determine when it is displayed, but by default it is displayed after any attempt at the problem (regardless of whether that attempt was correct or incorrect).
For example, consider the following:
The previous problem is generated by the code:
\begin{problem}
Guess a number! $\answer{\pi}$
\begin{feedback}
$\pi$. The answer is $\pi$.
\end{feedback}
\end{problem}
It is also worth noting that you can stack feedback environments in the same question. For example, try the following: