Referenceexercises

<exercises>

A container element grouping `<exercise>` components, which are rendered as a list by default

<exercises> is a Sectional component that groups a collection of <exercise> (or <problem>) components and, by default, renders them as a numbered list. It is an alias for <problems> and behaves the same way: <exercises> sets asList to true by default, which means that only the title child, sectional children, an <introduction>, and a <conclusion> are rendered. Any other content nested inside <exercises> — including plain text and <p> components — is silently dropped. To frame the list with prose, wrap that prose in an <introduction> or <conclusion>.

Attributes and Properties

Attributes for <exercises>

Scoring (9)
aggregateScores

boolean. Default value: false. Whether to aggregate scores of scored descendants into a section credit-achieved value.

colorCorrectness

boolean. Default value: false. Whether to color-code answers in this section based on correctness.

displayDigitsForCreditAchieved

integer. Default value: 3. Number of significant digits to display for the section's credit achieved value.

forceIndividualAnswerColoring

boolean. Default value: false. Whether to force per-answer color-correctness even when section-wide check work is enabled.

sectionWideCheckWork

boolean. Default value: false. Whether to show a single section-wide check-work button instead of per-answer buttons.

showCorrectness

boolean. Default value: false. Whether to display correctness indicators for answers in this section.

submitLabel

text. Default value: Check Work. Label for the section-wide submit button when correctness is shown.

submitLabelNoCorrectness

text. Default value: Submit Response. Label for the section-wide submit button when correctness is not shown.

weight

number. Default value: 1. Relative weight of this section when aggregated by an enclosing scored section.

Other (12)

boolean. Default value: true. Whether to render this section's children as a list.

boxed

boolean. Default value: false. Whether to render this section with a visible box around it.

completedColor

text. Default value: var(--lightGreen). Color used to indicate this section has been completed.

includeAutoName

boolean. Default value: false. Whether to include the auto-generated section name (e.g. "Section") in the rendered title.

includeAutoNameIfNoTitle

boolean. Default value: true. Whether to include the auto-generated name when no explicit title is provided.

includeAutoNumber

boolean. Default value: false. Whether to include the auto-generated section number in the rendered title.

includeAutoNumberIfNoTitle

boolean. Default value: true. Whether to include the auto-generated number when no explicit title is provided.

inProgressColor

text. Default value: var(--mainGray). Color used to indicate this section is in progress.

level

integer. The heading level for this section (overrides the default level inferred from nesting).

noAutoTitle

boolean. Default value: false. Whether to suppress the auto-generated title entirely.

notStartedColor

text. Default value: var(--mainGray). Color used to indicate this section has not been started.

renameTo

text. Override the auto-generated section name (e.g. rename "Section" to a custom label).

Common to all components (9)
copy

reference. Create an independent copy of another component by reference. Enter a references a $name.

disabled

boolean. Default value: false. Whether this component is disabled and cannot be interacted with.

extend

reference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.

fixed

boolean. Default value: false. Whether this component's value is fixed and cannot be modified.

fixLocation

boolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

boolean. Default value: false. Whether to hide this component from the rendered output.

isResponse

boolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.

name

text. The name used to reference this component from elsewhere in the document.

styleNumber

integer. Default value: 1. The style number used to select this component's visual styling from the available style definitions.

Properties for <exercises name="e">

Scoring (6)
$e.aggregateScores

boolean. Whether scores of scored descendants are aggregated into this section's credit value.

$e.displayDigitsForCreditAchieved

integer. Number of significant digits to display for the section's credit achieved value.

$e.sectionWideCheckWork

boolean. Whether to show a single section-wide check-work button instead of per-answer buttons.

$e.submitLabel

text. Label for the section-wide submit button when correctness is shown.

$e.submitLabelNoCorrectness

text. Label for the section-wide submit button when correctness is not shown.

$e.weight

number. Relative weight of this section when aggregated by an enclosing scored section.

Other (16)
$e.asList

boolean. Whether to render this section's children as a list.

$e.boxed

boolean. Whether this section is rendered with a visible box around it.

$e.creditAchieved

number. Aggregate credit achieved (between 0 and 1) for scored descendants of this section.

$e.disabled

boolean. Whether this component is disabled and cannot be interacted with.

$e.fixed

boolean. Whether this component's value is fixed and cannot be modified.

$e.fixLocation

boolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

$e.hidden

boolean. Whether this component is hidden from the rendered output.

$e.includeAutoName

boolean. Whether to include the auto-generated section name (e.g. "Section") in the rendered title.

$e.includeAutoNameIfNoTitle

boolean. Whether to include the auto-generated name when no explicit title is provided.

$e.includeAutoNumber

boolean. Whether to include the auto-generated section number in the rendered title.

$e.includeAutoNumberIfNoTitle

boolean. Whether to include the auto-generated number when no explicit title is provided.

$e.noAutoTitle

boolean. Whether to suppress the auto-generated title entirely.

$e.open

boolean. Whether this section is currently open (for collapsible sections).

$e.percentCreditAchieved

number. Aggregate credit achieved as a percentage (between 0 and 100).

$e.sectionNumber

text. The displayed number for this section.

$e.title

text. The displayed title text for this section.

Common to all components (4)
$e.doenetML

text. The DoenetML source code that produced this component.

$e.hide

boolean. Whether to hide this component from the rendered output.

$e.isResponse

boolean. Whether this component is treated as a response for the purposes of assessment.

$e.styleNumber

integer. The style number used to select this component's visual styling from the available style definitions.

Examples

Example: <exercises> rendering its children as a list

Each nested <exercise> is rendered as a numbered list item.


Example: framing the list with <introduction> and <conclusion>

Because asList is true, the only ways to surround the list with prose are an <introduction> (before the list) and a <conclusion> (after it). Both are passed through unchanged; the contained <exercise> items are still rendered as numbered list items.


Example: ignored content when asList is true

Both the bare string and the <p> are ignored because they are neither sectional components nor an <introduction> or <conclusion>. Only the two <exercise>s render. Wrap such prose in an <introduction> or <conclusion> to make it visible.

Attribute Examples

Attribute Example: asList

Set asList="false" to render the contained exercises as ordinary sectional blocks rather than as list items. With list rendering turned off, sibling prose (and any other children) renders normally alongside the exercises.


Attribute Example: hide

The hide attribute takes a boolean as input and can be used with any rendered component.