Debian Codegraph @

texmf-dist/tex/generic/tex4ht/exerqz.4ht

raw
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 % exerqz.4ht 2009-05-18-23:01 %
3 % Copyright (C) 1999--2009 %
4 % Donald P. Story & Eitan M. Gurari %
5 % %
6 % This work may be distributed and/or modified under the %
7 % conditions of the LaTeX Project Public License, either %
8 % version 1.3 of this license or (at your option) any %
9 % later version. The latest version of this license is %
10 % in %
11 % http://www.latex-project.org/lppl.txt %
12 % and version 1.3 or later is part of all distributions %
13 % of LaTeX version 2003/12/01 or later. %
14 % %
15 % This work has the LPPL maintenance status "maintained".%
16 % %
17 % This Current Maintainer of this work %
18 % is Eitan M. Gurari. %
19 % %
20 % If you modify this program your changing its signature %
21 % with a directive of the following form will be %
22 % appreciated. %
23 % \message{signature} %
24 % %
25 % [email protected] %
26 % http://www.cse.ohio-state.edu/~gurari %
27 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28 \immediate\write-1{version 2009-05-18-23:01}
29
30 \def\eqXInitQuizMsg{\hbox{%
31 \let\noexpand\string
32 \csname eq@InitQuizMsg\endcsname}}
33 \expandafter\ifx \csname eq@InitQuizMsg\endcsname\relax
34 \expandafter\def\csname eq@InitQuizMsg\endcsname{
35 "You must initialize the Quiz! Click on "+bqlabel}
36 \fi
37 \def\eqXQuizTotalMsg{\hbox{%
38 \let\noexpand\string
39 \def\thequestionno{"+thequestionno+"}%
40 \csname eq@QuizTotalMsg\endcsname}}
41 \expandafter\ifx \csname eq@QuizTotalMsg\endcsname\relax
42 \expandafter\def\csname eq@QuizTotalMsg\endcsname{"Score: '
43 +Score +' out of '+thequestionno+'"}
44 \fi
45 \def\eqXMadeChoice{\hbox{%
46 \let\noexpand\string
47 \csname eq@MadeChoice\endcsname}}
48 \expandafter\ifx \csname eq@MadeChoice\endcsname\relax
49 \expandafter\def\csname eq@MadeChoice\endcsname{
50 "You have already made a choice. Your choice was ("
51 +Responses[probno]+")."
52 +" Do you want to change it?"}
53 \fi
54 \expandafter\ifx \csname eqScore\endcsname\relax
55 \def\eqScore{Score:}
56 \fi
57
58 \JavaScript-$
59 var QuizInitialized;
60 var EndQuizPushed;
61 var CurrentQuizNo;
62 var Responses;
63 var ResponsesAddr;
64 var Cor;
65 var CorAddr;
66 var qthis;
67 var prev_notify;
68 function InitializeQuiz(qtfield,mark,quizN,ansN,lbrc,rbrc) {
69 Score=0;
70 QuizInitialized=1;
71 CurrentQuizNo=quizN;
72 eval( 'document.form'+qtfield+'.'+qtfield+'.value="$eqScore";' )
73 RightWrong=new Array();
74 for(var i in Responses){
75 if (prev_notify == 0 ) {
76 ResponsesAddr[i].value=Responses[i];
77 } else {
78 ResponsesAddr[i].value="("+Responses[i]+")";
79 } }
80
81 Responses=new Array();
82 ResponsesAddr=new Array();
83 for(var i in Cor){
84 CorAddr[i].value=Cor[i];
85 }
86
87 Cor=new Array();
88 CorAddr=new Array();
89 EndQuizPushed=0;
90 for(var i=1; i<=ansN; i++){
91 RightWrong[i]=0;
92 }
93 }
94 \EndJavaScript
95 \JavaScript
96 function href(addr) { top.location.href=addr; }
97 \EndJavaScript
98 \JavaScript
99 function Corrections(lbl1,lbl2,quizN) {
100 if ( (EndQuizPushed == 1) && ( CurrentQuizNo == quizN ) ){
101 for(var i in RightWrong){
102 if( (RightWrong[i]==0) ){
103 var k=Cor.length;
104 eval('Cor[k]=thisform'+quizN+'.ans'+quizN+'x'+i+'.value');
105 eval('CorAddr[k]=thisform'+quizN+'.ans'+quizN+'x'+i);
106
107 eval('thisform'+quizN+'.ans'+quizN+'x'+i+'.value= "*"');
108 } }
109 } }
110 \EndJavaScript
111 \JavaScript
112 function LinkTo(addr) {
113 }
114 \EndJavaScript
115 \JavaScript-$
116 function QuizEnd(bqlabel,thequestionno,quiztotal,quizN){
117 if ((QuizInitialized !=1) || ( CurrentQuizNo!= quizN )){
118 alert($eqXInitQuizMsg,3);
119 } else {
120 eval( 'document.form'+quiztotal+'.'+quiztotal+
121 '.value=$eqXQuizTotalMsg');
122 QuizInitialized=-1;
123 EndQuizPushed=1;
124 } }
125 \EndJavaScript
126
127 \JavaScript-$
128 function ProcessQuestion
129 (key,letterresp,probno,notify,bqlabel,quizN) {
130 if ((QuizInitialized !=1) || ( CurrentQuizNo!= quizN )){
131 alert($eqXInitQuizMsg,3);
132 } else {
133 if (Responses[probno] == null) {
134 if (key==1) {
135 Score++;
136 RightWrong[probno]=1;
137 }
138 else
139 RightWrong[probno]=0;
140 if( ResponsesAddr[probno] != null ){
141 if (notify == 0 ) {
142 ResponsesAddr[probno].value=Responses[probno];
143 } else {
144 ResponsesAddr[probno].value="("+Responses[probno]+")";
145 } }
146 qthis.value = "#"; ResponsesAddr[probno]=qthis;
147
148 Responses[probno]=letterresp;
149 }
150 else {
151 if (notify==0)
152 User=true;
153 else
154 User=confirm($eqXMadeChoice);
155 if (User) {
156 if (RightWrong[probno]==1) {
157 if (key==0) {
158 Score -= 1;
159 RightWrong[probno]=0;
160 if( ResponsesAddr[probno] != null ){
161 if (notify == 0 ) {
162 ResponsesAddr[probno].value=Responses[probno];
163 } else {
164 ResponsesAddr[probno].value="("+Responses[probno]+")";
165 } }
166 qthis.value = "#"; ResponsesAddr[probno]=qthis;
167
168 Responses[probno]=letterresp;
169 }
170 }
171 else {
172 if (key==1) {
173 Score++;
174 RightWrong[probno]=1;
175 if( ResponsesAddr[probno] != null ){
176 if (notify == 0 ) {
177 ResponsesAddr[probno].value=Responses[probno];
178 } else {
179 ResponsesAddr[probno].value="("+Responses[probno]+")";
180 } }
181 qthis.value = "#"; ResponsesAddr[probno]=qthis;
182
183 Responses[probno]=letterresp;
184 }
185 else {
186 RightWrong[probno]=0;
187 if( ResponsesAddr[probno] != null ){
188 if (notify == 0 ) {
189 ResponsesAddr[probno].value=Responses[probno];
190 } else {
191 ResponsesAddr[probno].value="("+Responses[probno]+")";
192 } }
193 qthis.value = "#"; ResponsesAddr[probno]=qthis;
194
195 Responses[probno]=letterresp;
196 }
197 }
198 }
199 }
200
201 prev_notify = notify;
202 } }
203 \EndJavaScript
204
205