%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% exerquiz.4ht                         2001-12-14-17:07 %
% Copyright (C) 1999--2001      Eitan M. Gurari         %
%                                                       %
% This program can redistributed and/or modified under  %
% the terms of the LaTeX Project Public License         %
% Distributed from CTAN archives in directory           %
% macros/latex/base/lppl.txt; either version 1 of the   %
% License, or (at your option) any later version.       %
%                                                       %
% However, you are allowed to modify this program       %
% without changing its name, if you modify its          %
% signature. Changes to the signature can be introduced %
% with a directive of the form                          %
%            \message{signature}                        %
%                                                       %
%                             gurari@cis.ohio-state.edu %
%                 http://www.cis.ohio-state.edu/~gurari %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\immediate\write-1{version 2001-12-14-17:07}


\def\Rect#1{#1}
\ifx \pdf@rect\:UnDef
   \newsavebox{\pdf@box}
   \def\pdf@rect#1{\leavevmode #1}
\fi
\NewConfigure{javascript}{1}

\let\sv:tocsection\tocsection
\def\tocsection{\let\toclikesection\:gobbleIII \sv:tocsection}
\def\hypertarget#1#2{\Link{}{#1}#2\EndLink}
\def\hyperlink#1#2{\Link{#1}{}#2\EndLink}

\append:def\exercise{\Link{}{page.ex\the@exno}\EndLink }
\pend:def\endsolution{\def\thepage{ex\the@exno}}

\let\:shortquiz\shortquiz
\def\shortquiz{\gHAdvance\:onClick by 1
   \Link{}{page.qz\:onClick}\EndLink   \:shortquiz
   \pend:def\endsolution{\def\thepage{qz\:onClick}}}

\pend:def\include@quizsolutions{%
    \let\sv:newpage\newpage
    \append:def\newpage{\ht:everypar{\HtmlPar}}}
\append:def\include@solutions{%
    \let\noindent\sv:noindent}

\HAssign\:onClick = 0
\HAssign\Prob:N = 0
\HAssign\Quiz:N = 0

\append:def\shortquiz{\pend:def\answers{\gHAdvance\Prob:N by 1
   \let\:NAME\empty}}
\let\:@quiz\@quiz
\def\@quiz*#1#2{%
   \if #1f \let\c:quiz\C:quiz\fi
   \:@quiz*{#1}{#2}%
   \pend:defI\answers{\gHAdvance\Prob:N by 1
   \let\:NAME\empty}}

\pend:def\quiz{%
   \let\:bqlabel\bqlabel
   \def\bqlabel{\IgnorePar\EndP
      \Tg<form action="." class="quiz"
            id="thisform\Quiz:N">%
            \Tg<input value="\:bqlabel"  type="reset"
             onClick='\c:quiz' />}%
    \let\:eqlabel\eq@eqlabel
    \def\eq@eqlabel{\IgnorePar\EndP
             \Tg<input type="button" value="\:eqlabel"
             onClick='\a:javascript \d:quiz' />%
        \ifeq@nocorrections\else
           \Tg<input type="button" value="\eq@CA"
              name="correct\Quiz:N"
              onClick='\a:javascript \e:quiz' />%
        \fi
    }%
    \gHAdvance\Quiz:N by 1 \gHAssign\Prob:N=0    \ShowPar
   }
\append:def\endquiz{\let\eq@eqlabel=\:eqlabel
   \Tg</form>\Tag{ans-\Quiz:N}{\Prob:N}}
\pend:def\shortquiz{\leavevmode
   \Tg<form action="." class="shortquiz">\IgnorePar}
\append:def\endshortquiz{\Tg</form>}{}{}
\def\Ans@i#1{\stepcounter{quizno}{
   \ifx#11
         \js:click{\b:shortquiz}{\a:shortquiz}{\ifx
                \@qzsolndest\empty 0\else 1\fi}%
   \else \js:click{\c:shortquiz}{\a:shortquiz}{0}%
   \fi
}}%
\NewConfigure{shortquiz}{3}
\pend:defII\ReturnTo{\noindent\a:ReturnTo}
\append:defII\ReturnTo{\b:ReturnTo}
\NewConfigure{ReturnTo}{2}

\def\Ans@l#1{\stepcounter{quizno}%
   \ifnum #1=1 \def\:NAME{ id="ans\Quiz:N x\Prob:N" }\fi
   \def\ANS{#1}%
   \js:click{\b:quiz}{\a:quiz}{0}}
\NewConfigure{quiz}{5}

\def\Ans@f#1{\stepcounter{quizno}%
   \ifnum #1=1 \def\:NAME{ id="ans\Quiz:N x\Prob:N" }\fi
   \def\ANS{#1}%
   \js:click{\B:quiz}{\A:quiz}{0}}
\NewConfigure{quiz*}[3]{\def\A:quiz{#1}\def\B:quiz{#2}\def\C:quiz{#3}}
\Configure{quiz*}{}{}{}

\LinkCommand\js:link{input,,,, /}
\LinkCommand\js:Link{input,onClick='\a:javascript \noexpand\:tempa
   href(\noexpand\:gobble,,, /}
\def\js:click#1#2#3{\ifnum #3=0
      \js:link[ type="button" value="#2"\Hnewline
                class="onClickClass"  onClick='\a:javascript #1'
                name="ans\Quiz:N y\Prob:N"
                \:NAME]{}{}%
   \else
      \def\:tempa{#1}%
      \js:Link[ );' type="button" value="#2"\Hnewline
                name="ans\Quiz:N y\Prob:N"
                class="onClickClass"  \:NAME]{\@qzsolndest}{}%
   \fi
}

\Hinput{exerquiz}
\endinput

