Referencesection

<section>

<section> is a Sectional component that renders an auto-numbered block of content. 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>
AttributeTypeValues
aggregateScores = "…"boolean"true" "false"
asList = "…"boolean"true" "false"
boxed = "…"boolean"true" "false"
displayDigitsForCreditAchieved = "…"integer
includeAutoName = "…"boolean"true" "false"
includeAutoNameIfNoTitle = "…"boolean"true" "false"
includeAutoNumber = "…"boolean"true" "false"
includeAutoNumberIfNoTitle = "…"boolean"true" "false"
includeParentNumber = "…"boolean"true" "false"
level = "…"
sectionWideCheckWork = "…"boolean"true" "false"
showCorrectness = "…""true" "false"
submitLabel = "…"text
submitLabelNoCorrectness = "…"text
weight = "…"number
Props for <section name="s">
PropertyType
$s.aggregateScoresboolean
$s.asListboolean
$s.boxedboolean
$s.creditAchievednumber
$s.disabledboolean
$s.displayDigitsForCreditAchievedinteger
$s.fixedboolean
$s.fixLocationboolean
$s.hiddenboolean
$s.includeAutoNameboolean
$s.includeAutoNameIfNoTitleboolean
$s.includeAutoNumberboolean
$s.includeAutoNumberIfNoTitleboolean
$s.includeParentNumberboolean
$s.openboolean
$s.percentCreditAchievednumber
$s.sectionNumbertext
$s.sectionWideCheckWorkboolean
$s.submitLabeltext
$s.submitLabelNoCorrectnesstext
$s.titletext
$s.weightnumber

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

A subsection is created by nesting one or more sections within a <section>.


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 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: aggregateScores and sectionWideCheckWork

The aggregateScores and sectionWideCheckWork attributes together combine validation for all <answer> components within the <section> under a single “Check Work” button.


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.