<problem>
<problem> 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 an <problem> to group and order
content. Some examples are: another <problem>, a <section>, a <figure>, or
an <example>.
Attributes and Properties
| Attribute | Type | Values |
|---|---|---|
aggregateScores = "…" | boolean | "true" "false" |
asList = "…" | boolean | "true" "false" |
boxed = "…" | boolean | "true" "false" |
completedColor = "…" | ||
displayDigitsForCreditAchieved = "…" | integer | |
includeAutoName = "…" | boolean | "true" "false" |
includeAutoNameIfNoTitle = "…" | boolean | "true" "false" |
includeAutoNumber = "…" | boolean | "true" "false" |
includeAutoNumberIfNoTitle = "…" | boolean | "true" "false" |
includeParentNumber = "…" | boolean | "true" "false" |
inProgressColor = "…" | ||
level = "…" | ||
noAutoTitle = "…" | boolean | "true" "false" |
notStartedColor = "…" | ||
sectionWideCheckWork = "…" | boolean | "true" "false" |
showCorrectness = "…" | "true" "false" | |
submitLabel = "…" | text | |
submitLabelNoCorrectness = "…" | text | |
weight = "…" | number |
| Property | Type |
|---|---|
$p.aggregateScores | boolean |
$p.asList | boolean |
$p.boxed | boolean |
$p.creditAchieved | number |
$p.disabled | boolean |
$p.displayDigitsForCreditAchieved | integer |
$p.fixed | boolean |
$p.fixLocation | boolean |
$p.hidden | boolean |
$p.includeAutoName | boolean |
$p.includeAutoNameIfNoTitle | boolean |
$p.includeAutoNumber | boolean |
$p.includeAutoNumberIfNoTitle | boolean |
$p.includeParentNumber | boolean |
$p.noAutoTitle | boolean |
$p.open | boolean |
$p.percentCreditAchieved | number |
$p.sectionNumber | text |
$p.sectionWideCheckWork | boolean |
$p.submitLabel | text |
$p.submitLabelNoCorrectness | text |
$p.title | text |
$p.weight | number |
Example: <problem> with default title
Within a DoenetML document, default titles for sectional components are auto-numbered. Each sectional component is on the same counter.
Example: <problem> with custom title
A custom <problem> title is creating by providing a <title> tag
within the <problem>.
Example: Nesting sectional components
A hierarchy is created by nesting one or more sectional components within an <problem>.
Attribute Example: includeParentNumber
The includeParentNumber attribute is false by default for the <problem> component (and true by default for the <section> component).
In order to include the number of the parent sectional component, set includeParentNumber to true.
Attribute Example: includeAutoNumber
The includeAutoNumber attribute is false by default for the <problem> component. This means that if a problem 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 problem 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 <problem> under a single “Check Work” button.
Attribute Example: boxed
The boxed attribute changes the default formatting for a sectional component 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.