%% %% This is file `aebrandom.def', %% generated with the docstrip utility. %% %% The original source files were: %% %% exerquiz.dtx (with options: `copyright,randomize') %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Exerquiz.sty package, 2011-1-15 %% %% Copyright (C) 1999-2011 D. P. Story %% %% dpstory@uakron.edu %% %% %% %% 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. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ProvidesFile{aebrandom.def} [2011/08/30 v6.4m % Exerquiz support for randomization (dps)] \input random.tex \def\@ansChoices[#1]% {% \global\let\@tempholdSaveAns\@empty % 5/24 \global\let\@tempholdSaveChoice\@empty % 5/24 \global\let\bChoiceLabel\@empty % 5/24 \ifeq@randomizeallChoices \setkeys{bchoice}{#1,random=true}\else \setkeys{bchoice}{#1}\fi \global\eq@tabColCnt=0 \ifeq@randomizeChoices\expandafter\@@bChoices \else\expandafter\@@ansChoices\fi } \def\@@ansChoices{% \ifnum\aeb@numCols=1 % list mode \def\eq@next{\@layoutListAns}% \else % tabular mode \edef\eq@next{\noexpand\@layoutTabularAns{\bChoiceNumCols}}% \fi \eq@next } \newcount\aeb@numChoices \newcount\aeb@ranChoice \newtoks\aeb@hold\aeb@hold={} \def\@@bChoices{\gdef\@temphold{}\gdef\@tempholdrandom{}% \gdef\@tempholdfreeze{}\aeb@searchfortoken{\@getAns}% } \def\aeb@searchfortoken#1{% \@ifnextchar\Ans{\advance\aeb@numChoices1\relax#1} {\@ifnextchar\eFreeze{\expandafter\@getFreezeAns\@gobble} {\@ifnextchar\par{\def\@@temp{\aeb@searchfortoken{#1}}% \expandafter\@@temp\@gobble}{\@eChoices}}}% } \long\def\@getAns\Ans#1\eAns{% \g@addto@macro\@temphold{{\Ans#1\eAns}}% \aeb@searchfortoken{\@getAns}% } \def\@getFreezeAns{\aeb@searchfortoken{\@@getFreezeAns}} \long\def\@@getFreezeAns\Ans#1\eAns{% \g@addto@macro\@tempholdfreeze{\Ans#1\eAns}% \aeb@searchfortoken{\@@getFreezeAns}% } \long\def\@eChoices#1\eChoices{% \aeb@randomizeChoices{\the\aeb@numChoices}% } \def\aeb@randomizeChoices#1{% \setrannum{\aeb@ranChoice}{1}{#1} \count0=0 \aeb@hold=\expandafter{\@temphold}\def\@temphold{}% \expandafter\@tfor\expandafter \@temp\expandafter:\expandafter=\the\aeb@hold \do {% \advance\count0by1 \ifnum\count0=\aeb@ranChoice \aeb@hold=\expandafter\expandafter\expandafter {\expandafter\@tempholdrandom\@temp}% \edef\@tempholdrandom{\the\aeb@hold}% \else \aeb@hold=\expandafter\expandafter\expandafter {\expandafter\@temphold\expandafter{\@temp}}% \edef\@temphold{\the\aeb@hold}% \fi }% \aeb@numChoices=#1 \advance\aeb@numChoices-1 \ifnum\aeb@numChoices=0\relax \def\aeb@next{\aeb@finishedRandomizing}\else \def\aeb@next{\aeb@randomizeChoices{\the\aeb@numChoices}}\fi \aeb@next } \def\aeb@finishedRandomizing{% \aeb@hold=\expandafter\expandafter\expandafter {\expandafter\@tempholdrandom\@tempholdfreeze}% \gdef\@temphold{}\gdef\@tempholdrandom{}\gdef\@tempholdfreeze{}% \edef\finished@Randomizing{% \noexpand\@@ansChoices \the\aeb@hold \noexpand\eChoices}% \finished@Randomizing } \def\saveRandomSeed{\AtEndDocument{\eq@writeRandomData}} \def\inputRandomSeed{\eq@readRandomData} \def\useRandomSeed#1{\randomi=#1} \def\eq@writeRandomData {% \newwrite \eq@saverandomdata \immediate\openout \eq@saverandomdata \jobname_ran.sav \let\verbatim@out\eq@saverandomdata \immediate\write\verbatim@out{\string\randomi=\the\randomi}% \immediate\closeout\verbatim@out } \def\eq@readRandomData {% \InputIfFileExists{\jobname_ran.sav}% {\typeout{!!!! Inputting \jobname_ran.sav}}% {\typeout{!!!! Cannot find \jobname_ran.sav}}% } \endinput %% %% End of file `aebrandom.def'.