ReferenceorbitalDiagramInput

<orbitalDiagramInput/>

An interactive widget where students fill in an orbital diagram by adding boxes, rows, and up/down arrows (block-level; does not inherit from Input)

<orbitalDiagramInput/> is a Subject-Specific component that renders an interactive tool for student entry of orbital diagrams.

Attributes and Properties

Attributes for <orbitalDiagramInput>

Other (2)

orbitalDiagram. An orbital diagram used to prefill the input before the student begins.

textList. Text labels to prefill for each orbital row.

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 <orbitalDiagramInput name="o">

Other (9)
$o.disabled

boolean. Whether this component is disabled and cannot be interacted with.

$o.fixed

boolean. Whether this component's value is fixed and cannot be modified.

$o.fixLocation

boolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

$o.hidden

boolean. Whether this component is hidden from the rendered output.

integer. The number of orbital rows in the diagram.

$o.rows

orbitalDiagram. The orbital diagram rows in display order (reversed from the underlying value).

integer. Index of the currently selected box within the selected row (1-based; 0 if none selected).

$o.selectedRowIndex

integer. Index of the currently selected orbital row (1-based; 0 if none selected).

orbitalDiagram. The current orbital diagram entered by the student.

Common to all components (4)
$o.doenetML

text. The DoenetML source code that produced this component.

$o.hide

boolean. Whether to hide this component from the rendered output.

$o.isResponse

boolean. Whether this component is treated as a response for the purposes of assessment.

$o.styleNumber

integer. The style number used to select this component's visual styling from the available style definitions.

Examples

Example: Default <orbitalDiagramInput/>

The default <orbitalDiagramInput/> contains one row with an empty label. Students complete the diagram by typing in the correct sublevel into the label, and using the buttons to add “box” entry fields and arrows to complete the diagram. Additional rows are also added/removed with the buttons shown above the diagram. Check the solution provided and experiment with the buttons to get a feel for how the tool behaves.

Attribute Examples

Attribute Example: prefill

The prefill attribute of the <orbitalDiagramInput/> component takes as its input either (1) an array of arrow directions listed by row or (2) the orbitalDiagram property of a named <atom> component. The first input method is illustrated above.

To enter the array of arrow directions, use “u” for an up arrow and “d” for a down arrow. Each row is listed in distinct parentheses. To prefill empty boxes, you can include comma-separated spaces within a row.


Attribute Example: prefill (2nd method)

The prefill attribute of the <orbitalDiagramInput/> component takes as its input either (1) an array of arrow directions listed by row or (2) the orbitalDiagram property of a named <atom> component. The second input method is illustrated above.


Attribute Example: prefillLabel

The prefillLabel attribute can be used to specify a prefill of the labels for each row of the <orbitalDiagramInput/>. The input for this attribute is a list of text labels, beginning with the label for the bottom row.

Property Examples

Property Example: value

The value property of the <orbitalDiagramInput/> returns a static copy of the user’s entered diagram values that is updated with each click interaction.


Property Example: rows

The rows property of the <orbitalDiagramInput/> returns the row values entered in the user’s diagram, rearranged such that the most recently entered rows appear on the bottom of the diagram and the first row entered appears on the top of the diagram.


Property Example: numRows

The numRows property of the <orbitalDiagramInput/> returns the number of rows entered into the diagram by the user.


Property Example: selectedBoxIndex

The selectedBoxIndex property of the <orbitalDiagramInput/> returns the index number of the diagram box of the active row (numbered from left to right) that is currently highlighted by the user.