diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/tex4ht/exerquiz.4ht')
-rw-r--r-- | Master/texmf-dist/tex/generic/tex4ht/exerquiz.4ht | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/tex4ht/exerquiz.4ht b/Master/texmf-dist/tex/generic/tex4ht/exerquiz.4ht new file mode 100644 index 00000000000..bf5de6be2f4 --- /dev/null +++ b/Master/texmf-dist/tex/generic/tex4ht/exerquiz.4ht @@ -0,0 +1,136 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% exerquiz.4ht 2005-10-23-04:19 % +% Copyright (C) 1999--2005 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 2005-10-23-04:19} + + +\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 + |