1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
% exerquiz.4ht 2001-12-14-17:07 %
3
% Copyright (C) 1999--2001 Eitan M. Gurari %
5
% This program can redistributed and/or modified under %
6
% the terms of the LaTeX Project Public License %
7
% Distributed from CTAN archives in directory %
8
% macros/latex/base/lppl.txt; either version 1 of the %
9
% License, or (at your option) any later version. %
11
% However, you are allowed to modify this program %
12
% without changing its name, if you modify its %
13
% signature. Changes to the signature can be introduced %
14
% with a directive of the form %
15
% \message{signature} %
17
% gurari@cis.ohio-state.edu %
18
% http://www.cis.ohio-state.edu/~gurari %
19
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20
\immediate\write-1{version 2001-12-14-17:07}
26
\def\pdf@rect#1{\leavevmode #1}
28
\NewConfigure{javascript}{1}
30
\let\sv:tocsection\tocsection
31
\def\tocsection{\let\toclikesection\:gobbleIII \sv:tocsection}
32
\def\hypertarget#1#2{\Link{}{#1}#2\EndLink}
33
\def\hyperlink#1#2{\Link{#1}{}#2\EndLink}
35
\append:def\exercise{\Link{}{page.ex\the@exno}\EndLink }
36
\pend:def\endsolution{\def\thepage{ex\the@exno}}
38
\let\:shortquiz\shortquiz
39
\def\shortquiz{\gHAdvance\:onClick by 1
40
\Link{}{page.qz\:onClick}\EndLink \:shortquiz
41
\pend:def\endsolution{\def\thepage{qz\:onClick}}}
43
\pend:def\include@quizsolutions{%
44
\let\sv:newpage\newpage
45
\append:def\newpage{\ht:everypar{\HtmlPar}}}
46
\append:def\include@solutions{%
47
\let\noindent\sv:noindent}
53
\append:def\shortquiz{\pend:def\answers{\gHAdvance\Prob:N by 1
57
\if #1f \let\c:quiz\C:quiz\fi
59
\pend:defI\answers{\gHAdvance\Prob:N by 1
64
\def\bqlabel{\IgnorePar\EndP
65
\Tg<form action="." class="quiz"
66
id="thisform\Quiz:N">%
67
\Tg<input value="\:bqlabel" type="reset"
68
onClick='\c:quiz' />}%
69
\let\:eqlabel\eq@eqlabel
70
\def\eq@eqlabel{\IgnorePar\EndP
71
\Tg<input type="button" value="\:eqlabel"
72
onClick='\a:javascript \d:quiz' />%
73
\ifeq@nocorrections\else
74
\Tg<input type="button" value="\eq@CA"
76
onClick='\a:javascript \e:quiz' />%
79
\gHAdvance\Quiz:N by 1 \gHAssign\Prob:N=0 \ShowPar
81
\append:def\endquiz{\let\eq@eqlabel=\:eqlabel
82
\Tg</form>\Tag{ans-\Quiz:N}{\Prob:N}}
83
\pend:def\shortquiz{\leavevmode
84
\Tg<form action="." class="shortquiz">\IgnorePar}
85
\append:def\endshortquiz{\Tg</form>}{}{}
86
\def\Ans@i#1{\stepcounter{quizno}{
88
\js:click{\b:shortquiz}{\a:shortquiz}{\ifx
89
\@qzsolndest\empty 0\else 1\fi}%
90
\else \js:click{\c:shortquiz}{\a:shortquiz}{0}%
93
\NewConfigure{shortquiz}{3}
94
\pend:defII\ReturnTo{\noindent\a:ReturnTo}
95
\append:defII\ReturnTo{\b:ReturnTo}
96
\NewConfigure{ReturnTo}{2}
98
\def\Ans@l#1{\stepcounter{quizno}%
99
\ifnum #1=1 \def\:NAME{ id="ans\Quiz:N x\Prob:N" }\fi
101
\js:click{\b:quiz}{\a:quiz}{0}}
102
\NewConfigure{quiz}{5}
104
\def\Ans@f#1{\stepcounter{quizno}%
105
\ifnum #1=1 \def\:NAME{ id="ans\Quiz:N x\Prob:N" }\fi
107
\js:click{\B:quiz}{\A:quiz}{0}}
108
\NewConfigure{quiz*}[3]{\def\A:quiz{#1}\def\B:quiz{#2}\def\C:quiz{#3}}
109
\Configure{quiz*}{}{}{}
111
\LinkCommand\js:link{input,,,, /}
112
\LinkCommand\js:Link{input,onClick='\a:javascript \noexpand\:tempa
113
href(\noexpand\:gobble,,, /}
114
\def\js:click#1#2#3{\ifnum #3=0
115
\js:link[ type="button" value="#2"\Hnewline
116
class="onClickClass" onClick='\a:javascript #1'
117
name="ans\Quiz:N y\Prob:N"
121
\js:Link[ );' type="button" value="#2"\Hnewline
122
name="ans\Quiz:N y\Prob:N"
123
class="onClickClass" \:NAME]{\@qzsolndest}{}%