Close this window

Using the <exercise> tag

Description

The exercise tag is used to present a question or task to the reader, with an optional answer hidden from view until the reader wants to reveal it. The question or task is contained within a problem tag and the answer is contained within a solution tag, both of which are inside the exercise tag.

Example

This CNXML:


<exercise id="texas-exercise">
  <problem id="texas-problem">
    <para id="texas-problem-para">
      What is the capital of Texas?
    </para>
  </problem>
  <solution id="texas-solution">
    <para id="texas-solution-para">
      Austin is the capital of Texas.
    </para>
  </solution>
</exercise>
        

Results in this display:

Exercise 1

What is the capital of Texas?

Attributes(what's this?)

Children(what's this?)

label (one, optional), title (one, optional), problem (one, required), solution (zero or more), commentary (one, optional)

Parents(what's this?)

preformat, para, quote, footnote, note, item, entry, content, section, example, meaning, proof, statement, problem, solution, commentary
Close this window