Solution hints
The solutionhint
element can be used to create solution hints for an exercise or an input field in the course. There are two kinds of solution hints:
- Standalone solution hints are displayed at the location where they appear in the XML code.
- Solution hints can be bound to a specific input field by setting the
to
attribute. The solution hint then only appears when the user asks for help at this input field.
When the to
attribute is not set on a solution it, a standalone solution hint is created.
Hint
Solution hints are not shown during a test.
Solution steps
A solution hint consists of one or more solution steps. Each solution step is described with a separate step
element.
Bound solution hints
Example
<exercisebox>
<p>
What is the square root of <m>16</m>?
</p>
<p>
Answer: <input name="square-root-seventeen"><number>4</number></input>
</p>
<solutionhint to="square-root-seventeen">
<step>
<p>
The square root of a nonnegative number <m>x</m> is the number
whose square equals <m>x</m>.
</p>
<p>
In this case we are looking for a number whose square is <m>16</m>.
</p>
</step>
<step>
<p>
Since we have <m>4 \cdot 4 = 16</m>, the correct solution is <m>4</m>.
</p>
</step>
</solutionhint>
</exercisebox>
Attributes
The solutionhint
element supports the following attributes:
Attribute | Type | Default | Description |
---|---|---|---|
name |
xs:Name |
- | Name of this element. Must be unique among all element names in this course variant. |
tags |
TokenList |
Whitespace-separated list of tags of this element. | |
to |
xs:Name |
- | When set, links this solution hint to the input element of the page with the given name. Must be the name of an "input", "inputblock" or "booleangroup" element. |
The step
element supports the following attributes:
Attribute | Type | Default | Description |
---|---|---|---|
name |
xs:Name |
- | Name of this element. Must be unique among all element names in this course variant. |
tags |
TokenList |
Whitespace-separated list of tags of this element. |