\documentclass{article}
\usepackage{amsmath}
\usepackage[tight,dvipsone,designi,nodirectory]{web}
\usepackage{exerquiz}
\usepackage[indefIntegral,ImplMulti]{dljslib}

\pdfstringdefDisableCommands{\let\!\empty}
\pdfstringdefDisableCommands{\let\\\empty}


\title{The Acro\!\TeX{} Bundle\\ Math Fill-in: Multivariate Questions}
\author{D. P. Story}
\subject{Demo of Multivariate Processing by the AcroTeX Bundle}
\keywords{LaTeX, PDF, derivative, calculus, JavaScript}

\university{THE UNIVERSITY OF AKRON\\
Theoretical and Applied Mathematics}
\email{dpstory@uakron.edu}
\version{3.0} \copyrightyears{1999-2001}

\makeatletter
\let\web@copyright=\@gobble
\makeatother

\newenvironment{sverbatim}
{\endgraf\footnotesize\verbatim}{\endverbatim\endgraf\noindent}
\newcommand{\cs}[1]{\texttt{\char`\\#1}}

\newcommand\redpoint{\par\ifdim\lastskip>0pt\relax\vskip-\lastskip\fi
\vskip\medskipamount\noindent
  \makebox[\parindent][l]{\large\color{red}$\blacktriangleright$}}

\renewcommand\hproportionwebtitle{.8}

\begin{document}

\maketitle

\begin{shortquiz}[answer] Answer each of the following. Passing is 100\%.

\begin{questions}

\item $\dfrac{\partial}{\partial x} {4 x^2 y^3 }
    = \RespBoxMath{8*x*y^3}(xy){2}{.0001}{[0,1]x[0,1]&[-2,-1]x[-2,-1]}$\hfill
\CorrAnsButton{8*x*y^3}\kern1bp\sqTallyBox

\item $\dfrac{\partial}{\partial y} {4 x^2 y^3 }
    = \RespBoxMath{12*x^2*y^2}(xy){4}{.0001}{[0,1]x[0,1]}$\hfill
\CorrAnsButton{12*x^2*y^2}\kern1bp\sqTallyBox

\item $\dfrac{\partial^2}{\partial xy} {4 x^2 y^3 }
    = \RespBoxMath{24*x*y^2}(xy){4}{.0001}{[0,1]x[0,1]}$\hfill
\CorrAnsButton{24*x*y^2}\kern1bp\sqTallyBox

\item $\dfrac{\partial}{\partial z} {x\sin(yz^3) }
    = \RespBoxMath{3*x*y*z^2*cos(y*z^3)}(xyz){4}{.0001}{[0,1]x[0,1]x[0,1]}$\hfill
\CorrAnsButton{3*x*y*z^2*cos(y*z^3)}\kern1bp\sqTallyBox

\item $\displaystyle\int 4x^2y^3\,dy
    = \RespBoxMath{x^2*y^4}(xy){4}{.0001}{[0,1]x[0,1]}[indefCompare]$\hfill
\CorrAnsButton{x^2*y^4}\kern1bp\sqTallyBox

\end{questions}
\end{shortquiz}
\begin{flushright}
\sqClearButton\kern1bp\sqTallyTotal
\end{flushright}


Let's take a look at the first question in detail, but first, recall
the specification of the \cs{RespBoxMath} command. The
\cs{RespBoxMath} has ten parameters that can be used to
modify the default behavior of processing the user's input. Here
is the syntax:
\begin{verbatim}
\RespBoxMath[#1]#2(#3)[#4]#5#6#7#8[#9]*#10
\end{verbatim}
\noindent\textbf{Parameters:}
\begin{description}
 \item[\ttfamily\#1:] Optional parameter used to modify the appearance of the
     text field.
 \item[\ttfamily\#2:] The correct answer to the question.
     This must be a numerical value, or a function of one variable.
     JavaScript Note:
     In JavaScript, functions such as \texttt{sin(x)} and \texttt{cos(x)} are
     methods of the \texttt{Math} object.  It is not necessary, however, to
     type \texttt{Math.sin(x)} or \texttt{Math.cos(x)}; this is done by inserting
     the expression into a \texttt{with(Math)} group.
 \item[\ttfamily\#3:] An optional parameter, \textit{delimited by parentheses},
 that defines the independent variable; \texttt{x}, is the default value. Note
 that this parameter is set off by parentheses.  For a multivariate question, just
 list the variables in juxtaposition, \texttt{(xyz)}.
 \item[\ttfamily\#4:] Optional, a named destination to the solution to the
 question. If this parameter appears, then a solution must follow the
 question, enclosed in a \texttt{solution} environment.
 \item[\ttfamily\#5:] The number of samples points to be used, usually $3$ or $4$ is
 sufficient.
 \item[\ttfamily\#6:] Precision required, the $\epsilon$ value, if you will.
 \item[\ttfamily\#7:] Parameters \texttt{\#7} and \texttt{\#8} are  used to define the interval from
 which to draw the sample points. There are two forms: (1) \texttt{\#7} is the left-hand endpoint
 of the interval and \texttt{\#8} is the right-hand endpoint (the use of \texttt{\#7} and \texttt{\#8} in this form
 is deprecated); (2) the interval is defined by standard interval notation, \texttt{[a,b]}.
 For a multivariate question---one where parameter \texttt{\#2} lists more than one variable,
 separate the intervals for each variable by a `x', \texttt{[0,2]x[1,2]x[3,4]}. Here, `x' stands
 for the Cartesian Product.
 \item[\ttfamily\#8:] (1) Parameter \texttt{\#8} is the right-hand endpoint of the interval (the use of this
 parameter is deprecated); (2) in the second case, \texttt{\#8} is not used.
 \item[\ttfamily\#9:] This optional parameter is the name of a customized
 comparison function.
 \item[\ttfamily\#10:] (Only detected if following an asterisk, `\texttt*')
 The name of a JavaScript function that is to be used to process the user input.
\end{description}


\redpoint Discussion of the first question:
\begin{sverbatim}
$\dfrac{\partial}{\partial x}{4 x^2 y^3 }
    =\RespBoxMath{8*x*y^3}(xy){2}{.0001}{[0,1]x[0,1]&[-2,-1]x[-2,-1]}$
\end{sverbatim}
Following \cs{RespBoxMath} comes the correct answer (parameter
\texttt{\#2}). Next comes \texttt{(xy)} (parameter \texttt{\#3}),
which specifies that the question is a function of two variables
$x$ and $y$. This question has no solution associated so there is
the no optional parameter \texttt{\#4} listed. Now
comes the number of sample points (parameter \texttt{\#5}) specified as $2$, followed by the
precision of $.0001$, parameter \texttt{\#6}.  Finally comes the regions
from which we are to sample our points, parameter \texttt{\#7}.
Here, we specified the regions to be \texttt{[0,1]x[0,1]\&[-2,-1]x[-2,-1]}.

The above parameters specifies that we must randomly choose two points $(x,y)$ from
the rectangle $[0,1]\times[0,1]$ \textit{and} randomly choose two points $(x,y)$ from
the rectangle $[-2,-1]\times[-2,-1]$. This then actually produces four points.



\end{document}
