Annotation of loncom/html/adm/help/tex/Tolerance.tex, revision 1.6

1.2       bowersj2    1: \label{Tolerance}
1.1       bowersj2    2: A \textbf{tolerance\index{tolerance}} parameter determines how closely
1.5       lira        3: the system will require the student's answer to be in order to count it correct.
                      4: The tolerance will default to zero if it is not defined.
                      5: The tolerance parameter should always be defined for a numerical problem 
                      6: unless you are certain only integer answers are generated from your script and 
                      7: you want students to reply with exactly that integer.
1.1       bowersj2    8: 
1.5       lira        9: If the computer answer is a floating point number, the tolerance should not 
                     10: be zero. Computers can only approximate computations involving real numbers. For instance,
1.1       bowersj2   11: a computer's {[}decimal{]} answer to the simple problem $\frac{1}{3}$ is
                     12: {}``0.33333333333333331''. It \emph{should} be an infinite series of 3's,
                     13: and there certainly shouldn't be a {}``1'' in the answer, but no computer
                     14: can represent an infinitely long, infinitely detailed real number. Therefore,
1.5       lira       15: for any problem where the answer is not an integer, you \emph{need}
1.1       bowersj2   16: to allow a tolerance factor, or the students will find it nearly impossible
1.5       lira       17: to exactly match the computer's idea of the answer. You may find the
                     18: default tolerance too large for some problems, so adjust as appropriate. 
1.1       bowersj2   19: 
1.5       lira       20: There are three kinds of tolerance. For some answer $A$ and a tolerance $T$,
1.1       bowersj2   21: 
                     22: \begin{enumerate}
                     23: \item an \textbf{Absolute} tolerance\index{absolute tolerance}\index{tolerance, absolute}
1.3       albertel   24: will take anything in the range $A\pm T$. So if $A=10$ and $T=2$, then
1.1       bowersj2   25: anything between 8 and 12 is acceptable.
                     26:  Any number in the tolerance field \emph{without} a \textbf{\%} symbol is
                     27: an absolute tolerance.
                     28: \item a \textbf{Relative} tolerance\index{relative tolerance}\index{tolerance, relative}
1.3       albertel   29: will take anything in the range $A\pm aT$, where \emph{T} is interpreted
                     30: as a percentage/100. Any number in the tolerance field \emph{followed by} a \textbf{\%}
1.1       bowersj2   31: symbol is a relative tolerance. For example, $a=10$ and $t=10\%$ will accept
                     32: anything between 9 and 11. 
1.3       albertel   33: 
                     34: \item a tolerance that is a calculated variable (identified by \$ sign as
                     35: the first character). For example, if an answer is $\$X$,and for a student
                     36: possible values range from $-\$X1$ to $+\$X1$, you could choose $T =
                     37: \$tolerance = \$2X1/100;$ acceptable answers would then be from
                     38: $\$X-\$tolerance$ to $\$X+\$tolerance$. (This is especially useful when answers
                     39: close to zero are possible for some students)
                     40: 
                     41: \end{enumerate}
1.5       lira       42: 
                     43: Some care is necessary when setting the display format of the computer answer. 
                     44: Before testing the tolerance, LON-CAPA converts the computer answer,
                     45: as generated in the script block, according to the
                     46: format attribute in the numericalresponse tag.
                     47: 
1.6     ! raeburn    48: Next, the formatted comptuer answer is "graded" relative to the significant 
1.5       lira       49: figures parameter, if it is set (see section \ref{Significant_Figures}. 
                     50: If that test was passed, then a numerical comparison of the Computer's
                     51: answer is made with the range of values:
                     52: 
1.6     ! raeburn    53: (\$computerAnswer - \$tolerance) $<$ \$formattedcomputerAnswer $<$
1.5       lira       54: (\$computerAnswer + \$tolerance)
                     55: 
                     56: If the \$formattedcomputerAnswer satisfies the permitted range, then
                     57: "correct" is returned for the computer answer. It is good idea to test multiple
                     58: randomizations to make sure that your tolerance is compatible with the display format.
                     59: 
                     60: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>