Referenceproblem

<problem>

A sectional component that defines a scored problem

<problem> is a Sectional component that renders a scored, titled block of content. If no <title> is provided, an auto-generated title (e.g. Problem 1) is rendered. Inline components such as paragraphs (<p>) and other components can be nested within a <problem> to group and order content. Some examples are: another <problem>, a <section>, a <figure>, or an <example>.

Attributes and Properties

Attributes for <problem>

Scoring (9)
aggregateScores

boolean. Default value: true. 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.

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.

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 (13)
asList

boolean. 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.

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.

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.

boolean. Default value: false. Whether to prefix this section's number with the parent section's number.

inProgressColor

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

isDistractor

boolean. Whether this section is a distractor (e.g. a wrong-answer choice for matching).

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.

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

Scoring (6)
$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 section's credit achieved value.

$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 (17)
$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.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.includeParentNumber

boolean. Whether to prefix this section's number with the parent section's number.

$p.noAutoTitle

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

$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: <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 Examples

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

The sectionWideCheckWork attribute combines validation for all <answer> components within the <problem> 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 problem (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 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.