1.
Here is a question.
Hint.
A little hint.
Answer.
Just the answer.
Solution.
All the glorious details about an answer.
<exercise>
s
<exercise>
s as part of an <exercises>
element within a division, which is the typical way for creating a collection of exercises togther at the end of a division such as a chapter or section. The content of an <exercises>
division is rather limited. It can begin with an <introduction>
(perhaps a set of common instructions), followed by a mixture of <exercise>
and <exercisegroup>
(see Subsection 16.3.1) elements, followed by an optional <conclusion>
. The sample code in Listing 16.3.1 illustrates this structure, which is rendered later as “16.4 Exercises”.<exercises>
division is to use a sequence of <subsexercises>
elements, optionally preceded by an <introduction>
and followed by a <conclusion>
. The content of a <subexercises>
element is identical to what was described above for an <exercises>
element, but we emphasize that a strong rationale for using <subexercises>
(as opposed to <exercisegroup>
) is that a <subexercises>
element can begin with a <title>
, providing a clear way of organizing the <exercise>
s for the reader.<exercisegroup>
<exercisegroup>
tag. An <exercisegroup>
can only be used as part of an <exercises>
element or a <subexercises>
element, however! The portion of this section headed as “16.4 Exercises” is produced using the code in Listing 16.3.1.<exercises xml:id="basics-s-sample-exercises">
<exercisegroup>
<introduction>
<p>
Here's where you put the common instructions.
</p>
</introduction>
<exercise>
<statement>
<p>
First exercise.
<idx><h sortby="statement"><tag>statement</tag></h><h sortby="of an exercise">of an <tag>exercise</tag></h></idx>
<idx><h sortby="exercise"><tag>exercise</tag></h><h sortby="statement"><tag>statement</tag></h></idx>
You can add all the usual bells and whistles after,
but we'll keep it short here.
(The <tag>statement</tag> may be omitted if none of
<tag>hint</tag>, <tag>answer</tag>, or <tag>solution</tag>
are present as a child of the <tag>exercise</tag>.)
</p>
</statement>
</exercise>
<exercise>
<statement>
<p>
Second exercise.
</p>
</statement>
<hint>
<p>
The <tag>statement</tag> for this exercise is necessary because we
have included at least one of
<tag>hint</tag>, <tag>answer</tag>, or <tag>solution</tag>
(namely, <tag>hint</tag>).
</p>
</hint>
</exercise>
<exercise>
<p>
Third exercise.
(No <tag>statement</tag> necessary here because no
<tag>hint</tag>, <tag>answer</tag>, or <tag>solution</tag>.)
</p>
</exercise>
</exercisegroup>
<exercise>
<p>
This <tag>exercise</tag> is not inside the <tag>exercisegroup</tag>.
</p>
</exercise>
</exercises>
<exercisegroup>
.<exercisegroup>
to be put in multiple columns, you can add a @cols
attribute to the <exercisegroup>
with value (for example) 3
. The integer value of @cols
must be between 2 and 6 (inclusive). <reading-questions>
, can be used to house <exercise>
s designed to test or guide a reader’s comprehension of the material in that division. The structure of a <reading-questions>
element is similar to an <exercises>
element, but without the grouping options of <subexercises>
and <exercisegroup>
. The portion of this section headed as “16.3.3 Check your understanding!” is produced using the code in Listing 16.3.2.<reading-questions xml:id="basics-reading-questions">
<title>Check your understanding!</title>
<introduction>
<p>
Here is a spot to explain the purpose of these questions. It's
optional, like most introductions.
</p>
</introduction>
<exercise>
<statement>
<p>
Here is a question.
</p>
</statement>
<hint>
<p>
A little hint.
</p>
</hint>
<answer>
<p>
Just the answer.
</p>
</answer>
<solution>
<p>
All the glorious details about an answer.
</p>
</solution>
</exercise>
<exercise>
<statement>
<p>
A second comprehension question. We don't bother with answers
or solutions.
</p>
</statement>
</exercise>
<conclusion>
<p>
A little wrap up, perhaps giving guidance or encouragement if
the student struggled with the questions. Optional like most
conclusions.
</p>
</conclusion>
</reading-questions>
<reading-questions>
.