\digits
\err
\percenterr

Description

These three macros control the type of grading in Numeric questions.

Syntax

\digits{sig-digits}
sig-digits
The number of significant digits to be considered in grading.
\err{tolerance}
tolerance
The (absolute) error allowed in the student's response.
\percenterr{tolerance}
tolerance
The percentage error allowed in the student's response.

The types of grading

Exact value

The student's answer must match the value given in the \answer field. There is no error tolerance.

If none of \digits , \err , or \percenterr are present, the grading type is set to 'exact value'.

Exact significant digits

The student's answer must agree with the value given in the \answer field to a specified number of significant digits.

To use this grader, use \digits alone to specify the required number of significant digits. For instance, using only \digits{3} with \answer{2.5} allows only 2.50 as a correct response.

Significant digits with tolerance

The student's answer must agree with the value given in the \answer field to within a specified tolerance at a given number of significant digits.

To use this grader, use \digits to specify the number of significant digits, together with \err to specify the tolerance allowed at that number of digits. For example, using \err{2} and \digits{3}, with \answer{2.5}, allows any answer between 2.48 and 2.52 to be accepted (tolerance of 2 at the third significant digit).

Absolute tolerance

The student's answer must agree with the value given in the \answer field to within a specified (absolute) tolerance.

To use this grader, use \err alone to set the allowed tolerance. For example, using \err{0.25} with \answer{2.5} allows any response between 2.25 and 2.75 to be accepted.

Relative tolerance

The student's answer must agree with the value given in the \answer field to within a specified percent error.

To use this grader, use \percenterr to specify the allowed percentage tolerance. \percenterr may not be used with either \digits or \err . For example, using \percenterr{5} with \answer{2.5} allows any response between 2.5 × 0.95 and 2.5 × 1.05 to be accepted.