summaryrefslogtreecommitdiff
path: root/texmf-dist/source/latex/eq2db/examples/FDF_submit/quiz1.tex
blob: 06bbaed4cc7358dc77eb2472665449d4b6210dae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
%
% D. P. Story  dpstory@uakron.edu
% The University of Akron
%
% Demo of using web/exerquiz to create a quiz, then process the
% user's responses using the Adobe FDF Toolkit.
%
\documentclass{article}
\usepackage{amsmath}
\usepackage[designi]{web} % dvips, pdftex, dvipsone, dvipdfm
\usepackage{exerquiz}
\usepackage[ImplMulti,indefIntegral]{dljslib}
\usepackage[eqRecord,tagged]{eq2db}

\everyTextField{\BC{}\textFont{TiRo}\textSize{10}\textColor{0 0 1}}

%\def\DSN{eqQuiz}
\def\DSN{PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE = c:/Inetpub/DB/eqQuiz.mdb;} %USER ID=;PASSWORD=;
\def\pathiiDB{/C/Inetpub/DB/eqQuiz.mdb}

% \begin{insDLJS}[servePDF]{servePDF}{Serve PDF}
% var servePDF = true;
% var f = this.getField("UserValid");
% if ( !f.value && this.external )
% {
%     app.alert("You are not authorized to view this PDF.");
%     this.getURL("http://www.math.uakron.edu/~dpstory/tutorial/online/index.html",false);
% }
% \end{insDLJS}

% \begin{execJS}{execjs}
% app.execMenuItem("Save");
% \end{execJS}

\useBeginQuizButton[\textColor{0 0 1}\CA{Begin}\AC{}\RC{}\rectW{}]
\useEndQuizButton[\textColor{0 0 1}\CA{End}\AC{}\RC{}\rectW{}]

% Design the "Quiz": Have the user enter his/her name and SSN (and perhaps
% other data to identify the class.

% User's First Name
\newcommand\FirstName[2]{\textField{IdInfo.Name.First}{#1}{#2}} %\V{First Name}

% User's Last Name
\newcommand\LastName[2]{\textField{IdInfo.Name.Last}{#1}{#2}} %\V{Last Name}%

% User's SSN
\newcommand\SSN[2]{\textField[\MaxLen{11}
    \AA{\AAKeystroke{AFSpecial_Keystroke(3);}
        \AAFormat{AFSpecial_Format(3);}
    }]{IdInfo.SSN}{#1}{#2}}

\begin{document}
\thispagestyle{empty}

\begin{flushleft}
Quiz \#1 \hfill \underbar{First Name:\ \FirstName{100pt}{10pt}}\par
D. P. Story \hfill\underbar{\rlap{Last Name:}\phantom{First Name:}\ \LastName{100pt}{10pt}}\par
Math 101 \hfill \rlap{SSN:}\phantom{First Name:}\ \SSN{100pt}{10pt}
\end{flushleft}

\newpage

% Submit this quiz to the ASP, and save it in the Database eqQuiz,
% within eqQuiz, there is a table called Quiz1.
\eqSubmit{http://localhost/scripts/eqRecord.asp\#FDF}{\DSN}{Math101}

\addHiddenTextField{UserValid}{false}

\begin{quiz}*{Quiz1} Answer each of the following. Passing
is 100\%.

\begin{questions}

\item Name \emph{one} of the two people recognized as a founder of
Calculus.\par%\kern2pt
\RespBoxTxt{0}{0}{5}{Isaac Newton}{Newton}{I. Newton}%
{Gottfried Leibniz}{Leibniz}%
\CorrAnsButton{Isaac Newton or Gottfried Leibniz}

\item $\displaystyle\frac{d}{dx} e^{x^2}=\RespBoxMath{2*x*e^(x^2)}{4}{.0001}01 %\hfill
\CorrAnsButton{2*x*e^(x^2)}$%\kern1bp\sqTallyBox

\item $\cos(\pi) = \RespBoxMath{-1}{1}{.0001}24\CorrAnsButton{-1}$

\item $\displaystyle\int \sin(x)\,dx =
\RespBoxMath{-cos(x)}{4}{.0001}01[indefCompare]\CorrAnsButton{-cos(x)}$
\end{questions}
\end{quiz}\quad\ScoreField\currQuiz\CorrButton\currQuiz

\noindent
Answers: \AnswerField\currQuiz\hfill

\newpage
\begin{flushleft}
Quiz \#2 \hfill Math 101
\end{flushleft}

%
% Set weights to each question, and report the points scored to the DB
%

\eqSubmit{http://localhost/scripts/eqRecord.asp\#FDF}{\DSN}{Math101} %
% This are created when source file is compiled, their values are not known
\addHiddenTextField{Quiz2.ptScore}{}
\addHiddenTextField{Quiz2.nPointTotal}{\theeqpointvalue}

% The values of these fields are  known at 'run time', must populate them
\populateHiddenField{Quiz2.ptScore}{ptScore}

\begin{quiz}*{Quiz2}
Using the discriminant, $b^2-4ac$, respond to each of the
following questions.

\PTsHook{($\eqPTs^{\text{pts}}$)}

\begin{questions}
\item\PTs{2} Is the quadratic polynomial $x^2-4x + 3$ irreducible?
\begin{answers}4
\Ans0 Yes &\Ans1 No
\end{answers}
\item\PTs{2} Is the quadratic polynomial $2x^2 - 4x + 3 $ irreducible?
\begin{answers}4
\Ans1 Yes &\Ans0 No
\end{answers}
\item\PTs{3} How many solutions does the equation $2x^2 - 3x - 2= 0$ have?
\begin{answers}4
\Ans0 none &\Ans0 one &\Ans1 two
\end{answers}
\item\PTs{3} $\displaystyle\int_0^\pi \sin(x)\,dx = $\space
\RespBoxMath{2}{1}{.0001}{[0,1]}\CorrAnsButton{2}
\end{questions}
\end{quiz}\quad Points: \PointsField\currQuiz\CorrButton\currQuiz

\noindent
Answers: \AnswerField\currQuiz

\end{document}