Referenceproblems

<problems>

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

<problems> is a Sectional component that groups a collection of <problem> components and, by default, renders them as a numbered list. <problems> sets asList to true by default, which means that only the title child, sectional children (such as <problem>s), an <introduction>, and a <conclusion> are rendered. Any other content nested inside <problems> — 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 <problems>

Scoring (10)
aggregateScores

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

colorAnswersSeparately

boolean. Default value: false. When section-wide check work is enabled, color each answer based on its own correctness rather than the section's overall credit.

colorCorrectness

boolean. Default value: true. Whether to color-code the answers it contains based on correctness.

displayDigitsForCreditAchieved

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

maxNumAttempts

integer. Default value: Infinity. Maximum number of times the section-wide check-work button can be submitted. Once reached, all enclosed answers are disabled.

sectionWideCheckWork

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

showCorrectness

boolean. Default value: true. Whether to display correctness indicators for the answers it contains.

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 (17)

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.

collapsible

boolean. Default value: false. Whether the section can be collapsed and expanded.

completedColor

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

completedColorDarkMode

text. Default value: #1a5e20. Color used to indicate this section has been completed (dark mode). If omitted, the dark-mode color is derived from completedColor when that attribute is explicitly set; otherwise falls back to a dark green that meets WCAG AA contrast for white text.

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.

inProgressColorDarkMode

text. Default value: #3a3a3a. Color used to indicate this section is in progress (dark mode). If omitted, the dark-mode color is derived from inProgressColor when that attribute is explicitly set; otherwise falls back to a dark gray that meets WCAG AA contrast for white text.

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.

notStartedColorDarkMode

text. Default value: #3a3a3a. Color used to indicate this section has not been started (dark mode). If omitted, the dark-mode color is derived from notStartedColor when that attribute is explicitly set; otherwise falls back to a dark gray that meets WCAG AA contrast for white text.

renameTo

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

startOpen

boolean. Default value: true. Whether the collapsible section starts in the open state.

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 <problems name="p">

Scoring (7)
$p.aggregateScores

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

$p.displayDigitsForCreditAchieved

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

$p.maxNumAttempts

integer. Maximum number of times the section-wide check-work button can be submitted. Once reached, all enclosed answers are disabled.

$p.sectionWideCheckWork

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

$p.submitLabel

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

$p.submitLabelNoCorrectness

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

$p.weight

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

Other (19)
$p.asList

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

$p.boxed

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

$p.collapsible

boolean. Whether the section can be collapsed and expanded.

$p.creditAchieved

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

$p.disabled

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

$p.fixed

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

$p.fixLocation

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

$p.hidden

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

$p.includeAutoName

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

$p.includeAutoNameIfNoTitle

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

$p.includeAutoNumber

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

$p.includeAutoNumberIfNoTitle

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

$p.noAutoTitle

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

$p.numAttemptsLeft

integer. Remaining number of section-wide submissions before the maximum is reached.

$p.numSubmissions

integer. Number of times the section-wide check-work button has been submitted.

$p.open

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

$p.percentCreditAchieved

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

$p.sectionNumber

text. The displayed number for this section.

$p.title

text. The displayed title text for this section.

Common to all components (4)
$p.doenetML

text. The DoenetML source code that produced this component.

$p.hide

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

$p.isResponse

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

$p.styleNumber

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

Examples

Example: <problems> rendering its children as a list

Each nested <problem> 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 <problem> 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 <problem>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 problems as ordinary sectional blocks rather than as list items. With list rendering turned off, sibling prose (and any other children) renders normally alongside the problems.


Attribute Example: hide

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