<pretzel>
<pretzel> is a response component that lets students match statements to answers by entering a sequence.
In the simplest case (default mode and no distractors), students can start with any problem and enter 1 in that box.
Then they find that problem’s answer and enter 2 in the box under the matching statement, continue to 3, and so on until all problems are used. The answer to the last problem should point back to the answer above the box where they started.
If the pretzel contains any distractor, neither the statement nor the answer of that box should match any other problem. In particular, a distractor’s answer should not be the correct answer to its own statement or to any other statement in the pretzel. Assuming that the student did not choose a distractor to start and did not make any mistakes, they will loop back to their initial problem without encountering any distractors. The boxes that remain are distractors and should be filled with an X. If a student starts with a distractor or enters a distractor due to a mistake, they should discover that there are no matching answers to the question. This indicates that the question is a distractor and should be marked with an X. If they arrived at that question from matching a previous answer, that should indicate to the student that they made a mistake when arriving at the previous answer.
Each <problem> in a pretzel should contain one <statement> and one <answer>.
Attributes and Properties
Attributes for <pretzel>
Answer grading (11)
colorCorrectnessboolean. Default value: true. Whether to color-code the response based on its correctness.
disableAfterCorrectboolean. Default value: false. Whether to disable the answer after a fully correct response has been submitted.
displayDigitsForCreditAchievedinteger. Default value: 3. Number of significant digits to display for the credit achieved value.
displayDigitsForResponsesinteger. Default value: 10. Number of significant digits to display when rendering numeric responses.
handGradedboolean. Default value: false. Whether this answer is graded by hand rather than automatically.
matchPartialboolean. Default value: false. Whether to award partial credit when the response is partially correct.
maxNumAttemptsinteger. Default value: Infinity. Maximum number of times the response can be submitted.
showCorrectnessboolean. Default value: true. Whether to display whether the submitted response is correct.
submitLabeltext. Default value: Check Work. Label for the submit button when correctness is shown.
submitLabelNoCorrectnesstext. Default value: Submit Response. Label for the submit button when correctness is not shown.
weightnumber. Default value: 1. Relative weight of this answer when aggregating credit across multiple answers.
Other (2)
integer. Default value: 2. Maximum number of columns when arranging child problems.
modekeyword. Arrangement mode for the child problems.
| Value | Description |
|---|---|
pretzel (default) | Interleaved arrangement where each problem's answer feeds the next and one can start with any problem. |
circuit | A variant of the pretzel where one must start with the first problem. |
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).
hideboolean. 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 <pretzel name="p">
Answer grading (9)
$p.disableAfterCorrectboolean. Whether to disable the answer after a fully correct response has been submitted.
$p.displayDigitsForCreditAchievedinteger. Number of significant digits to display for the credit achieved value.
$p.displayDigitsForResponsesinteger. Number of significant digits to display when rendering numeric responses.
$p.handGradedboolean. Whether this answer is graded by hand rather than automatically.
$p.matchPartialboolean. Whether to award partial credit when the response is partially correct.
$p.maxNumAttemptsinteger. Maximum number of times the response can be submitted.
$p.submitLabeltext. Label for the submit button when correctness is shown.
$p.submitLabelNoCorrectnesstext. Label for the submit button when correctness is not shown.
$p.weightnumber. Relative weight of this answer when aggregating credit across multiple answers.
Other (15)
$p.creditAchievednumber. The fraction of credit achieved on the most recent submission (between 0 and 1).
$p.currentResponses[ text ]. The current responses across all child problems.
$p.disabledboolean. Whether this answer is disabled and is no longer accepting submissions.
$p.fixedboolean. Whether this component's value is fixed and cannot be modified.
$p.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$p.justSubmittedboolean. Whether the most recent submission for this answer has not yet been changed.
$p.maxNumColumnsinteger. Maximum number of columns when arranging child problems.
$p.modetext. Arrangement mode for the child problems.
$p.numAttemptsLeftinteger. Remaining number of submission attempts before the maximum is reached.
$p.numProblemsinteger. The number of child problems.
$p.numSubmissionsinteger. Total number of times a response has been submitted.
$p.numSubmittedResponsesnumber. The number of responses submitted.
$p.responseHasBeenSubmittedboolean. Whether a response has ever been submitted for this answer.
$p.submittedResponses[ text ]. The most recently submitted responses.
Common to all components (4)
$p.doenetMLtext. The DoenetML source code that produced this component.
$p.hideboolean. Whether to hide this component from the rendered output.
$p.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$p.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: Basic pretzel workflow
Students may begin at any non-distractor box with 1.
In default pretzel mode, any consistent cyclic shift is accepted.
Attribute Examples
Attribute Example: <problem isDistractor>
If a problem has isDistractor, students must enter X in that box.
A distractor answer should not correctly answer its own statement or any other statement in the pretzel.
A student will enter numbers only for non-distractor problems.
Attribute Example: mode (default pretzel)
mode defaults to pretzel if omitted.
In this mode, students can start anywhere and any consistent cyclic numbering pattern is accepted.
Attribute Example: mode="circuit"
In circuit mode, the first problem is fixed in the first position.
The first input is prefilled with 1 and disabled.
In circuit mode, the first <problem> cannot be a distractor; making it a distractor will produce an error.
Attribute Example: maxNumColumns
maxNumColumns controls the maximum number of displayed columns for the pretzel layout.