Code a Question in Default Mode

In default mode, the following syntax is used in the answer field.

range:[-1,1]; (-0.75,0.25]
Note A semicolon is necessary to delimit multiple elements.

The following table shows the display attributes that you can specify.

Attribute

Syntax

Description

Default Value

range
range:[lower_bound,
upper_bound]

Indicates the desired minimum range. If the tickmarks attribute is specified, the range attribute is ignored.

[-5,5]

tickmarks
tickmarks:[lower_bound,
increment,upper_bound]

Indicates the lower bound (lower_bound) and upper bound (upper_bound) of the labeled tickmarks, as well as the tickmark interval size (increment) desired.

Calculated by the NumberLine tool

minor_tickmarks
minor_tickmarks:[false]

Indicates whether to display unlabeled tickmarks. Valid values are true or false.

true

Note
  • If an answer extends beyond the right side of the Answer box, it is wrapped to the next line, but it is still considered a single line so long as you do not press ENTER.

If no values are specified for the range attribute, the tool defaults to a range value of [-5,5]. For the range attribute and for the tickmarks attributes, the range or the interval size between tickmarks is determined automatically. The tool will attempt to use the specified range or interval size; however, if the specified range or interval size returns no usable images for the number line graph, the tool determines an appropriate range or interval size. If the tickmarks attribute is specified, a range attribute is unnecessary and is ignored. If the value of minor_tickmarks is not set to false, the tool populates as many minor tickmarks as possible.

Examples

The following tables show a few coding examples.

Code

range:[-1,1]; (-0.75,0.25]

Description

  • The range is from -1 to 1.
  • The answer key is (-0.75,0.25].

Displayed to Students

Example of a NumberLine question as it is displayed to students

Code

range:[-8,8]; minor_tickmarks:[false]; -3;0;3;6

Description

  • The requested range is from -8 to 8.
  • minor_tickmarks is set to false, so no minor, that is, unlabeled, tickmarks are displayed. In this example, since no minor tickmarks would be displayed by default given a range of [-8,8], it is not necessary to specify this attribute.
  • The answer key is -3;0;3;6.

Displayed to Students

Example of a NumberLine question as it is displayed to students

Code

range:[-8,9];[-2,2]

Description

  • The requested range is from -8 to 9. The tool determines that for an optimum student user experience, the range needs to be extended to [-8,12].
  • The answer key is [-2,2].

Displayed to Students

Example of a NumberLine question as it is displayed to students