<section>
<section> is a Sectional
component that renders a titled block of content. If no <title> is
provided, an auto-generated title (e.g. Section 1) is rendered.
Inline components such as paragraphs (<p>) and other components
can be nested within a <section> to group and order content.
Some examples are: another <section>, a <figure>, or a
<problem>.
Attributes and Properties
Attributes for <section>
Scoring (9)
aggregateScoresboolean. Default value: false. Whether to aggregate scores of scored descendants into a section credit-achieved value.
colorCorrectnessboolean. Default value: false. Whether to color-code answers in this section based on correctness.
displayDigitsForCreditAchievedinteger. Default value: 3. Number of significant digits to display for the section's credit achieved value.
boolean. Default value: false. Whether to force per-answer color-correctness even when section-wide check work is enabled.
boolean. Default value: false. Whether to show a single section-wide check-work button instead of per-answer buttons.
showCorrectnessboolean. Default value: false. Whether to display correctness indicators for answers in this section.
submitLabeltext. Default value: Check Work. Label for the section-wide submit button when correctness is shown.
submitLabelNoCorrectnesstext. Default value: Submit Response. Label for the section-wide submit button when correctness is not shown.
weightnumber. Default value: 1. Relative weight of this section when aggregated by an enclosing scored section.
Other (12)
asListboolean. Default value: false. Whether to render this section's children as a list.
boolean. Default value: false. Whether to render this section with a visible box around it.
completedColortext. Default value: var(--lightGreen). Color used to indicate this section has been completed.
includeAutoNameboolean. Default value: false. Whether to include the auto-generated section name (e.g. "Section") in the rendered title.
includeAutoNameIfNoTitleboolean. Default value: true. Whether to include the auto-generated name when no explicit title is provided.
boolean. Default value: false. Whether to include the auto-generated section number in the rendered title.
includeAutoNumberIfNoTitleboolean. Default value: true. Whether to include the auto-generated number when no explicit title is provided.
boolean. Default value: true. Whether to prefix this section's number with the parent section's number.
inProgressColortext. Default value: var(--mainGray). Color used to indicate this section is in progress.
levelinteger. The heading level for this section (overrides the default level inferred from nesting).
noAutoTitleboolean. Default value: false. Whether to suppress the auto-generated title entirely.
notStartedColortext. Default value: var(--mainGray). Color used to indicate this section has not been started.
Common to all components (9)
copyreference. Create an independent copy of another component by reference. Enter a references a $name.
disabledboolean. Default value: false. Whether this component is disabled and cannot be interacted with.
extendreference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.
fixedboolean. Default value: false. Whether this component's value is fixed and cannot be modified.
fixLocationboolean. 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.
isResponseboolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.
nametext. The name used to reference this component from elsewhere in the document.
styleNumberinteger. Default value: 1. The style number used to select this component's visual styling from the available style definitions.
Properties for <section name="s">
Scoring (6)
$s.aggregateScoresboolean. Whether scores of scored descendants are aggregated into this section's credit value.
$s.displayDigitsForCreditAchievedinteger. Number of significant digits to display for the section's credit achieved value.
$s.sectionWideCheckWorkboolean. Whether to show a single section-wide check-work button instead of per-answer buttons.
$s.submitLabeltext. Label for the section-wide submit button when correctness is shown.
$s.submitLabelNoCorrectnesstext. Label for the section-wide submit button when correctness is not shown.
$s.weightnumber. Relative weight of this section when aggregated by an enclosing scored section.
Other (17)
$s.asListboolean. Whether to render this section's children as a list.
$s.boxedboolean. Whether this section is rendered with a visible box around it.
$s.creditAchievednumber. Aggregate credit achieved (between 0 and 1) for scored descendants of this section.
$s.disabledboolean. Whether this component is disabled and cannot be interacted with.
$s.fixedboolean. Whether this component's value is fixed and cannot be modified.
$s.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$s.includeAutoNameboolean. Whether to include the auto-generated section name (e.g. "Section") in the rendered title.
$s.includeAutoNameIfNoTitleboolean. Whether to include the auto-generated name when no explicit title is provided.
$s.includeAutoNumberboolean. Whether to include the auto-generated section number in the rendered title.
$s.includeAutoNumberIfNoTitleboolean. Whether to include the auto-generated number when no explicit title is provided.
$s.includeParentNumberboolean. Whether to prefix this section's number with the parent section's number.
$s.noAutoTitleboolean. Whether to suppress the auto-generated title entirely.
$s.openboolean. Whether this section is currently open (for collapsible sections).
$s.percentCreditAchievednumber. Aggregate credit achieved as a percentage (between 0 and 100).
$s.sectionNumbertext. The displayed number for this section.
$s.titletext. The displayed title text for this section.
Common to all components (4)
$s.doenetMLtext. The DoenetML source code that produced this component.
$s.hideboolean. Whether to hide this component from the rendered output.
$s.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$s.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: <section> with default title
Within a DoenetML document, default titles for sectional components are auto-numbered. Each sectional component is on the same counter.
Example: <section> with custom title
A custom <section> title is creating by providing a <title>
tag within the <section>.
Example: How to create a subsection (and subsubsection)
A subsection is created by nesting a <section> within another
<section>; nesting one level deeper creates a subsubsection,
and so on. The heading level of each <section> is determined
by how deeply it is nested.
Example: equivalent nesting with <subsection> and <subsubsection>
<subsection> and
<subsubsection> are equivalent to nesting
<section>s to the same depth. Use whichever form makes the
intent clearer in the source: nested <section> lets the
heading level follow the structure, while <subsection> /
<subsubsection> make the intended level explicit at every
tag.
Example: named <section> as a parent reference
When reference names are used more than once in the same document, they can be distinguished (when outside their parent component) by attaching the name of the parent component to the reference.
Above, the <section> named treeSection is the
parent of the <text> named plant. Therefore, when
referencing this specific instance of the component with that name,
you should use $treeSection.plant as shown.
Attribute Examples
Attribute Example: includeParentNumber
The includeParentNumber attribute is true by default for the <section> component (and false for other sectional components, such as <problem> and <exercise>). This allows the default numbering system to include the number of the parent sectional component, followed by the number of the <section>.
If it is preferable to display the section number without the parent section preceding it, set the includeParentNumber attribute to false.
Attribute Example: includeAutoNumber
The includeAutoNumber attribute is false by default for the <section> component. This
means that if a section contains a nested <title>, it will not render the default
numbering (although it will still be counted in the numbering scheme behind the scenes).
In order to display the section number in addition to the custom <title>, set
the includeAutoNumber attribute to true.
Attribute Example: sectionWideCheckWork
The sectionWideCheckWork attribute combines
validation for all <answer> components within the <section> under a
single “Check Work” button.
Attribute Example: forceIndividualAnswerColoring
Typically, the sectionWideCheckWork attribute causes all answer box border colors
to correspond to the overall correctness of the entire section
(i.e., the colors don’t reveal additional information about which answer is correct).
If forceIndividualAnswerColoring is also specified, then each answer box border
will instead be colored according to its own answer’s correctness.
Attribute Example: boxed
The boxed attribute changes the default formatting for section to one
that has a border and a shaded banner for the title.
Attribute Example: hide
The hide attribute takes a boolean as input and can be used with any rendered component.