\documentclass{article}
\usepackage{amsmath}
\usepackage
    [tight,
%     forpaper,
     dvipsone, % <- replace with: dvipsone, dvips, pdftex, dvipdfm
     designi,
     nodirectory,
    ]{web}
\usepackage{exerquiz}
\usepackage[ImplMulti]{dljslib}

\title{Exerquiz Package\texorpdfstring{\\}{}Quizzes with Points}
\author{D. P. Story}\subject{Sample file}
\keywords{LaTeX, PDF, derivative, calculus, JavaScript}

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

\makeatletter
\let\web@copyright=\@gobble
%\def\eq@F{0}                           % make text fields and buttons visible, but not printiable
\makeatother

% Here, we change the character of the quiz depending on whether we are compiling for the
% screen or for print.
\ifeqforpaper
    \useBeginQuizLink\useEndQuizLink   % use links for Begin Quiz and End Quiz
    \quiztype{l}                       % use links to designate alternatives
\else
    \useBeginQuizButton[\BC{}\textColor{1 0 0 rg}\CA{Start}\RC{}\AC{}] % use buttons
    \useEndQuizButton[\BC{}\textColor{1 0 0 rg}\CA{End}\RC{}\AC{}]
    \quiztype{f}                       % use check boxes
\fi

% This macro, when placed prior to a quiz will cause the quiz environment to obey
% its first optional parameter (a * or no *, form or link)
%\defaultquiztype

% Uncomment this line to require the student
% to answer all questions in the quiz before
% the quiz is evaluated.
%\renewcommand\minQuizResp{highThreshold}

\font\hv=cmtt10 \def\hvperk{\char`^}
%\font\hv=hv at 9pt \def\hvperk{\char142 }
{\catcode`\^=\active
\gdef\js{\bgroup\hv\catcode`\^=\active \let^=\hvperk \jsi}
}\def\jsi#1{#1\egroup}

%\everyqCheckBox{\BC{1 0 0}\BG{0.98 0.92 0.73}}
\everyqRadioButton{\BG{0.98 0.92 0.73}}
\everyeqTextField{\BG{0.98 0.92 0.73}}

\begin{document}

\maketitle
%\tableofcontents

\section{Quiz Environment}\label{s:quiz}

\NoPeeking % or put in preamble
\PTsHook{($\eqPTs^{\text{pts}}$)}

\begin{quiz}*{mathquiz} Answer each of the following. Passing
is 100\%.\hfill\smash{\GradeField[\rectH{30bp}\rectW{30bp}\textSize{0}]\currQuiz}

%\previewtrue

\begin{questions}

\item\PTs{6} If $\lim_{x\to a} f(x) = f(a)$, then we say that $f$
is\dots
\begin{answers}[cont]{3}
\bChoices
    \Ans0 differentiable\eAns
    \Ans1 continuous\eAns
    \Ans0 integrable\eAns
\eChoices
%\Ans0 differentiable &\Ans1 continuous &\Ans0 integrable
\end{answers}
\begin{solution}
A function $f$ is said to be continuous at $x=a$ if $x\in\operatorname{Dom}(f)$,
$\lim_{x\to a} f(x) $ exists and $\lim_{x\to a} f(x) = f(a)$.
\end{solution}


\item\PTs{6} Name \emph{one} of the two people recognized as a founder of
Calculus.
\RespBoxTxt{0}{0}[calc]{4}{Isaac Newton}{Newton}{Gottfried Leibniz}{Leibniz}%
\CorrAnsButton{Isaac Newton or Gottfried Leibniz}
\begin{solution}
Isaac Newton and Gottfried Leibniz are the co-creators of Calculus.
\end{solution}


\item\PTs{8} $\dfrac{\text{d}}{\text{d}x} e^{x^2} = $\ \RespBoxMath{2*x*e^(x^2)}[diffexp]{4}{.0001}01
\CorrAnsButton{2*x*e^(x^2)}
\begin{solution}
First apply the rule for differentiating an the natural exponential, then apply
the power rule:
\begin{align*}
        \dfrac d{dx}\,e^{x^2} &
           = e^{x^2}\,\dfrac d{dx}\,x^2 \\&
           = e^{x^2}\,(2x) \\&
           = 2x e^{x^2}
\end{align*}
In the syntax of this document, \js{2*x*e^(x^2)}.
\end{solution}



%\item Sketch the biography of Isaac Newton:
%\par\RespBoxEssay[\rectH{3\baselineskip}]\par\smallskip
%
\end{questions}
\end{quiz}\quad\ScoreField\currQuiz\eqButton\currQuiz

\noindent
Answers: \AnswerField\currQuiz

\medskip\noindent
Points: \PointsField\currQuiz\ Percent: \PercentField\currQuiz

% Letter Grade: \GradeField\currQuiz
\end{document}
