-
MathType
-
Wiris Quizzes
-
Learning Lemur
-
CalcMe
-
MathPlayer
-
Store FAQ
-
VPAT for the electronic documentation
-
MathFlow
-
BF FAQ
Comparison by rounding
Reading time: 1minAs you may have noticed, both significant figures and decimal places comparison methods use the truncation function. Conversely, you may be interested in replicating the same behaviour with the rounding function. Below you can find two alternative procedures to do so.
Using absolute error tolerance and a concrete number of decimals assertion
The first option will require combining two assertions we have previously analyzed: absolute error and a concrete number of decimals. If we want to check that the student's answer exactly has n decimal places, and these are identical to the correct answer first n decimal places after rounding, we need to set the error margin to 0.5·10-n and define the precision to n decimal places.
For instance, if the correct answer is
19.586
Student Answer | |||||
---|---|---|---|---|---|
Decimal places | 19.6 | 19.59 | 19.58 | 19.587 | 19.586 |
1 | ![]() |
![]() |
![]() |
![]() |
![]() |
2 | ![]() |
![]() |
![]() |
![]() |
![]() |
3 | ![]() |
![]() |
![]() |
![]() |
![]() |
4 | ![]() |
![]() |
![]() |
![]() |
![]() |
Using a grading function
The second option will require some programming in CalcMe through a grading function. If we want to check that the first n decimal places of the student and correct answers are identical after rounding, we need to define the following user-defined routine (for n=2).
Tip
You can see more about grading functions here.
For instance, if the correct answer is 19.586
Student Answer | |||||
---|---|---|---|---|---|
Decimal places | 19.6 | 19.59 | 19.58 | 19.587 | 19.586 |
1 | ![]() |
![]() |
![]() |
![]() |
![]() |
2 | ![]() |
![]() |
![]() |
![]() |
![]() |
3 | ![]() |
![]() |
![]() |
![]() |
![]() |
4 | ![]() |
![]() |
![]() |
![]() |
![]() |