%%
%% This is file `contsolns.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% contsolns.dtx  (with options: `package')
%% 
\@ifpackageloaded{web}{}{\PackageError{exerquiz}
    {The consolns option of exerquiz requires\MessageBreak
     the web package}{Use the web package.}}

\def\setQNum{\Qlabel\ifcase\@eqquestiondepth\or\arabic{eqquestionnoi}%
    \or\arabic{eqquestionnoi}(\alph{eqquestionnoii})%
    \or\arabic{eqquestionnoi}(\alph{eqquestionnoii})%
        (\roman{eqquestionnoiii})\fi}
\def\setENum{\Elabel\if\exerstar*\theeqexno(\alph{partno})\else
    \theeqexno\fi}
\def\Qlabel{Q}\def\Elabel{E}
\def\SolContMrk#1#2{\gdef\solContMarks{{#1}{#2}}}
\def\solContMarks{{}{}}
\def\sqPostHeaderHook{%
    \string\SolContMrk{Q\@shortquizCnt}{\setQNum}\relax}
\def\qPostHeaderHook{%
    \string\SolContMrk{Q\@quizCnt}{\setQNum}\relax}
\def\exer@solnheadhook{%
    \string\SolContMrk{Ex}{\setENum}}
\newcommand{\promoteNPHskip}{.1\textheight}
\ifeqforpaper
\def\redefForContSolns{%
    \let\eqSQtsave\eqSQt
    \def\eqSQt##1{\promoteNewPageHere{\promoteNPHskip}\eqSQtsave{##1}}
    \let\eqQtsave\eqQt
    \def\eqQt##1{\promoteNewPageHere{\promoteNPHskip}\eqQtsave{##1}}
    \let\eqEXtsave\eqEXt
    \def\eqEXt##1##2{\promoteNewPageHere{\promoteNPHskip}%
        \eqEXtsave{##1}{##2}}
    \eq@scratchtoks=\expandafter{\fpAfterSolutionsSkip\SolContMrk{}{}}
    \edef\fpAfterSolutionsSkip{\the\eq@scratchtoks}
    \eq@scratchtoks=\expandafter{%
        \belowexsolnskip\protect\SolContMrk{}{}}
    \edef\belowexsolnskip{\the\eq@scratchtoks}
}
\else
\def\redefForContSolns{%
    \let\endeqSQtSAVE\endeqSQt
    \def\endeqSQt{\endeqSQtSAVE\par\SolContMrk{}{}}
    \let\endeqQtSAVE\endeqSQt
    \def\endeqQt{\endeqQtSAVE\par\SolContMrk{}{}}
    \let\endeqEXtSAVE\endeqEXt
    \def\endeqEXt{\endeqEXtSAVE\par\SolContMrk{}{}}
}
\fi % \ifeqforpaper
\AtBeginDocument{\redefForContSolns}
\newcommand{\getSolContMarks}[2]{\ifcontSoln
    \rfootContStr{#1}{#2}\fi}
\newcommand{\rfootContStr}[2]{Solution to {#2} continues next page}
\newif\ifcontSoln \contSolnfalse
\newcommand{\bSolContMarks}[2]{%
    \def\eq@argi{#1}\def\eq@argii{#2}%
    \ifx\eq@argi\@empty\global\contSolnfalse\else
        \global\contSolntrue\fi}
\def\lFootbCont{\expandafter\bSolContMarks\solContMarks}
\def\rFootCont{\makebox[0pt][r]{%
    \expandafter\getSolContMarks\solContMarks}}
\def\addtolfooter{\expandafter
    \lfooter\expandafter{\expandafter\lFootbCont\web@lfoot}}
\def\addtorfooter{\expandafter
    \rfooter\expandafter{\web@rfoot\rFootCont}}
\def\cs@testWH#1#2{\ifx\webfootwrapper#1
    \def\cs@next{\AtBeginDocument{\addtolfooter\addtorfooter}}\else
    \def\cs@next{\PackageError{contsoln.def}{%
        webheadings of the web package are NOT\MessageBreak
        in effect. The contsoln.def file requires\MessageBreak
        webheadings}{Use the default webheadings pagestyle
        from the web package.}}\fi
    \cs@next
}
\AtBeginDocument{\expandafter\cs@testWH\@oddfoot}
\endinput
%%
%% End of file `contsolns.def'.
