Perl Variables for Numerical Questions

The following reserved Perl variables are used to return information or set behaviors in questions that you create in WebAssign.

Variable

Description

$DECFIGS

Sets the required decimal places, for example, $DECFIGS=100 or $DECFIGS=0.01.

$SIGFIGS

Sets the required number of significant figures as a positive integer, for example, $SIGFIGS=3.

$NO_SIGFIGS_HINT

Hides the significant figures help icon/link.

$FRACTION

Set $FRACTION=1 to require students to perform computations and accept only exact answers as integers, decimals, fractions, or mixed numerals.

$PROPERFRACTION

Set $PROPERFRACTION=1 to require students to perform computations and accept only exact answers as integers or reduced fractions.

$SIMPLIFIED

Set $SIMPLIFIED=1 to require students to perform computations. Otherwise, students can enter either 5 or 2+3. Students can specify proper or improper fractions, for example, 10/2.

$size

Sets the width of the answer box, for example, $size=20.

$thisnum

Returns numerical value from student's response to numerical with units question.

Important Changing the value of this variable can cause your student's answer to be graded incorrectly.
$thisunit

Returns unit from student's response to numerical with units question.

Important Changing the value of this variable can cause your student's answer to be graded incorrectly.
$TOL

Sets asymmetrical tolerances. For example:

$TOL={min => 0, max => 4}
$LABEL

For answer-dependent questions, set $LABEL to a unique identifier for each answer box that is used as a dependency for another answer box.

$LINK

For answer-dependent questions, set $LINK to define the dependencies of the current answer box by referencing the labels of other answer boxes.