~ubuntu-branches/debian/sid/tex4ht/sid

« back to all changes in this revision

Viewing changes to share/all4ht/exerquiz.4ht

  • Committer: Bazaar Package Importer
  • Author(s): Kapil Hari Paranjape
  • Date: 2005-04-05 14:14:41 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050405141441-x4dojdgz3frkfyet
Tags: 20050402.1817-1
* New upstream release (2005-04-02-18:17). Closes: #299934.
* See README.src, README.validate, README.Debian and copyright
  for information on minor changes.
* This upload fixes a some .htf files. Closes: #295109.
* Updated the description to reflect recent changes.
* Fixed some typos in src/tex4ht-mkht.tex and consequently
  in the mk4ht script.
* Updated the man page to include mk4ht. 
* Updated the description of options for the scripts in the man page.
  Put more information in the man page about the way the system works.
  Closes: #219348, #219347.
* Added debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
 
% exerquiz.4ht                         2001-12-14-17:07 %
3
 
% Copyright (C) 1999--2001      Eitan M. Gurari         %
4
 
%                                                       %
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.       %
10
 
%                                                       %
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}                        %
16
 
%                                                       %
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}
21
 
 
22
 
 
23
 
\def\Rect#1{#1}
24
 
\ifx \pdf@rect\:UnDef
25
 
   \newsavebox{\pdf@box}
26
 
   \def\pdf@rect#1{\leavevmode #1}
27
 
\fi
28
 
\NewConfigure{javascript}{1}
29
 
 
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}
34
 
 
35
 
\append:def\exercise{\Link{}{page.ex\the@exno}\EndLink }
36
 
\pend:def\endsolution{\def\thepage{ex\the@exno}}
37
 
 
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}}}
42
 
 
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}
48
 
 
49
 
\HAssign\:onClick = 0
50
 
\HAssign\Prob:N = 0
51
 
\HAssign\Quiz:N = 0
52
 
 
53
 
\append:def\shortquiz{\pend:def\answers{\gHAdvance\Prob:N by 1
54
 
   \let\:NAME\empty}}
55
 
\let\:@quiz\@quiz
56
 
\def\@quiz*#1#2{%
57
 
   \if #1f \let\c:quiz\C:quiz\fi
58
 
   \:@quiz*{#1}{#2}%
59
 
   \pend:defI\answers{\gHAdvance\Prob:N by 1
60
 
   \let\:NAME\empty}}
61
 
 
62
 
\pend:def\quiz{%
63
 
   \let\:bqlabel\bqlabel
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"
75
 
              name="correct\Quiz:N"
76
 
              onClick='\a:javascript \e:quiz' />%
77
 
        \fi
78
 
    }%
79
 
    \gHAdvance\Quiz:N by 1 \gHAssign\Prob:N=0    \ShowPar
80
 
   }
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}{
87
 
   \ifx#11
88
 
         \js:click{\b:shortquiz}{\a:shortquiz}{\ifx
89
 
                \@qzsolndest\empty 0\else 1\fi}%
90
 
   \else \js:click{\c:shortquiz}{\a:shortquiz}{0}%
91
 
   \fi
92
 
}}%
93
 
\NewConfigure{shortquiz}{3}
94
 
\pend:defII\ReturnTo{\noindent\a:ReturnTo}
95
 
\append:defII\ReturnTo{\b:ReturnTo}
96
 
\NewConfigure{ReturnTo}{2}
97
 
 
98
 
\def\Ans@l#1{\stepcounter{quizno}%
99
 
   \ifnum #1=1 \def\:NAME{ id="ans\Quiz:N x\Prob:N" }\fi
100
 
   \def\ANS{#1}%
101
 
   \js:click{\b:quiz}{\a:quiz}{0}}
102
 
\NewConfigure{quiz}{5}
103
 
 
104
 
\def\Ans@f#1{\stepcounter{quizno}%
105
 
   \ifnum #1=1 \def\:NAME{ id="ans\Quiz:N x\Prob:N" }\fi
106
 
   \def\ANS{#1}%
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*}{}{}{}
110
 
 
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"
118
 
                \:NAME]{}{}%
119
 
   \else
120
 
      \def\:tempa{#1}%
121
 
      \js:Link[ );' type="button" value="#2"\Hnewline
122
 
                name="ans\Quiz:N y\Prob:N"
123
 
                class="onClickClass"  \:NAME]{\@qzsolndest}{}%
124
 
   \fi
125
 
}
126
 
 
127
 
\Hinput{exerquiz}
128
 
\endinput
129