summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/tex4ht/exerqz.4ht
blob: f49e795c58148d38d0de6574968c5f8ad8d56b4e (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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% exerqz.4ht                            2009-05-18-23:01 %
% Copyright (C) 1999--2009                          %
%                      Donald P. Story & Eitan M. Gurari %
%                                                        %
% This work may be distributed and/or modified under the %
% conditions of the LaTeX Project Public License, either %
% version 1.3 of this license or (at your option) any    %
% later version. The latest version of this license is   %
% in                                                     %
%   http://www.latex-project.org/lppl.txt                %
% and version 1.3 or later is part of all distributions  %
% of LaTeX version 2003/12/01 or later.                  %
%                                                        %
% This work has the LPPL maintenance status "maintained".%
%                                                        %
% This Current Maintainer of this work                   %
% is Eitan M. Gurari.                                    %
%                                                        %
% If you modify this program your changing its signature %
% with a directive of the following form will be         %
% appreciated.                                           %
%            \message{signature}                         %
%                                                        %
%                             gurari@cse.ohio-state.edu  %
%                 http://www.cse.ohio-state.edu/~gurari  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\immediate\write-1{version 2009-05-18-23:01}

\def\eqXInitQuizMsg{\hbox{%
   \let\noexpand\string
   \csname eq@InitQuizMsg\endcsname}}
\expandafter\ifx \csname eq@InitQuizMsg\endcsname\relax
    \expandafter\def\csname eq@InitQuizMsg\endcsname{
        "You must initialize the Quiz! Click on "+bqlabel}
\fi
\def\eqXQuizTotalMsg{\hbox{%
   \let\noexpand\string
   \def\thequestionno{"+thequestionno+"}%
   \csname eq@QuizTotalMsg\endcsname}}
\expandafter\ifx \csname eq@QuizTotalMsg\endcsname\relax
    \expandafter\def\csname eq@QuizTotalMsg\endcsname{"Score: '
         +Score +' out of '+thequestionno+'"}
\fi
\def\eqXMadeChoice{\hbox{%
   \let\noexpand\string
   \csname eq@MadeChoice\endcsname}}
\expandafter\ifx \csname eq@MadeChoice\endcsname\relax
    \expandafter\def\csname eq@MadeChoice\endcsname{
            "You have already made a choice. Your choice was ("
            +Responses[probno]+")."
            +" Do you want to change it?"}
\fi
\expandafter\ifx \csname eqScore\endcsname\relax
    \def\eqScore{Score:}
\fi

\JavaScript-$
var QuizInitialized;
var EndQuizPushed;
var CurrentQuizNo;
var Responses;
var ResponsesAddr;
var Cor;
var CorAddr;
var qthis;
var prev_notify;
function InitializeQuiz(qtfield,mark,quizN,ansN,lbrc,rbrc) {
  Score=0;
  QuizInitialized=1;
  CurrentQuizNo=quizN;
  eval( 'document.form'+qtfield+'.'+qtfield+'.value="$eqScore";' )
  RightWrong=new Array();
  for(var i in Responses){
  if (prev_notify == 0 ) {
    ResponsesAddr[i].value=Responses[i];
  } else {
    ResponsesAddr[i].value="("+Responses[i]+")";
} }

  Responses=new Array();
  ResponsesAddr=new Array();
  for(var i in Cor){
  CorAddr[i].value=Cor[i];
}

  Cor=new Array();
  CorAddr=new Array();
  EndQuizPushed=0;
  for(var i=1; i<=ansN; i++){
     RightWrong[i]=0;
  }
}
\EndJavaScript
\JavaScript
function href(addr) { top.location.href=addr; }
\EndJavaScript
\JavaScript
function Corrections(lbl1,lbl2,quizN) {
  if ( (EndQuizPushed == 1) && ( CurrentQuizNo == quizN ) ){
    for(var i in RightWrong){
      if( (RightWrong[i]==0) ){
        var k=Cor.length;
eval('Cor[k]=thisform'+quizN+'.ans'+quizN+'x'+i+'.value');
eval('CorAddr[k]=thisform'+quizN+'.ans'+quizN+'x'+i);

        eval('thisform'+quizN+'.ans'+quizN+'x'+i+'.value= "*"');
  } }
} }
\EndJavaScript
\JavaScript
function LinkTo(addr) {
}
\EndJavaScript
\JavaScript-$
function QuizEnd(bqlabel,thequestionno,quiztotal,quizN){
  if ((QuizInitialized !=1) || ( CurrentQuizNo!= quizN )){
     alert($eqXInitQuizMsg,3);
  } else {
     eval( 'document.form'+quiztotal+'.'+quiztotal+
       '.value=$eqXQuizTotalMsg');
         QuizInitialized=-1;
         EndQuizPushed=1;
} }
\EndJavaScript

\JavaScript-$
function  ProcessQuestion
  (key,letterresp,probno,notify,bqlabel,quizN) {
    if ((QuizInitialized !=1) || ( CurrentQuizNo!= quizN )){
      alert($eqXInitQuizMsg,3);
    } else {
      if (Responses[probno] == null) {
   if (key==1) {
      Score++;
      RightWrong[probno]=1;
   }
   else
      RightWrong[probno]=0;
   if( ResponsesAddr[probno] != null ){
  if (notify == 0 ) {
    ResponsesAddr[probno].value=Responses[probno];
  } else {
    ResponsesAddr[probno].value="("+Responses[probno]+")";
} }
qthis.value = "#";  ResponsesAddr[probno]=qthis;

   Responses[probno]=letterresp;
}
else {
   if (notify==0)
      User=true;
   else
      User=confirm($eqXMadeChoice);
   if (User) {
      if (RightWrong[probno]==1) {
          if (key==0) {
            Score -= 1;
            RightWrong[probno]=0;
            if( ResponsesAddr[probno] != null ){
  if (notify == 0 ) {
    ResponsesAddr[probno].value=Responses[probno];
  } else {
    ResponsesAddr[probno].value="("+Responses[probno]+")";
} }
qthis.value = "#";  ResponsesAddr[probno]=qthis;

            Responses[probno]=letterresp;
         }
      }
      else {
          if (key==1) {
            Score++;
            RightWrong[probno]=1;
            if( ResponsesAddr[probno] != null ){
  if (notify == 0 ) {
    ResponsesAddr[probno].value=Responses[probno];
  } else {
    ResponsesAddr[probno].value="("+Responses[probno]+")";
} }
qthis.value = "#";  ResponsesAddr[probno]=qthis;

            Responses[probno]=letterresp;
         }
         else {
            RightWrong[probno]=0;
            if( ResponsesAddr[probno] != null ){
  if (notify == 0 ) {
    ResponsesAddr[probno].value=Responses[probno];
  } else {
    ResponsesAddr[probno].value="("+Responses[probno]+")";
} }
qthis.value = "#";  ResponsesAddr[probno]=qthis;

            Responses[probno]=letterresp;
         }
      }
   }
}

      prev_notify = notify;
}   }
\EndJavaScript