Chapter 23 WeBWorK Exercises
It is possible to embed WeBWorK exercises into a PreTeXt document. In the HTML version, readers can answer these exercises and find out if their answer is correct or incorrect. However, results of WeBWorK exercises cannot be recorded to your gradebook. There's some configuration required use WeBWorK. Please see Chapter 8 and Chapter 40 for more details. As soon as you add WeBWorK exercises, compiling to produce any output format becomes a multistep process.
When a WeBWorK exercise lives on the server, the code takes one form.
The code in Listing 23.0.1 produces the following output:
It is also possible to code WeBWorK exercises directly in your PreTeXt source. This shows the most primitive sort of such exercise. The section of the Author's Guide referenced above goes into greater detail (Chapter 8).
The code in Listing 23.0.3 produces the following output: