<activity>
<activity> is a Sectional
component that renders a scored block of content (like
<problem> or <exercise>), with
score aggregation for any nested <answer> components turned on
by default.
Attributes and Properties
Attributes for <activity>
Scoring (9)
aggregateScoresboolean. Default value: true. 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.
forceIndividualAnswerColoringboolean. 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 (13)
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.
includeAutoNumberboolean. 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.
includeParentNumberboolean. Default value: false. 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.
isDistractorboolean. Whether this section is a distractor (e.g. a wrong-answer choice for matching).
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 <activity name="a">
Scoring (6)
$a.aggregateScoresboolean. Whether scores of scored descendants are aggregated into this section's credit value.
$a.displayDigitsForCreditAchievedinteger. Number of significant digits to display for the section's credit achieved value.
$a.sectionWideCheckWorkboolean. Whether to show a single section-wide check-work button instead of per-answer buttons.
$a.submitLabeltext. Label for the section-wide submit button when correctness is shown.
$a.submitLabelNoCorrectnesstext. Label for the section-wide submit button when correctness is not shown.
$a.weightnumber. Relative weight of this section when aggregated by an enclosing scored section.
Other (17)
$a.asListboolean. Whether to render this section's children as a list.
$a.boxedboolean. Whether this section is rendered with a visible box around it.
$a.creditAchievednumber. Aggregate credit achieved (between 0 and 1) for scored descendants of this section.
$a.disabledboolean. Whether this component is disabled and cannot be interacted with.
$a.fixedboolean. Whether this component's value is fixed and cannot be modified.
$a.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$a.includeAutoNameboolean. Whether to include the auto-generated section name (e.g. "Section") in the rendered title.
$a.includeAutoNameIfNoTitleboolean. Whether to include the auto-generated name when no explicit title is provided.
$a.includeAutoNumberboolean. Whether to include the auto-generated section number in the rendered title.
$a.includeAutoNumberIfNoTitleboolean. Whether to include the auto-generated number when no explicit title is provided.
$a.includeParentNumberboolean. Whether to prefix this section's number with the parent section's number.
$a.noAutoTitleboolean. Whether to suppress the auto-generated title entirely.
$a.openboolean. Whether this section is currently open (for collapsible sections).
$a.percentCreditAchievednumber. Aggregate credit achieved as a percentage (between 0 and 100).
$a.sectionNumbertext. The displayed number for this section.
$a.titletext. The displayed title text for this section.
Common to all components (4)
$a.doenetMLtext. The DoenetML source code that produced this component.
$a.hideboolean. Whether to hide this component from the rendered output.
$a.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$a.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: <activity> with default title
When <activity> has no <title>, an auto-generated title
(e.g. Activity 1) is rendered. Each <activity> is counted on
the same sectional counter as its siblings.
Example: <activity> with custom title
A custom <activity> title is provided by nesting a
<title> component.
Attribute Examples
Attribute Example: sectionWideCheckWork
The sectionWideCheckWork attribute combines validation for all
<answer> components within the <activity> under a single
“Check Work” button.
Attribute Example: boxed
The boxed attribute changes the default formatting to a border with
a shaded title banner.
Attribute Example: hide
The hide attribute takes a boolean as input and can be used with any rendered component.