Note: Version 2.5 introduces Inline Questions, which have all the capabilities of Blanks questions, but more power and flexibility.
The Blanks blank[formula] question type generates a fill-in-the-blank question in which the answer is a formula. The text inside a \blank[formula] command is removed and a text field is displayed.
You must provide the correct answer as an argument to the macro. The answer must be written in calculator syntax, not in TeX. Enter the answer as you expect the student to enter it (although equivalent answers are graded correct).
This option is similar to the Formula question type, but is more convenient for some questions.
An advantage of the Blanks question type is that several \blank macros can be included in a single question, and different \blank options can be mixed in a single question. This makes the Blanks type powerful and flexible.
You can use blank[formula] questions to create a matrix question by setting the blank response cells in an HTML table.
If the answer is a number (that is, does not have any variables), it is recommended that you specify in the question text whether an exact response or an approximation is required. In the case of an approximation, the margin of error must be specified in your correct answer. This can be done by:
Specifying a margin of error using the ? operator
For example, if the answer field were
{2.34 ? 0.01}
any response between 2.33 and 2.35 (inclusive) would be graded correct. In other words, the number following the ? operator is the margin of error. For more information on tolerances, see Setting a Margin of Error in Non-numeric Questions.
As noted above, blanks cannot contain TeX math-mode content. Blanks must not appear in math mode. Only raw text can be used in blanks. A limited amount of error recovery exists. For example,
'$$x = \blank[formula]{sin(1)}$$'
and
'$\int_0^{\blank[formula]{sin(1)}}
f(x)\,dx$'
generate conversion errors, but
'$x
= \blank[formula]{sin(1)}$'
converts correctly. However, it is recommended
that you use a construction similar to:
'$x = {}$\blank[formula]{sin(1)}$'
\begin{question}{Blanks}
\qutext{The derivative of the function $f(x)=4x-x^3$ is
% Format: \blank[formula]{correct answer in calculator syntax}
\blank[formula]{4-3x^2}
and the second derivative is
\blank[formula]{-6x}.}
\end{question}
\begin{question}{Blanks}
\qutext{The function $1-x^2$ is positive for values of $x$ in the range
\blank[formula]{-1} $< x <$ \blank[formula]{1}.}
\end{question}
\begin{question}{Blanks}
\qutext{The maximum value of the function
$f(x)=\displaystyle\frac{x}{1+2x^2}$ is
\blank[formula]{0.353553 ? 0.0001} and the minimum value is
\blank[formula]{-0.353553 ? 0.0001}. Your answers must be correct
to at least 4 decimal places.}
\end{question}
\begin{question}{Blanks}
% This question mixes the [menu] and [formula] options.
\qutext{The graph of the function $f(x)=(x-3)^2$ is the same as the
graph of $g(x)=x^2$ shifted to the \blank[menu]{right, left}
\blank[formula]{3} units.}
\end{question}
\begin{question}{blanks}
% This question uses randomized variables.
\qutext{An earthquake that measures $\var{a}$ on the Richter scale is
\blank[formula]{\var{ans}} times more powerful than one that measures
$\var{b}$. Your answer must be exact.}
\code{
$a=rand(5,9,2);
$inc=int(rint(3)+2);
$b=$a-$inc;
$ans=int(10^$inc);
}
% The above code chooses a random value $a between 5 and 9, to two
% significant figures. $b will be 2, 3, or 4 less than $a.
\end{question}