Description
This is the most general type of math question. Answers may be any kind of formula, entered in calculator syntax. Answers may include variables and standard functions.Notes
- The
\answer
field must be in calculator syntax, not in TeX. Enter the answer as you would expect the student to enter it (although equivalent answers will be graded correctly). - If the answer is a number (i.e., does not
have any variables), then it is a good idea to specify
whether an exact answer or an approximation is expected. In
the case of an approximation, the expected accuracy must
also be specified in the question. This can be done in one
of two ways:
- specify a certain fixed number of significant digits or a certain fixed number or digits after the decimal point, or
- specify a certain minimum accuracy, and use the
?
operator to grade answers that are within that accuracy. For example, if the answer field were\answer{2.34 ? 0.01}
then any response between 2.33 and 2.35 (inclusive) would be graded as correct. In other words, the number following the?
operator is the allowed error.
Warning: This use of Formula type questions is not recommended; a much better choice is the more flexible Numeric type. However, you may still wish to use a Formula question if you do not want the response object's appearance to provide a clue to the student that the answer is numeric.
Examples
\begin{question}{Formula} \qutext{What is the derivative of $x^3+3\cos(x)-1$?} % Use calculator syntax for the answer, NOT TeX: \answer{3x^2-3*sin(x)} \end{question}
\begin{question}{Formula} \qutext{Compute the exact value of $f'(2)$ if $f(x)=x^3+3\cos(x)-1$.} \answer{12-3*sin(2)} % Any numerical approximation would be graded as incorrect. \end{question}
\begin{question}{Formula} \qutext{Compute $f'(2)$ if $f(x)=x^3+3\cos(x)-1$. Round your answer to 5 significant digits.} \answer{9.2721} % In this case, a more accurate response would still be % graded as incorrect. \end{question}
\begin{question}{Formula} \qutext{Compute $f'(2)$ if $f(x)=x^3+3\cos(x)-1$. Your answer should be correct to an accuracy of at least 5 decimal places.} \answer{9.27211 ? 0.00001} % Any response between 9.27210 and 9.27212 would be % graded as correct. % The response '12-3*sin(2)' would also be acceptable.
\begin{question}{Formula} % This question uses algorithmic variables. \qutext{Find the formula for the inverse of the function $f(x)=\var{a}x+\var{b}$.} \answer{(x-\var{b})/\var{a}} \code{$a = range(2,10); $b = range(2,10);} % The above code chooses random integer coefficients % a and b between 2 and 10. \end{question}