Description
Similar to the Formula type, but answers may only use the standard operations+
, -
,
*
, /
, and ^
, and the
sqrt()
function. Functions such as
log()
, sin()
, etc., are not
allowed. Answers may include variables.
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 Restricted Formula type questions is not recommended; a much better choice is the more flexible Numeric type. However, you may still wish to use a Restricted 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}{Restricted Formula} \qutext{What is the exact value of $\sin(\frac{\pi}{4})$?} % Use calculator syntax for the answer, NOT TeX: \answer{1/sqrt(2)} % Note that the response 'sin(pi/4)' would be graded correct in % 'Formula' mode, but not here. \end{question}
\begin{question}{Restricted Formula} \qutext{Compute the value of $\sin(\frac{\pi}{4})$. Round your answer to 5 significant digits.} \answer{0.70711} % In this case, a more accurate response would still be graded as % incorrect. \end{question}
\begin{question}{Restricted Formula} \qutext{Compute the value of $\sin(\frac{\pi}{4})$. Your answer should be correct to an accuracy of at least 5 decimal places.} \answer{0.707107 ? 0.00001} % Any numerical response between 0.707097 and 0.707117 would be graded % as correct. \end{question}
\begin{question}{Restricted Formula} % This question uses algorithmic variables. \qutext{What is the exact value of $\sin(\frac{\var{n}\pi}{4})$?} \answer{\var{s}1/sqrt(2)} \code{$m = range(0,6); $n = int(2*$m+3); $s = switch($m,"","-","-","","","-","-");} % The above code chooses a random integer coefficient n to be an odd % number between 3 and 15. The 'switch' statement picks the correct % sign of the answer. \end{question}