Referencepretzel

<pretzel>

A response-matching component where students enter a sequence to match statements and answers

<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)
colorCorrectness

boolean. Default value: true. Whether to color-code the response based on its correctness.

disableAfterCorrect

boolean. Default value: false. Whether to disable the answer after a fully correct response has been submitted.

displayDigitsForCreditAchieved

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

displayDigitsForResponses

integer. Default value: 10. Number of significant digits to display when rendering numeric responses.

handGraded

boolean. Default value: false. Whether this answer is graded by hand rather than automatically.

matchPartial

boolean. Default value: false. Whether to award partial credit when the response is partially correct.

maxNumAttempts

integer. Default value: Infinity. Maximum number of times the response can be submitted.

showCorrectness

boolean. Default value: true. Whether to display whether the submitted response is correct.

submitLabel

text. Default value: Check Work. Label for the submit button when correctness is shown.

submitLabelNoCorrectness

text. Default value: Submit Response. Label for the submit button when correctness is not shown.

weight

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

mode

keyword. Arrangement mode for the child problems.

ValueDescription
pretzel (default)Interleaved arrangement where each problem's answer feeds the next and one can start with any problem.
circuitA variant of the pretzel where one must start with the first problem.
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).

hide

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

Answer grading (9)
$p.disableAfterCorrect

boolean. Whether to disable the answer after a fully correct response has been submitted.

$p.displayDigitsForCreditAchieved

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

$p.displayDigitsForResponses

integer. Number of significant digits to display when rendering numeric responses.

$p.handGraded

boolean. Whether this answer is graded by hand rather than automatically.

$p.matchPartial

boolean. Whether to award partial credit when the response is partially correct.

$p.maxNumAttempts

integer. Maximum number of times the response can be submitted.

$p.submitLabel

text. Label for the submit button when correctness is shown.

$p.submitLabelNoCorrectness

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

$p.weight

number. Relative weight of this answer when aggregating credit across multiple answers.

Other (15)
$p.creditAchieved

number. 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.disabled

boolean. Whether this answer is disabled and is no longer accepting submissions.

$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.justSubmitted

boolean. Whether the most recent submission for this answer has not yet been changed.

$p.maxNumColumns

integer. Maximum number of columns when arranging child problems.

$p.mode

text. Arrangement mode for the child problems.

$p.numAttemptsLeft

integer. Remaining number of submission attempts before the maximum is reached.

$p.numProblems

integer. The number of child problems.

$p.numSubmissions

integer. Total number of times a response has been submitted.

$p.numSubmittedResponses

number. The number of responses submitted.

$p.responseHasBeenSubmitted

boolean. Whether a response has ever been submitted for this answer.

$p.submittedResponses

[ text ]. The most recently submitted responses.

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