Numeric

Description

The Numeric question type supercedes Plain Number and Dimensioned Number, giving authors the capabilities of both types along with more sophisticated means to allow tolerances in grading a student's answer.

Answers to numeric-mode questions may or may not specify units. If the system has an answer with units, it will provide separate entry cells for numbers and units. If the system has an answer with no units specified, it displays a single entry cell.

Authors should specify units as an optional argument to the \answer macro. For instance, while Dimensioned Number mode accepts

\answer{9.8 m/s^2}

as an answer, Numeric mode requires that this answer be given as

\answer[m/s^2]{9.8}.

This type should be used carefully, because the system will convert between compatible units. For instance, if the correct answer is given in meters, then the equivalent response given in terms of kilometers or feet or miles, etc., would be graded as correct. However, if a student uses an alternate unit, this will often result in an approximation because of the conversion factor (for example, expressing an answer in miles instead of kilometers would never end up being exact). Thus, it is almost imperative that the author allow some tolerance in grading these questions.

Notes

Examples

\begin{question}{Numeric}
\qutext{Compute the exact value of the function
$f(x) = 3x^4 - 2x^2 - 1$ at $x = 2.1$.}
\answer{48.5243} % exact grading
\end{question}
\begin{question}{Numeric}
\qutext{Compute the value of $\log(45)$. Round your answer
to 5 significant digits.}
\answer{1.6532} % note that this uses exact grading,
                % since \digits is not used
% In this case, a more accurate response would still be
% graded as incorrect.
\end{question}
\begin{question}{Numeric}
\qutext{Compute the value of $\log(45)$. Your answer
should be correct to an accuracy of at least 5 decimal
places.}
\answer{1.653212514}
\err{0.00001} % absolute tolerance
% Any numerical response between 1.653202514 and
% 1.653222514 would be graded as correct.
\end{question}
\begin{question}{Numeric}
% This question uses algorithmic variables.
\qutext{Compute the value of $\log(\var{a})$. Your answer
should be correct to an accuracy of at least 5 decimal
places.}
\answer{\var{log(\var{a})}}
\err{0.00001}
\code{$a = rand(1,100,4);}
% The above code chooses a random value a between 1 and
% 100, to four significant figures.
\end{question}
\begin{question}{Numeric}
\qutext{A man is on the top of a tower that is 800 feet
above ground. How far can he see?\\
\\
Use 3960 miles for the radius of the earth.\\
Express your answer to an accuracy of at least 6
significant digits.}
\answer[mi]{34.64134750325309}
\err{0.0001} % note that \digits{6} would allow no
             % tolerance, and would cause '182906 ft'
             % to be rejected.
\end{question}
\begin{question}{Numeric}
% If the ability to convert units is not an important
% part of the question, then not using units is probably
% a good decision.
\qutext{A man is on the top of a tower which is 800 feet
above ground. How far (in miles) can he see?\\
\\
Use 3960 miles for the radius of the earth.\\
Express your answer to an accuracy of at least 4 decimal
places.\\
Do NOT include any units in your answer.}
\answer{34.64134750325309}
\err{0.0001}
\end{question}
\begin{question}{Numeric}
% An algorithmic version of the previous questions.
% The height is a multiple of 50 in [400,900).
\code{$height = range(400,900,50);
      $answer = sqrt((3960 + $height/5280)^2 - 3960^2);}
\qutext{A man is on the top of a tower which is
\var{height} feet above ground. How far can he see?\\
\\
Use 3960 miles for the radius of the earth.\\
Express your answer to an accuracy of at least 6
significant digits.}
\answer[mi]{\var{answer}}
\err{2}    % Let's be nice and accept any response within
           % +/- 2
\digits{6} % at the sixth significant digit.
\end{question}