Check Decimal Places in Numerical Questions

You can require your students to specify a certain number of decimal places in their response by setting the $DECFIGS variable in Answer.

If you check decimal places, you might want to award partial credit for responses that use the correct number of decimal places even if the student's calculation is not correct. See Significant Figure Checking for Assignments.

When your question checks decimal places, the default tolerance for the question is ±1 at the last digit. For example, if the answer is 1.33 to 2 decimal places, the responses 1.32, 1.33, and 1.34 would all be accepted.

By default, answer format tips tell your students whether decimal places are checked. You can hide answer format tips for your assignments.

  1. In Answer, type the following code before the correct numerical answer:
    <EQN $DECFIGS=n; ''>
    where n represents the nearest decimal value to which the answer should be specified, such as 10, 1, 0.1, 0.01, 0.001, or 0.0001.
    Important Always set $DECFIGS to a power of 10. You can use e notation, such as 1e2.
  2. Type the correct answer on the same line.
    Ensure that your answer is specified to the correct number of decimal places. If it is not, it will be rounded to the correct number of decimal places and the tolerance will be based on the rounded answer.

Example Numerical Question With Decimal Place Checking

The following table summarizes an actual question.

QID

1159495

Name

Template2 2.NUM.04.

Mode

Numerical

Question

Write the quotient of 3 and 7 to 5 decimal places.<br>
<_>

Answer

<EQN $DECFIGS=0.00001; 3/7>

Display to Students

Question as displayed to students