1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
% exerqz.4ht 2000-04-12-13:50 %
3
% Copyright (C) 1999--2000 %
4
% Donald P. Story & Eitan M. Gurari %
6
% This program can redistributed and/or modified under %
7
% the terms of the LaTeX Project Public License %
8
% Distributed from CTAN archives in directory %
9
% macros/latex/base/lppl.txt; either version 1 of the %
10
% License, or (at your option) any later version. %
12
% However, you are allowed to modify this program %
13
% without changing its name, if you modify its %
14
% signature. Changes to the signature can be introduced %
15
% with a directive of the form %
16
% \message{signature} %
18
% gurari@cis.ohio-state.edu %
19
% http://www.cis.ohio-state.edu/~gurari %
20
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
21
\immediate\write-1{version 2000-04-12-13:50}
23
\def\eqXInitQuizMsg{\hbox{%
25
\csname eq@InitQuizMsg\endcsname}}
26
\expandafter\ifx \csname eq@InitQuizMsg\endcsname\relax
27
\expandafter\def\csname eq@InitQuizMsg\endcsname{
28
"You must initialize the Quiz! Click on "+bqlabel}
30
\def\eqXQuizTotalMsg{\hbox{%
32
\def\thequestionno{"+thequestionno+"}%
33
\csname eq@QuizTotalMsg\endcsname}}
34
\expandafter\ifx \csname eq@QuizTotalMsg\endcsname\relax
35
\expandafter\def\csname eq@QuizTotalMsg\endcsname{"Score: '
36
+Score +' out of '+thequestionno+'"}
38
\def\eqXMadeChoice{\hbox{%
40
\csname eq@MadeChoice\endcsname}}
41
\expandafter\ifx \csname eq@MadeChoice\endcsname\relax
42
\expandafter\def\csname eq@MadeChoice\endcsname{
43
"You have already made a choice. Your choice was ("
44
+Responses[probno]+")."
45
+" Do you want to change it?"}
47
\expandafter\ifx \csname eqScore\endcsname\relax
61
function InitializeQuiz(qtfield,mark,quizN,ansN,lbrc,rbrc) {
65
eval( 'document.form'+qtfield+'.'+qtfield+'.value="$eqScore";' )
66
RightWrong=new Array();
67
for(var i in Responses){
68
if (prev_notify == 0 ) {
69
ResponsesAddr[i].value=Responses[i];
71
ResponsesAddr[i].value="("+Responses[i]+")";
74
Responses=new Array();
75
ResponsesAddr=new Array();
77
CorAddr[i].value=Cor[i];
83
for(var i=1; i<=ansN; i++){
89
function href(addr) { top.location.href=addr; }
92
function Corrections(lbl1,lbl2,quizN) {
93
if ( (EndQuizPushed == 1) && ( CurrentQuizNo == quizN ) ){
94
for(var i in RightWrong){
95
if( (RightWrong[i]==0) ){
97
eval('Cor[k]=thisform'+quizN+'.ans'+quizN+'x'+i+'.value');
98
eval('CorAddr[k]=thisform'+quizN+'.ans'+quizN+'x'+i);
100
eval('thisform'+quizN+'.ans'+quizN+'x'+i+'.value= "*"');
105
function LinkTo(addr) {
109
function QuizEnd(bqlabel,thequestionno,quiztotal,quizN){
110
if ((QuizInitialized !=1) || ( CurrentQuizNo!= quizN )){
111
alert($eqXInitQuizMsg,3);
113
eval( 'document.form'+quiztotal+'.'+quiztotal+
114
'.value=$eqXQuizTotalMsg');
121
function ProcessQuestion
122
(key,letterresp,probno,notify,bqlabel,quizN) {
123
if ((QuizInitialized !=1) || ( CurrentQuizNo!= quizN )){
124
alert($eqXInitQuizMsg,3);
126
if (Responses[probno] == null) {
129
RightWrong[probno]=1;
132
RightWrong[probno]=0;
133
if( ResponsesAddr[probno] != null ){
135
ResponsesAddr[probno].value=Responses[probno];
137
ResponsesAddr[probno].value="("+Responses[probno]+")";
139
qthis.value = "#"; ResponsesAddr[probno]=qthis;
141
Responses[probno]=letterresp;
147
User=confirm($eqXMadeChoice);
149
if (RightWrong[probno]==1) {
152
RightWrong[probno]=0;
153
if( ResponsesAddr[probno] != null ){
155
ResponsesAddr[probno].value=Responses[probno];
157
ResponsesAddr[probno].value="("+Responses[probno]+")";
159
qthis.value = "#"; ResponsesAddr[probno]=qthis;
161
Responses[probno]=letterresp;
167
RightWrong[probno]=1;
168
if( ResponsesAddr[probno] != null ){
170
ResponsesAddr[probno].value=Responses[probno];
172
ResponsesAddr[probno].value="("+Responses[probno]+")";
174
qthis.value = "#"; ResponsesAddr[probno]=qthis;
176
Responses[probno]=letterresp;
179
RightWrong[probno]=0;
180
if( ResponsesAddr[probno] != null ){
182
ResponsesAddr[probno].value=Responses[probno];
184
ResponsesAddr[probno].value="("+Responses[probno]+")";
186
qthis.value = "#"; ResponsesAddr[probno]=qthis;
188
Responses[probno]=letterresp;
194
prev_notify = notify;