From ecacc7b84cdebdf9b1707a44c930b243bcfad52d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 11 Jan 2019 12:14:02 +0900 Subject: eqexam update --- texmf-dist/source/latex/eqexam/doc/eqexamman.tex | 4611 -------------------- texmf-dist/source/latex/eqexam/doc/fortextbook.zip | Bin 718935 -> 0 bytes .../latex/eqexam/doc/fortextbook/fortextbook.pdf | Bin 577912 -> 0 bytes texmf-dist/source/latex/eqexam/eqexam.drv | 66 + texmf-dist/source/latex/eqexam/eqexam.dtx | 2216 ++++++++-- texmf-dist/source/latex/eqexam/eqexam.ins | 5 +- texmf-dist/source/latex/eqexam/script/eqAttach.asp | 202 - 7 files changed, 1892 insertions(+), 5208 deletions(-) delete mode 100644 texmf-dist/source/latex/eqexam/doc/eqexamman.tex delete mode 100644 texmf-dist/source/latex/eqexam/doc/fortextbook.zip delete mode 100644 texmf-dist/source/latex/eqexam/doc/fortextbook/fortextbook.pdf create mode 100644 texmf-dist/source/latex/eqexam/eqexam.drv delete mode 100644 texmf-dist/source/latex/eqexam/script/eqAttach.asp (limited to 'texmf-dist/source') diff --git a/texmf-dist/source/latex/eqexam/doc/eqexamman.tex b/texmf-dist/source/latex/eqexam/doc/eqexamman.tex deleted file mode 100644 index c8ec9c86..00000000 --- a/texmf-dist/source/latex/eqexam/doc/eqexamman.tex +++ /dev/null @@ -1,4611 +0,0 @@ -\documentclass{article} -%\usepackage{makeidx,showidx} -\usepackage[fleqn]{amsmath} -\usepackage{graphicx} -\usepackage[ - web={designv, - latextoc,forcolorpaper, - centertitlepage}, - eforms -]{aeb_pro} -%\usepackage[designv, -% latextoc,forcolorpaper, -% centertitlepage]{web} -%\usepackage{eforms} - -%\usepackage[nopoints,fortextbook,nomarginwrite,usecustomdesign]{eqexam} -%\usepackage{longtable,colortbl} -%\useFullWidthForPaper - -\usepackage{eqexaman} - -%\usepackage{srcltx} - -\hfuzz=1pt - -\def\AEBBook{\textsl{{Acro\!\TeX} eDucation System Tools: {\LaTeX} for interactive PDF documents}} -\def\AEBP{\textsf{AeB Pro}} - -\DeclareFontFamily{U}{wi}{} -\DeclareFontShape{U}{wi}{m}{n}{<-> wingding}{} -\DeclareFontFamily{U}{webd}{} -\DeclareFontShape{U}{webd}{m}{n}{<-> webdings}{} - -\font\zqacr=zqacr at 8pt - - - -\setlength{\mathindent}{\leftmargini} -%\def\meta#1{\textit{$\langle$#1$\rangle$}} - -\makeatletter - -%\def\numberline#1{{\setlength{\fboxsep}{0pt}\fbox{\hb@xt@\@tempdima{#1\hfil}}}} - -%\renewcommand*\l@section{\addvspace{2pt}\@dottedtocline{1}{1.5em}{2.5em}} -\renewcommand*\l@subsection{\addvspace{1pt}\@dottedtocline{2}{1.5em}{3em}} -\renewcommand*\l@subsubsection{\addvspace{1pt}\@dottedtocline{3}{4.5em}{1.2em}} - -%\renewcommand*\l@subsubsection{\addvspace{1pt}\@dottedtocline{3}{7.4em}{1.2em}} - -%\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.3em}} -%\renewcommand*\l@subsection{\@dottedtocline{2}{4.8em}{3.4em}} -%\renewcommand*\l@subsubsection{\@dottedtocline{3}{8.2em}{1.2em}} -%\renewcommand*\l@subsubsection{\@dottedtocline{3}{7em}{1.2em}} - - -\newcommand{\exAeBBlogPDF}[2][\urlAcroTeXBlog/]{\par\ifdim\lastskip>0pt\relax\vskip-\lastskip\fi -\vskip\medskipamount\noindent\makebox[0pt][r]{% - \makebox[0pt][l]{\textcolor{blue}{\Pisymbol{webd}{254}}}% - \raisebox{-2pt}{\color{red}\href{#1?#2}{{\zqacr b\hspace{9.5pt}}}}\enspace}\ignorespaces} - -\newcommand{\exAeBBlogArticle}[2][\urlAcroTeXBlog/]{\par\ifdim\lastskip>0pt\relax\vskip-\lastskip\fi -\vskip\medskipamount\noindent\makebox[0pt][r]{\makebox[0pt][l]{\hspace{-1pt}\textcolor{blue}{\Pisymbol{webd}{254}}}% -\raisebox{.5pt}{\color{red}\href{#1?#2}{\ding{045}}\hspace{7.5pt}\enspace}}\ignorespaces} -\definePath{\urlAcroTeXBlog}{http://www.acrotex.net/blog} - -\renewcommand*\descriptionlabel[1]{\hspace\labelsep - \normalfont #1} -\newcommand{\aebDescriptionlabel}[1]{% - \setlength\dimen@{\amtIndent+\labelsep}% - {\hspace*{\dimen@}#1}} -\makeatother -\newenvironment{aebDescript} - {\begin{list}{}{\setlength{\labelwidth}{0pt}% - \setlength{\leftmargin}{\leftmargin}% - \setlength{\leftmargin}{\leftmargin+\amtIndent}% - \setlength\itemindent{-\leftmargin}% - \let\makelabel\aebDescriptionlabel - }}{\end{list}} - -\def\hardspace{{\fontfamily{cmtt}\selectfont\symbol{32}}} -\def\AcroBlog{{Acro\!\TeX} Blog} -\newlength{\aebdimen} -\def\anglemeta#1{$\langle\textit{\texttt{#1}}\rangle$} -\def\meta#1{\textit{\texttt{#1}}} -\let\pkg\textsf -\let\env\texttt -\let\opt\texttt -\let\app\textsf -\def\AEB{\textsf{AeB}} -\def\AcroTeX{Acro\!\TeX} -\def\HTML{HTML}\def\FDF{FDF} -\def\PDF{PDF}\def\URL{URL} -\let\amtIndent\leftmargini -\def\bNH{\begin{NoHyper}}\def\eNH{\end{NoHyper}} -\def\nhnameref#1{\bNH\nameref{#1}\eNH} -\def\nhNameref#1{\bNH\Nameref{#1}\eNH} -\def\nhurl#1{\bNH\url{#1}\eNH} -\def\grayV#1{\textcolor{gray}{#1}} -\def\darg#1{\{#1\}} -\def\parboxValign{t} -\renewcommand*{\backrefalt}[4]{% - \ifcase #1\or - See page~#2.\else See pages~#2.\fi -} -\newenvironment{aebQuote} - {\list{}{\leftmargin\amtIndent}% - \item\relax}{\endlist} -\newcommand{\FmtMP}[2][0pt]{\mbox{}\marginpar{% - \raisebox{.5\baselineskip+#1}{% - \expandafter\parbox\expandafter[\parboxValign]% - {\marginparwidth}{\aebbkFmtMp#2}}}} -\def\aebbkFmtMp{\kern0pt\itshape\small - \ifusebw\color{gray}\else\color{blue}\fi - \raggedleft\hspace{0pt}} -\def\dps{$\mbox{$\mathfrak D$\kern-.3em\mbox{$\mathfrak P$}% - \kern-.6em \hbox{$\mathcal S$}}$} -\def\FitItIn{\eq@fititin} -\def\endredpoint{\FitItIn{{\large\ifusebw\color{black}\else\color{red}\fi$\blacktriangleleft$}}} - - -%\makeindex - -\title{The \texorpdfstring{\textsf{eqexam} Package\\}{eqexam Package, } -part of the\texorpdfstring{\\Acro\TeX}{AcroTeX} eDucation Bundle} -\author{D. P. Story} -\subject{% - A LaTeX package for creating Test, quizzes, both for paper and for - online use; supports writing problems sets for textbook authors.% -} -\keywords{LaTeX, hyperref, PDF, exercises, quizzes} -\university{{\AcroT} Software Development Team} -\email{dpstory@acrotex.net} -\version{v4.9, 2017/03/16} -\copyrightyears{2005-\the\year} - -\chngDocObjectTo{\newDO}{doc} -\begin{docassembly} -var titleOfManual="The eqexam Manual"; -var manualfilename="Manual_BG_Print_eqexam.pdf"; -var manualtemplate="Manual_BG_Brown.pdf"; // Blue, Green, Brown -var _pathToBlank="C:/Users/Public/Documents/ManualBGs/"+manualtemplate; -var doc; -var buildIt=false; -if ( buildIt ) { - console.println("Creating new " + manualfilename + " file."); - doc = \appopenDoc({cPath: _pathToBlank, bHidden: true}); - var _path=this.path; - var pos=_path.lastIndexOf("/"); - _path=_path.substring(0,pos)+"/"+manualfilename; - \docSaveAs\newDO ({ cPath: _path }); - doc.closeDoc(); - doc = \appopenDoc({cPath: manualfilename, oDoc:this, bHidden: true}); - f=doc.getField("ManualTitle"); - f.value=titleOfManual; - doc.flattenPages(); - \docSaveAs\newDO({ cPath: manualfilename }); - doc.closeDoc(); -} else { - console.println("Using the current "+manualfilename+" file."); -} -var _path=this.path; -var pos=_path.lastIndexOf("/"); -_path=_path.substring(0,pos)+"/"+manualfilename; -\addWatermarkFromFile({ - bOnTop:false, - bOnPrint:false, - cDIPath:_path -}); -\executeSave(); -\end{docassembly} - -\begin{document} - -\maketitle - -\tableofcontents - -\section{Forward} - -For the past several years (this year is 2016), I've been writing a book -titled, -\begin{quote} -\AEBBook. -\end{quote} -The book~\cite{book:AEBB} covers {\AEB}, which includes the \pkg{eforms} -package, and {\AEBP} in \emph{great detail} and includes many examples to -illustrate concepts and techniques. Numerous new examples are available on -the CD-ROM that accompanies the book. - -During the time of the writing, each of the packages covered was examined, -bugs were fixed, and many new and major features were created. Any new -features developed in the course of writing the book are documented in the -book; however, they are \emph{not included in this documentation}. You can -either buy the yet-to-be-submitted book sometime in the future, or discover -the features by studying the DTX documentation of the program files. Sorry, -it took me three years to write the book, I don't want to spend another year -on this documentation. \verb!:-{)! - -\begin{flushright} -Dr. D. P. Story\\[3pt] -January 16, 2016 -\end{flushright} - -\section{Introduction} - -In my classroom work at The University of Akron, I've been using a -personal {\LaTeX} package, which is called \textsf{eqexam}, for creating -my in-class tests, quizzes, homework assignments, and review documents -(pre-tests/sample tests). In recent weeks---at the end of the Fall -Semester, 2004, and prior to the Spring Semester, 2005, I have filled the -mundane and boring days with work on \textsf{eqexam}, fixing and enhancing -it quite a bit. - -The \textsf{eqexam} package is a stand-alone for {\LaTeX}, but is also -tightly integrated with the {\cAcroEB}. \textsf{eqexam} will be -distributed by itself, as well as a part of the {\cAcroB}. The integration -with the {\AcroB} gives it many of the online features that users of the -Bundle are familiar with. - -\newtopic (Version 3.0 or later) The method of formatting an \textsf{eqexam} -document has changed, each \texttt{problem}/\texttt{problem*} environment -is now in a list environment, the \texttt{eqequestions} environment. This -environment is not normally used by the document author, but its -parameters may be redefined. The purpose of this reformatting, is to open -up \textsf{eqexam} for use by other packages. Textbook authors can now, I -hope, easily integrate \textsf{eqexam} into the custom book format -being used. - -\newtopic Let's have an overview of the package, with suggestions for -possible uses. -\begin{enumerate} - \item The first, and most obvious application of this package - is to create a \textcolor{blue}{pExam} or a - \textcolor{blue}{pQuiz}. (Here, the `\textcolor{blue}{p}' - prefix refers to \underline paper or \underline pulp; thus, we - can use \textsf{eqexam} to write paper Exams and/or pulp - Quizzes). You can write the questions and the solutions, and - publish (i.e., print the document on a printer) the exam/quiz - with no solutions---ready to be taken in class---, or {\LaTeX} - the source document with solutions listed after each question - to create an answer key, for your personal use, or for the use - by the class. - - \item So much for pulp. Now on to `\textcolor{blue}{e}' (for - electronic publication). In some of my classes, I put sample - questions (review tests) on the web as {\PDF} documents. In - this case, you can create a {\PDF} document without the - solutions, and give the class time to solve the problems; then - publish the document (in {\PDF} on the web) with solutions. - The solutions can appear immediately after the questions, or - can be accumulated at the end of the document. - - \item[] In the case where the solutions are at the end of the - document, you can add links from the question to the solution. - - \item[] Documents can be published with color (to enhance the - on screen appearance) or can be published in black and white, - meant to be printed. Or, you can do both: a screen - version and a paper version. - - \item By invoking the \texttt{online} option, the white space - left for hand-written answers to the questions become Acroform - multi-line text fields, multiple choice questions become radio - buttons, and fill-in questions also become text fields. The - student can bring up the exam, and take it at a computer (in a - CBT\footnote{Computer Based Testing.} lab). After the student - is finished, he/she can print out the exam, and submit it to - the instructor for traditional grading. - - \item Now, here is an exciting feature of the \textsf{eqexam} - package, that of email submittal! This feature is not too - useful for technical fields (i.e., mathematics related fields) - that require students to enter special symbols, but for some - academic disciplines (English, History, Sociology, Politics - and Government, etc.) this feature could be quite - exciting.\footnote{Of course, I am addressing now the some six - people worldwide in these fields that use {\LaTeX} and \PDF! - For you six, this feature is for you!} - - \item[] When you take the \texttt{email} option of - \textsf{eqexam}, as with the \texttt{online} option, the white - space left for hand-written answers to the questions become - Acroform multi-line text fields, multiple choice questions - become radio buttons, and fill-in questions also become text - fields. Additionally, a button is automatically provided to - submit by email the results of the test to the instructor. The - results arrive at the instructor's mailer as an {\FDF} - attachment. The instructor can open the {\FDF} and view in the - originating {\PDF} the responses given by the student. - - \item[] The instructor can print out the document and grade in - a traditional way, or if the instructor has - \textbf{Acrobat~Pro} or \textbf{Standard}, the instructor can - use mark-up annotations within the PDF, save a copy of the - students test to a class folder, and email a copy of the - students exam, marked up with grade.\footnote{Seems doubtful - that anyone at this time has the expertise to do this! But - it's available if anyone ever wants it.} - - \item[] If the exam is given for credit, it can be taken in a - secure lab. - - \item Perhaps a more reasonable application of this email - submission feature of \textsf{eqexam} is the building and - publication of surveys and questionnaires! Perhaps - teacher evaluations! The environments of \textsf{eqexam} can - be easily used to write surveys and questionnaires to - solicit the opinion of a target population. Responses are - emailed to the designated person, who can summarize them. - - \item[] By the way, speaking of summarizing results, a new - feature of \textbf{Acrobat Pro~7.0}, allows you to take a - folder of {\FDF} files, such as the ones created by email - submission, and extract all form fields and place results to a - comma-delimited file (\texttt{.csv}). This comma-delimited - file can be opened by a spreadsheet program and manipulated. - Cool. - - \item (08/05/11) Version 3.0 of \textsf{eqexam} has a major option, - \texttt{fortextbook},\footnote{The \texttt{fortextbook} option is briefly - described on page~\pageref*{fortextbook}.} designed to support (U.S.) - textbook authors. Documentation for this option is found in the - \texttt{doc/fortextbook} folder. See also the series of blogs at the - \ulSetLink{http://www.acrotex.net/blog/?tag=fortextbook}{{Acro\TeX} Blog}. - -\end{enumerate} - -%\subsection{What's New} -% -%\begin{enumerate} -% -% \item (Version 1.7) Added the ability to randomize items in a -% multiple choice/selection list. See \Nameref{s:random} and the -% \texttt{allowrandomize} option, as listed in \Nameref{eqoptions}. -% -% \item (Version 1.6) In this version, I've added the command -% \cs{thisterm} (see \Nameref{preamble}) and expanded the control of -% multiple versions. Now you can have up to $26$ versions of the same -% test! For details of this new multiple version scheme, see the -% discussion in \Nameref{mutiVerNew}. -% -% \item[] Also added are \cs{forproblem} and \cs{foritem}. See \mlNameref{solnSets}. -% -% \item (Version 1.4) Added a \texttt{manswers} environment for -% multiple choice questions where multiple selections are permitted. -% \textsf{Exerquiz} version 6.04 or greater is required with the -% \texttt{online} and \texttt{email} options. See the section -% \Nameref{multiSelect} for details. -% -% \item (Version 1.3) Added in the \cs{bChoices} and -% \cs{eChoices} pair for specifying multiple choice -% alternatives. See the brief discussion in -% the section \Nameref{multichoice}. -%\end{enumerate} - -\section{Required and Optional Packages} - -The following packages that are not part of the normal {\LaTeX} -distribution are \emph{required}: -\begin{enumerate} -\item \texttt{calc}: Used for calculation of the position of the - marginal points. - -\item \texttt{pifont}: Used when the \texttt{proofread} option is - used to indicate the correct answers to multiple choice questions. - -\item \texttt{comment}: Used to have optional content, useful for - developing exams for multiple sections of the same class. - -\item \texttt{multicol}: Used to create questions in multi-column mode. - -\item \texttt{verbatim}: Used to write solutions to the hard drive. -\end{enumerate} - -\noindent Additionally, the following packages may be used -depending on the options chosen: -\begin{enumerate} -\item \texttt{web}: Used when the \texttt{pdf}, \texttt{links}, - \texttt{online} or the \texttt{email} option is taken. - -\item \texttt{exerquiz}: Used when the - \texttt{links}, \texttt{online} or the \texttt{email} option is - taken. -\end{enumerate} -Of course, \texttt{web} and \texttt{exerquiz}, in turn, input a -whole plethora of packages. Consult the documentation for the -\cAcroEB. - -\section{Installing \textsf{eqexam}} - -Create a folder in your \texttt{latex} search path named -\textsf{eqexam} and place the package files \texttt{eqexam.dtx}, -\texttt{eqexam.ins}, \texttt{eqexam.def} and any \texttt{.cfg} -files. (If you have an \texttt{acrotex} folder, you can place the -files there as well.) - -Next, \texttt{latex} \texttt{eqexam.ins} to create -\texttt{eqexam.sty} and \texttt{eqalone.def}. The other files -(\texttt{*.tex} and \texttt{*.pdf}) can be placed anywhere. - -The \textsf{eqexam} is a stand alone package that is tightly -integrated with the \cAcroB. The file \texttt{eqexam.def} comes -from the {\cAcroB} to provide the necessary support for many of -the commands and environments defined in \textsf{eqexam}. The file -\texttt{eqalone.def} are miscellaneous definitions that are needed -for the stand-alone version. When you choose one of the options -\texttt{links}, \texttt{online} or \texttt{email}, then -\textsf{Exerquiz} is included in the package files. When you use -one of these options you will need the most recent version of the -\cAcroEB, the one published concurrently with this package. - -\section{Demonstration files} - -\exAeBBlogPDF{cat=107} The original -\href{\urlAcroTeXBlog/?cat=107}{\pkg{eqexam} demonstration files} are posted -on the \href{\urlAcroTeXBlog/}{{Acro\TeX} Blog}. Throughout the manual, individual -files are references and a link is provided to that resource. The source file is attached -to all PDFs on the {Acro\TeX} Blog website. - -\exAeBBlogPDF{tag=eqexam-package} -Additional demonstration files developed after the original set are also available -from the {Acro\TeX} Blog. See the articles tagged as -\textit{\href{\urlAcroTeXBlog/?tag=eqexam-package}{eqexam-package}}. - -%http://www.acrotex.net/blog/?tag=eqexam-package - - -\section{Page Layout Considerations} - -With Version~3.0, you can design your own page layout scheme, perhaps to -conform to a book style. The following are some basics on formatting for -\textsf{eqexam}. - -The following two commands appear in \textsf{eqexam}, the first sets some basic -page parameters. -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\newcommand{\eqeSetExamPageParams}{% - \setlength{\headheight}{12pt} - \setlength{\topmargin}{-.5in} - \setlength{\headsep}{20pt} - \setlength{\oddsidemargin}{0pt} - \setlength{\evensidemargin}{0pt} - \setlength{\marginparsep}{11pt} - \setlength{\marginparwidth}{35pt} - \setlength{\footskip}{11pt} -} -\end{Verbatim} -The second command calculates values for \cs{textwidth} and \cs{textheight} -based on the the settings of the first command. -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\newcommand{\eqExamPageLayout}{% - \setlength\textwidth\paperwidth - \addtolength{\textwidth}{-2in} - \addtolength{\textwidth}{-\oddsidemargin} - \setlength\textheight{\paperheight} - \addtolength\textheight{-2in} - \addtolength\textheight{-\headheight} - \addtolength\textheight{-\headsep} - \addtolength\textheight{-\topmargin} - \addtolength\textheight{-\footskip} -} -\end{Verbatim} -When the package option \texttt{usecustomdesign} \textit{is not taken,} -then the two commands \cs{eqeSetExamPageParams} and \cs{eqExamPageLayout} -are executed immediately after the above definitions. These are the -original parameters used by \textsf{eqexam}, designed to yield a maximum -text body in which to typeset an exam. The margins are set at 1 inch, the -\cs{topmargin} is raised up, all to maximize space. - -Now, if the package option \texttt{usecustomdesign} is specified, the -commands \cs{eqeSet\-Exam\-Page\-Params} and \cs{eqExamPageLayout} are \emph{not -executed}, the package designer can either do a \cs{renewcommand} for -these two commands in the preamble with custom values inserted (and -execute \cs{eqeSetExamPageParams} and \cs{eqExamPageLayout}), or the -designer may use another package to set the page layout parameters (or -take the default of the class being used). In the latter case, -neither \cs{eqeSetExamPageParams} nor \cs{eqExamPageLayout} should be executed. - -\newtopic The following commands directly effect how the problems are -displayed within an \textsf{eqexam} environment. - -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\eqexammargin{\normalsize\normalfont\bfseries00.\ } -\end{Verbatim} -The command \cs{eqexammargin} is a convenient way of specifying the -\cs{labelwidth} as set by the \texttt{eqequestions} environment (see -below). The command uses \cs{settowidth} to set the \cs{eqemargin} length. -The \cs{eqemargin} may also be set directly with \cs{setlength}. -\cs{eqexammargin} can be executed anytime between exam environments (or -even between problems, though this is not a intuitive option). Normally it -is executed once for the entire document; but may be executed multiple -times to change margins. - -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\newcommand{\widthtpboxes}{35pt} -\end{Verbatim} -This command sets the width of the boxes that appear in the right margin -when one of more of the options \texttt{pointsonright}, -\texttt{pointsonboth}, \texttt{totalsonleft}, \texttt{totalsonright}, are -used. These boxes are used for exams, and not relevant for problem sets of -textbooks. Normally, this parameter is not redefined. - -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\newenvironment{eqequestions}{% - \begin{list}{}{% - \setlength{\labelwidth}{\eqemargin}% - \setlength{\topsep}{3pt}\setlength{\parsep}{0pt}% - \setlength{\itemindent}{0pt}\setlength{\itemsep}{3pt}% - \setlength{\leftmargin}{\labelwidth}% - \settowidth{\labelsep}{\ }% - }\item\relax}{\end{list}} -\end{Verbatim} -This environment is opened at the beginning of a \texttt{problem} -(\texttt{problem*}), and closed at the end of these environments. - -\section{Building an Exam} - -In this section, we outline the steps to create an exam using the -\textsf{eqexam} package. Consult the sample exams for additional -examples. - -\subsection{The Preamble}\label{preamble} - -Of course, we begin with the standard article class, and the -\textsf{eqexam} package: -\begin{Verbatim}[xleftmargin=\leftmargini,commandchars=!()] -\documentclass{article} -\usepackage[!meta(options)]{eqexam} -\end{Verbatim} -\noindent The \meta{options} are discussed in -section~\ref{eqoptions}. Next comes a exam identification -information: -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\title[T1]{Test 1} -\subject[C1]{Calculus I} -\author{D. P. Story} -\keywords{Calculus I, Section 004} -\university{% - THE UNIVERSITY OF AKRON\\ - Mathematics and Computer Science -} -\date{\thisterm, \the\year} -\duedate{October 17, 2005} -\end{Verbatim} -\noindent The \cs{title}, \cs{subject}, \cs{author} and \cs{date} -are the same as is used in the \textsf{web} package. These are -used by the standard {\LaTeX} macro to create the heading line of -the first page of the exam, and are used in the running headers. - -The \cs{title}, \cs{subject} have optional first arguments, where -you can list a shorted version of the title or the subject. The -shortened versions, if present, are used in the running headers. - -The \cs{keywords} is used when you publish your exam in {\PDF} and -you use the \texttt{pdf} option (or \texttt{online}, \texttt{links}, -\texttt{email}). The value of the argument of \cs{keywords} appears -in the keywords field of the document info dialog. - -When you take the \texttt{coverpage} option, the value of -\cs{university} is used, along with some of the others on the -cover page. - -I've also defined a keyword of \cs{duedate}, this might be useful -when using \textsf{eqexam} to create homework assignments with a -due date, or just to record the date of the exam. The argument of \cs{duedate} fills the text macro -\cs{theduedate}. So that if you say \verb|\duedate{05/31/06}|, the macro -\cs{theduedate} will expand to `05/31/06'. - -\newtopic Beginning with version~1.6, \cs{thisterm} is defined. -The academic year of many American universities are divided into semesters -(or terms); Fall, Spring, and Summer. The command \cs{thisterm} takes the current -date and determines if it is the Fall, Spring or Summer Semester. For example, -if the date of the compile is October 17, 2005, then \verb!\thisterm, \the\year! -expands to `Fall, 2005'. This command is useful with the \cs{date} command. - -The command \cs{thisterm} can be redefined to conform to the terms -of the document author's university. See the definition in -\texttt{eqexam.dtx}, copy and modify it. - -\subsection{The \texttt{exam} Environment}\label{exam} - -An exam is contained within the \texttt{exam} environment. - -One of the things that I do in my courses, especially for the -final exam, is to have a two-part exam. Typically, the first part -is worth $100$ points and covers the new material not already -tested; the second part is usually a $50$ point review. I grade -these two parts separately and record them separately. Therefore, -an \textsf{eqexam} test may contain one or more \texttt{exam} -environments.\footnote{Remember, this was originally a personal -package, meant to suit my own needs.} - -\newtopic After the preamble, we then say -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{document} - -\maketitle - -\begin{exam}[Part I.]{Part1} - -\begin{instructions}[Part I.] -Solve each of the problems without error. If you make an error, -points will be subtracted from your total score. -\end{instructions} -... -... -... -\end{exam} - -\begin{exam}[Part II.]{Part2} - -\begin{instructions}[Part II.] -The following is a short review of previously mastered material. -\end{instructions} -... -... -... -\end{exam} -\end{document} -\end{Verbatim} -After the \verb+\begin{document}+ and standard \cs{maketitle}, we begin an -exam by opening an \texttt{exam} environment. - -\settowidth{\aebdimen}{\ttfamily\string\begin\darg{exam}[\meta{friendly\_name}]\darg{\meta{exam\_name}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\begin{exam}[!meta(friendly_name)]{!meta(exam_name)} -... -\end{exam} -\end{dCmd} -\noindent This environment has two arguments: the first optional, the second -required. The first argument is a user friendly name (used when the solutions -are listed at the end of the document when there are multiple \texttt{exam} -environments); the second required argument is the name of the of the exam, -\texttt{Part1} or \texttt{Part2}, for example. This argument is used to build -the names of the PDF Acroform field names. This argument should consist of -letters and numbers only. You can use the command \cs{autoExamName} for the -\meta{exam\_name}; this command will name each \texttt{exam} environment -\texttt{exam1}, \texttt{exam2}, \texttt{exam3}, etc. - -Following the opening of the exam, typically, the instructor would have -some instructions, this is the purpose of the \texttt{instructions} -environment. It has one optional argument, heading text for the -instructions; if this optional parameter is not provided, then the default -word is used, the default word is determined by \cs{defaultInstructions}, -its default definition is -\begin{Verbatim}[xleftmargin=\leftmargini] -\defaultInstructions{Instructions.} -\end{Verbatim} -Following this label, the total number of points for this part is -inserted, unless the \texttt{nosummarytotals} option is taken. - -\redpoint The optional argument of the \texttt{instructions} -environment has a color associated with it, and is visible when you -compile the document with the \texttt{forcolorpaper} option. This -color can be set by the command \cs{instructionsColor}; this command -takes a single argument, a named color: -\begin{Verbatim}[xleftmargin=\leftmargini] -\instructionsColor{blue} -\end{Verbatim} -\noindent The above is the default definition. - - -\newtopic At this point, you would insert your questions. Following the -listing of all the questions (and optionally, their solutions), you -finish up by closing out the \texttt{exam} environment. - -Repeat, if additional parts to the exam are desired. Finally, -finish off the document with \verb+\end{document}+. - -\redpoint You must \texttt{latex} your document \emph{three times} to be -sure all points have been properly calculated. - -\subsection{The \texttt{problem} and \texttt{problem*} Environments} - -All questions are posed using the \texttt{problem} and -\texttt{problem*} environments. The former is for a single -question, the latter is for a question with multiple parts. - -\subsubsection{\texttt{problem}}\label{problem} - -The \texttt{problem} encloses a single question; the question -itself may contain special constructs such as one or more fill-in -the blanks. - -The syntax for \texttt{problem} is -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont, - commandchars=!()] -\begin{problem}[!meta(num)|*!meta(num)|empty][h|H] -!anglemeta(Statement of question, which may contain special constructs) -... -... -\begin{solution}[!meta(vspace)] -... -... -\end{solution} -\end{problem} -\end{Verbatim} -\noindent The environment takes two optional arguments. The first -argument \meta{num} is the number of points for this problem, for -example, if we want to have a $5$ point question, we would begin the -environment like so, \verb+\begin{problem}[5]+; on the other hand, if we -say \verb+\begin{problem}+, the problem has no points associated with it. -If you specify points weight for a problem, the points appear in the -margins (when one of the option \texttt{pointsonleft}, -\texttt{pointsonright}, or \texttt{pointsonboth} is specified); if the -\texttt{*} form is specified (\meta{*num}), the point weight appears -``in-line,'' just after the problem number; thus, typesetting a problem -with the specification \verb!\begin{problem}[*5]! yields -\begin{quote} -\textbf{1.} (5 pts) \dots -\end{quote} -This is useful when the problems are put into a two-column format; the -problems in the right-hand column do not have the margin to hold the -points, in this case, we place the points ``in-line.'' - -\newtopic The \texttt{problem} is actually a redefined \texttt{exercise} -environment, as defined in \textsf{exerquiz}. The second parameter -is inherited from the \texttt{exercise} environment. The second -argument can optionally be an \texttt{h} or a \texttt{H}. - -Use \texttt{h} if you do not want the solution to appear at the -end of document (when you do not use the \texttt{nosolutions} or -the \texttt{solutionsafter} options); the solution, however, will -appear if the \texttt{solutionafter} option is specified. - -For the \texttt{H} argument, the solution will not appear at the -end of the document (just as in \texttt{h}), nor will it appear if you -specify the \texttt{solutionsafter} option. - -To make things work correctly, if you do not want to have points -for a question and want to hide the solution, use `\texttt{[]}' -(empty brackets with no spaces) for the first argument. -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem}[][H] -($5$ Points Extra Credit) Solve this problem for extra credit. -\begin{solution} -This solution will not appear in all cases, unless the second -parameter is eliminated or is changed to h, in the latter case, -the solution appears just for \texttt{solutonsafter}. -\end{solution} -\end{problem} -\end{Verbatim} -\noindent Here, this problem has no points that will be added into -the total number of points for the test. - -The \texttt{solution} environment encloses the solutions. This environment -is optional. The environment takes one optional parameter, namely the -vertical space to leave for the student to work the problem. This vertical -space is \emph{created only} when the document author takes the -\texttt{nosolutions} option. For example, -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem}[10] -Do this problem. -\begin{solution}[2in] -This is the solution. -\end{solution} -\end{problem} -\end{Verbatim} -\noindent This defines a $10$ point problem and leaves $2$ inches -of vertical space following the problem statement for the student -to respond, provided the \texttt{nosolutions} option has been taken. - -Be aware that the solution environment searches for its optional -parameter, and will expand macros looking for a left bracket (\texttt{[}). -In documents where the optional parameter is not used; this can lead to -problems in compiling. For example, if you say, -\verb!\begin{solution} \textbf{My solution:}...!, the command \cs{textbf} -will be expanded prematurely and result in `My solution' not appearing in -bold. Similarly, if you write \verb!\begin{solution} \begin{equation}...! -can lead to compilation stopping. Suggested workarounds: -\begin{itemize} - \item Supply empty brackets: \verb!\begin{solution}[]! - \item Use \cs{relax}: \verb!\begin{solution}\relax\textbf{...}!. - The \cs{relax} should not be on the line by itself. -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{solution}\relax % Not this -\textbf{...} -... -\end{Verbatim} -The above causes an unwanted newline. The next two examples show the -``correct'' method. -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{solution}\relax\textbf{...} % correct -... -\end{Verbatim} -\noexpand The \cs{relax} appearing on the second line. -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{solution} -\relax\textbf{...} % correct -... -\end{Verbatim} -\end{itemize} -If you have no need for the vertical space in your document and putting in -these workarounds is too much trouble, you can use a global solution. Use -\cs{noSolnOpt} to globally turn off the check for the option parameter by -the \texttt{solution} environment; \cs{ckSolnOpt} turns on parameter -checking (the default). To summarize: -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\ckSolnOpt % turn on checking for the optional argument (the default) -\noSolnOpt % turn off checking for the optional argument -\end{Verbatim} -Place either of these two commands between problems to turn off (or back on) the -parameter checking. - -\redpoint See \Nameref{eqoptions} for more details on -the two options \texttt{nosolutions} and \texttt{solutionsafter}. - -\subsubsection{\texttt{problem*}}\label{problemstar} - -This environment is used when you want to ask a multi-part -question, a series of related questions that are to be treated as -a group. - -The syntax is -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont, - commandchars=!()] -\begin{problem*}[!meta(num)|!anglemeta(num)ea|\auto|empty][\Do!anglemeta(do_num)] -Do each of the following problems, and be quick about it. -\begin{parts} - -\item[h|H] The first question. -\begin{solution}[1.5in] -This is the solution to the first problem. -\end{solution} - -\item[h|H] The second question. -\begin{solution}[3in] -This is the solution to the second problem. -\end{solution} - -\end{parts} -\end{problem*} -\end{Verbatim} -The \texttt{problem*} environment takes two optional parameters, -the first one takes one of four values: -\begin{aebDescript} - \item[\meta{num}] When the value of the first parameter is - a number, this represents the total number of points for this - multi-part question. Here, the instructor does not specify the - weight of each part. - - \item[\meta{*num}] The points appear ``in-line'' rather than - in the margin. - - \item[\anglemeta{num}\texttt{ea}] When you specify a number followed by - `\texttt{ea}' (which is short for \underbar{ea}ch). Thus, - `\texttt{[5ea]}' signifies that each part of this problem has - weight of $5$ points. - - \item[\texttt{*\anglemeta{num}ea}] The points appear ``in-line'' rather than - in the margin. - - \item[\cs{auto}] If the value of the first parameter is - \cs{auto}, then the total number of points is calculated - automatically from the points defined by the \cs{PTs} macro. - The \cs{PTs} would be placed following \cs{item} of each part - that is to be given points. For example: - - \item[*\cs{auto}] The points appear ``in-line'' rather than - in the margin. - -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem*}[\auto] -Do each of the following problems, and be quick about it. -\begin{parts} - -\item\PTs{3} The first question. -\begin{solution}[1.5in] -This is the solution to the first problem. -\end{solution} - -\item\PTs{4} The second question. -\begin{solution}[3in] -This is the solution to the second problem. -\end{solution} - -\end{parts} -\end{problem*} -\end{Verbatim} -This defines a $7$ point problem. - -\item[\texttt{empty}] You need not specify any points at all. In -this case do not include this first parameter, in which case, the -second parameter is not used, so don't include it either. - -\end{aebDescript} - -\noindent Now for a description of the second parameter the -\texttt{[\cs{Do}\anglemeta{do\_num}]} parameter. In my senior- or graduate-level -classes, I sometimes ask a questions with multiple parts. As part -of the instructions for that problem I write, ``Do exactly three -of the following five problems.'' These questions are usually -proof-type problems, and they can choose their best three to -grade. In this context, all parts of the problem must be of the same -weight; the weight of each is \anglemeta{num} of the \texttt{[\anglemeta{num}ea]}. - -This is what \texttt{[\cs{Do}\anglemeta{do\_num}]} does. When you specify -\texttt{\cs{Do}3}, then only the points of $3$ of the problems are -added into the exam total. This second parameter is only checked -if the first parameter is \texttt{[\anglemeta{num}ea]}. For example, -specifying -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem*}[5ea][\Do3] -\end{Verbatim} -creates a $15$ point question. This assumes there are $3$ or -more parts to this question. - -By the way, there are two macros that are defined when the \cs{Do} -is used, they are \cs{DoNum} and \cs{OutOfNum}; these expand to -the (English) word for the number of problems to do, and the -(English) word for the total number of problems. For example, if -there were five parts to the problem below,\dots -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem*}[5ea][\Do3] -Solve exactly \textit{\DoNum} of the following {\OutOfNum} -problems. .... -\end{problem*} -\end{Verbatim} -\noindent The instructions would read, ``Solve exactly -\textit{three} of the following five problems.'' These macros can -be easily redefined to reflect other languages. The numbers -themselves are contained in the two macros \cs{nDoNum} and -\cs{nOutOfNum}. - -\redpoint \texttt{parts} and \cs{item}: For a multi-part problem -(\texttt{problem*}), the actual problems are enclosed in a -\texttt{parts} environment, and each question is posed as an -\cs{item} of that \texttt{list} environment. The command \cs{item} -takes the \texttt{[h|H]} optional argument. As in the case of the -\texttt{problem} environment, \texttt{h} prevents the solution -from appearing at the end of the document (but it appears with -\texttt{solutionsafter}), and \texttt{H} removes the solution in -all cases. - -\paragraph{\texorpdfstring{\cs{leadinitem}}{\CMD{leadinitem}}} -When using the \texttt{problem*} environment, there is an introductory sentence -that sets up the multi-part problem set. For various reasons, some authors -have asked to be able to pose multi-part questions without the -introductory sentence. This is harder request than it sounds, but now -there is the \cs{leadinitem} command. Study the code below. - -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem*}[\auto] -\leadinitem\PTs{3} The first question. -\begin{solution}[1.5in] -This is the solution to the first problem. -\end{solution} - -\begin{parts} -\item\PTs{4} The second question. -\begin{solution}[3in] -This is the solution to the second problem. -\end{solution} -... -\end{parts} -\end{problem*} -\end{Verbatim} -There is no introductory sentence. The problem starts off with -\texttt{\cs{leadinitem}\cs{PTs\{3\}} The first question}; this problem -is stated outside of the \texttt{parts} environment. The rest of the parts -to this problem are listed, as usual, from within the \texttt{parts} environment. -Only one \cs{leadinitem} is allowed per \texttt{problem*} environment. - -\newtopic The results of this code is viewed as follows, when typeset. - -\bigskip -\noindent\hfill\begin{minipage}{\linewidth-2\leftmargini} -\noindent\llap{($10^{\text{pts}}$)\quad}\textbf{1.}\ (a)\ The first question.\\[3pt] -\phantom{\textbf{1.}\ }(b)\ The second question.\\[3pt] -\phantom{\textbf{1.}\ }\dots -\end{minipage} -\bigskip - -The general syntax for \cs{leadinitem} is the same as that of the \cs{item} command within the -\texttt{parts} environment; \verb!\leadinitem[h|H]!, \texttt{h} prevents the solution -from appearing at the end of the document (but it appears with -\texttt{solutionsafter} or with \texttt{answerkey}), and \texttt{H} removes the solution in -all cases. - -\subsubsection{Page Breaking} - -The \texttt{exam}, \texttt{problem} and \texttt{problem*} -environments use a (simple) page breaking algorithm to move a -problem (or the beginning of an exam) to the next page. - -If an \texttt{exam} environment begins at the lower third of the -page, it is moved to the next page. You can influence this page -break by using \cs{fvsizeskip} just before the beginning of the -\texttt{exam} environment, like so, -\begin{Verbatim}[xleftmargin=\leftmargini] -\fvsizeskip{.4} -\end{Verbatim} -\noindent \cs{fvsizeskip} takes a decimal number between $0$ and -$1$. In the example above, the environment will move to a new page -if it begins in the lower \texttt{.4\cs{textheight}} of the page. The -default value is $.3$. - -There is a similar algorithm for \texttt{problem} and -\texttt{problem} but is measured as a multiple of -\cs{baselineskip}. If you place -\begin{Verbatim}[xleftmargin=\leftmargini] -\nbaselineskip{8} -\end{Verbatim} -\noindent just before a problem that appears near the bottom of -the page, then it will be moved to the next page if it is within -\texttt{8\cs{baselineskip}} of the bottom. The default for this -command is $6$. - -\medskip\noindent -The following are strategies for fitting the maximum -number of questions on the minimum number of pages. -\begin{enumerate} - \item \textbf{Moving: }Rearrange the order of the questions, - if a problem can't fit entirely on a page, you can - exchange or move a shorter problem to that place, and move the longer - problem to another page. - - \item \textbf{Tweaking: }Modify the space defined by the - \texttt{solutions} environment to fit a problem on the page that - is below it. - - \item \textbf{Placing work on back: }Using the - \hyperref[onbackofpage]{\cs{OnBackOfPage}} command, - page~\pageref{onbackofpage}, you can direct the student to - answer the question on the back of another page, and thus, - little space is needed to follow that - question. - - \item \textbf{Working on separate sheets: }Of course, for some - types of exams, the exam just contains the questions, and the - students answer the questions on separate sheets of paper. For - this, you can use the \texttt{nospacetowork} option. -\end{enumerate} - - -\subsection{Fill-in Questions} - -In this section we cover the various fill-in constructs. - -\subsubsection{Short Fill-in Questions} -For a question requiring one or more short fill-in responses, -\textsf{eqexam} has the \cs{fillin} command, the syntax is -\settowidth{\aebdimen}{\ttfamily\string\fillin[u|b]\darg{\meta{width}}\darg{\meta{answer}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\fillin[u|b]{!meta(width)}{!meta(answer)} -\end{dCmd} -The first optional parameter determines whether the fill-in is -underlined `\texttt{[u]}' or not `\texttt{[b]}', the default it to -underline the fill-in. The second is the amount of horizontal -space you want to leave for the student to write in the response. -The third argument is the correct answer. This correct answer -will appear when you compile the document with the -\texttt{answerkey} option. - -\redpoint An example of \cs{fillin}. - -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem}[5] -It is well known that \fillin{1in}{Newton} and \fillin{1in}{Leibniz} -are jointly credited as the founders of modern calculus. -\begin{solution} -It is well known that \underbar{Newton} and \underbar{Leibniz} -are jointly credited as the founders of modern calculus. -\end{solution} -\end{problem} -\end{Verbatim} - -\redpoint When you choose the \texttt{online} or \texttt{email} -option, \cs{fillin} generates a text field. - -When the \texttt{usexkv} option, and if the \textsf{xkeyval} package is available on the -system, \textsf{eqexam} extends the capability and control of \cs{fillin}. -See \begin{NoHyper}\Nameref{extendfillin}\end{NoHyper}. - -\subsubsection{True/False Questions} - -True and false questions are, of course, just a special case of -fill-in. A special command is available for true/false: -\settowidth{\aebdimen}{\ttfamily\string\TF[\meta{width}]\darg{\meta{answer}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\TF[!meta(width)]{!meta(answer)} -\end{dCmd} -\indent The required parameter, \meta{answer}, is the correct answer (e.g., -`T' or `F'). The macro creates an underlined blank space the width of which -is \meta{wide}. When the \meta{width} is \emph{not specified}, -\cs{defaultTFwidth} (default \texttt{30pt}) is used (and this value can be redefined). - -The \cs{TF} command behaves differently from the generic -\cs{fillin} command. Suppose you want to create a multi-part question -(using \texttt{problem*}) consisting entirely of true/false -questions. When an \cs{item} leads off with the \cs{TF} there are two possible -formatting options: This one: - -\begingroup\parskip6pt\parindent30pt - -\def\Item#1{\par\hangindent\parindent\indent\llap{#1\enspace}\ignorespaces}% -\parbox{4in}{\noindent - \Item{(a)}\underbar{\hspace{30pt}} Isaac Newton is considered to be one of - the founders of Calculus.} - -\medskip\noindent or this one:\medskip - - -\def\Item#1{\par\hangindent\parindent\indent\llap{#1\enspace}\ignorespaces} -\leavevmode\parbox{4in}{\Item{(a)}\underbar{\hspace{30pt}} Isaac Newton is considered to be one of - the founders of \hspace*{30pt} Calculus.} - -\endgroup - -\newtopic The first alignment is the default. To get the second -alignment, you need to set the value of \cs{fillinWidth} to the -common width value of the \cs{TF} fields. For example: -\begin{Verbatim}[xleftmargin=\leftmargini] -\fillinWidth\defaultTFwidth -\end{Verbatim} -\noindent When \cs{fillinWidth} is set to a positive length (the -common width of the \cs{TF} field), the second alignment above is -created. -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem*}[3ea] -\textit{True} or \textit{False}. - -\fillinWidth\defaultTFwidth - -\begin{parts} - - \item \TF{T} It is well known that Isaac Newton and - Gottfried Leibniz are jointly credited as the founders - of modern calculus. - ... - \item ... - ... -\end{parts} -\end{problem*} -\end{Verbatim} - -\redpoint \textbf{Important:} The example above demonstrates the -correct placement of \cs{fillinWidth}, just outside the -\texttt{parts} environment, before it has the time to set up -the paragraph shape of the environment. - -The change is only local to that \texttt{parts} environment. -The \cs{fillinWidth} command goes outside a \texttt{parts} -environment, and can cause strange results if executed within a -\texttt{parts} environment. Setting it to a \meta{width} value -other than the common width of the \cs{TF} fields will also create -bad formatting. - -\redpoint Just use \cs{fillinWidth} as illustrated in the above -example. - -\redpoint When you choose the \texttt{online} or \texttt{email} -option, \cs{TF} generates a text field. - -\subsubsection{Long Fill-in Questions} - -There is no special command for a longer response question, just -leave enough vertical white space for the student to respond, for -example, -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem}[5] -Do this problem -\begin{solution}[1.5in] -That's how you do it! -\end{solution} -\end{problem} -\end{Verbatim} -\noindent The above example leaves $1.5$ inches of vertical space to do the -work. - -\redpoint When you choose the \texttt{online} or \texttt{email} -option, this vertical space is changed into a multi-line text -field. - -\subsection{Multiple Choice}\label{multichoice} - -For multiple choice questions, we use the \texttt{answers} -environment. If the \texttt{online} or \texttt{email} option is -taken, the choices are made into radio button fields so that -\emph{only one alternative} can be chosen. When multiple selections -are permitted, the \texttt{manswers} environment can be used, see -\Nameref{multiSelect}. - -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem*}[\auto] Answer each of the following. -\begin{parts} %\sqLinks - \item\PTs{5} In what year did Columbus sail the ocean blue? - \begin{answers}{4} - \Ans0 1490 &\Ans0 1491\\ - \Ans1 1492 &\Ans0 1493 - \end{answers} - \item\PTs{6} In what year did Columbus sail the ocean blue? - \begin{answers}{1} - \Ans0 1490 - \Ans0 1491 - \Ans1 1492 - \Ans0 1493 - \end{answers} -\end{parts} -\end{problem*} -\end{Verbatim} -\noindent \textbf{Note:} No solutions are given for this problem. - -\redpoint Because the labels and values of the alternatives are -based on the alphabet, the number of alternatives is restricted to -twenty-six. - -The \texttt{answers} environment is borrowed from \texttt{exerquiz} and -operates the same way. The one required argument is the number of columns -to be used in displaying the alternative answers. If the number of columns -is $1$, a \texttt{list} environment is used, otherwise a \texttt{tabular} -environment is used. - -In the first item in the example above, we specify $6$ columns, -and must use tabular notation (separate columns with -`\texttt{\&}') and end rows with `\verb+\\+'. The second item in -the example above uses $1$ column, the tabular notation is not -needed, or used. - -The \cs{Ans} macro is used to designate which alternative is the -correct answer ($1$ for correct, $0$ for not correct). - -\subsubsection{Using \texorpdfstring{\cs{bChoices}/\cs{eChoices}} -{\CMD{bChoices}/\CMD{eChoices}}} -Beginning with Version 1.3, an alternate style of specifying the -alternatives is defined. A new pair of commands are defined: \cs{bChoices} -and \cs{eChoices}. These two enclose the alternatives like so: - -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{exam}{Exam1} -\begin{instructions} -Select the ``best'' answer and darken the corresponding oval on -your scantron sheet. -\end{instructions} -\begin{problem}[5] In what year did Columbus sail the ocean blue? - \begin{answers}{3} - \bChoices - \Ans0 1490\eAns - \Ans0 1491\eAns - \Ans1 1492\eAns - \Ans0 1493\eAns - \eChoices - \end{answers} -\end{problem} -\begin{problem}[5] In what year did Columbus sail the ocean blue? - \begin{answers}{1} - \bChoices - \Ans0 1490\eAns - \Ans0 1491\eAns - \Ans1 1492\eAns - \Ans0 1493\eAns - \eChoices - \end{answers} -\end{problem} -\end{exam} -\end{Verbatim} -\noindent Notice that the set of alternatives are the same, and -are specified in exactly the same way; the first question, -however, is a tabular environment with $6$ columns (the argument -of $6$ of the \texttt{answers} environment), the second question -is a list environment (since the argument \texttt{answers} -environment is $1$). Notice also that `\texttt{\&}' and -`\verb!\\!' are not used, and that each alternative is terminated -by \cs{eAns}. - -The \cs{bChoices} and \cs{eChoices} are creatures of the \textsf{exerquiz} -package, and are fully documented in the reference for the -\ulSetLink{http://www.math.uakron.edu/~dpstory/acrotex/aeb_man.pdf}{\cAcroB}. - - -\subsubsection{\texorpdfstring{\cs{sqForms} versus \cs{sqLinks}} -{\CMD{sqForms} versus \CMD{sqLinks}}} - -There are two styles of multiple choice: (1) enumerate the -alternatives using letters; (2) enumerate the alternatives using -boxes (that the student would check or fill-in). The default is (1), -but you can change the default to (2) by using the \texttt{useforms} -option. This styles can be locally changed by specifying the -\cs{sqLinks} or \cs{sqForms} commands. In the above example, the -\cs{sqLinks} command is commented out, but shows the correct -position for it to change to style (1), which I am calling -``links''. Within a multi-part, multiple choice set of questions, -you can change one item to ``links'' and the next to ``forms.'' -Changes are local as long as you place the commands, \cs{sqLinks} or -\cs{sqForms} within an environment (\texttt{parts}, -\texttt{problem}, or \texttt{problem*}). - -\subsubsection{Using Circles for Multiple Choice}\label{allowcirc4mc} - -Then the package option \texttt{allowcirc4mc} is used, the font standard -{\LaTeX} font \texttt{lcircle10} is loaded at which point \textsf{eqexam} -can use it to create circles, instead of rectangles, to indicate the parts -in a multiple choice (MC) question. To use circles in a multiple choice -question, execute the command, -\begin{Verbatim}[xleftmargin=\leftmargini] -\useCircForMC -\end{Verbatim} -prior to the MC question. - -\goodbreak - -To return to the use of rectangles, execute the command, -\begin{Verbatim}[xleftmargin=\leftmargini] -\useRectForMC -\end{Verbatim} -prior to the MC question. - -Both commands have a local context. If expanded inside a group, the -definition going into the group will hold on exit from the group. - -\subsubsection{Using \texorpdfstring{\cs{proofingsymbol}}{\CMD{proofingsymbol}} -and friends} - -By default, a check mark (\ding{52}) is used to indicate which of the -alternatives in a MC problem is correct; however, there are other -``proofing symbols'' that can be used. Below are two additional suggested -proofing symbols. - -\makeatletter -\font\eqe@lcir=lcircle10 at 10pt -\bgroup -\setbox0=\hbox{\eqe@lcir h} -\xdef\eqe@cirDiam{\the\wd0} -\@tempdima=.5\wd0 -\xdef\eqe@cirRadius{\the\@tempdima} -\egroup -\def\circGlyph#1#2{\hbox{\smash{\raisebox{\eqe@cirRadius}% - {\makebox[\eqe@cirDiam]{\llap{\rlap{\eqe@lcir#1}% - \hskip#2\relax}}}}}} -\makeatother - -\begin{Verbatim}[xleftmargin=\leftmargini,commandchars=!()] -\useCheckForProof (!normalfont Check !ding(52), the default) -\useCrossForProof (!normalfont Cross !ding(56), alternative to check) -\useCircForProof (!normalfont Circle !circGlyph(x)(1pt), appropriate with )\useCircForMC -\end{Verbatim} -All of these user friendly commands are based on the \cs{proofingsymbol} -command. For example, the definitions of \cs{useCheckForProof} and -\cs{useCrossForProof} are, -\begin{Verbatim}[xleftmargin=\leftmargini,commandchars=!()] -\newcommand{\useCheckForProof}{\symbolchoice{check}% - \proofingsymbol{\ding{52}}} -\newcommand{\useCrossForProof}{\symbolchoice{cross}% - \proofingsymbol{\raisebox{-1pt} - {\rlap{\kern-1pt\Large\ding{56}}}}} -\end{Verbatim} -Both definitions use the \textsf{pifont} package to create the symbols. -Note that some adjustment of size and position is used for the cross -symbol. - -The command \cs{symbolchoice} is defined in the \textsf{eforms} package -and does nothing in \textsf{eqexam} unless either \texttt{online} or -\texttt{email} options are taken. From the \textsf{eforms} manual, -possible values for \cs{symbolchoice} are \texttt{check}, \texttt{circle}, -\texttt{cross}, \texttt{square}, \texttt{diamond}, and \texttt{star}. The -\cs{proofingsymbol} command is for marking the multiple choices when -either the \texttt{answerkey} or \texttt{vspace\-with\-solns} option is -taken. The choice of \cs{proofingsymbol} is `{\LaTeX}ed' into the -document. The \cs{proofingsymbol} may be used to create other proofing -symbols, as desired. - -\newtopic\textbf{Summary.} Currently, there only two geometric shapes used -for multiple choice, rectangles (the default) and circles. To Shift -between these two types, use \cs{useRectForMC} and \cs{useCircForMC}, -respectively. Accompanying the choice for geometric shape for MC is the -symbol used to make the choice/correct answer. When the \texttt{answerkey} or -\texttt{vspace\-with\-solns} option is used, the correct answer is marked -using a symbol, current choices are \cs{useCheckForProof}, -\cs{useCrossForProof} and \cs{useCircForProof} (used with -\cs{useCircForMC}). - -When the \texttt{vspace\-with\-solns} is used, solutions are written to -the back of the document and markup up as they are with the -\texttt{answerkey} option. To get the answers in the solutions section to -have the same choices, you must write to the solutions file using -\cs{writeToSolnFile}. Below is an example. - -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\useCircForMC\useCircForProof -\writeToSolnFile{\protect\useCircForMC\protect\useCircForProof} -\begin{problem}[5] In what year did Columbus sail the ocean blue? - \begin{answers}{3} - \bChoices - \Ans0 1490\eAns - \Ans0 1491\eAns - \Ans1 1492\eAns - \Ans0 1493\eAns - \eChoices - \end{answers} -\end{problem} -\end{Verbatim} -Any multiple choice question that follows will also draw circles for -multiple choice questions, and mark them with a filled circle. -To shift back to the default, expand the following commands prior the next -question. -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\useRectForMC\useCheckForProof -\writeToSolnFile{\protect\useRectForMC\protect\useCheckForProof} -... -\end{Verbatim} - -\subsection{Multiple Selection}\label{multiSelect} - -When writing a multiple choice question for which more than one -alternative is permitted, use the \texttt{manswers} environment -(\underbar multiple \underbar{answers}). The distinction between the -\texttt{answers} and \texttt{manswers} environments is lost when -publishing to paper, but becomes important with the \texttt{online} -and \texttt{email} options. - -Use the \texttt{manswers} environment in the same way you use -\texttt{answers}, except code in more than one correct answer. For -example, -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem}[5] -Which of the following are primary colors? -\begin{manswers}{6} % specify tabular with 6 columns - \bChoices - \Ans1 Blue\eAns - \Ans0 Green\eAns - \Ans1 Yellow\eAns - \Ans0 Orange\eAns - \Ans1 Red\eAns - \eChoices -\end{manswers} -\begin{solution} -Yes, red, blue and yellow are primary colors. -\end{solution} -\end{problem} -\end{Verbatim} -\noindent You can use the \cs{bChoices}/\cs{eChoices} pair to specify the -alternatives, or you can use the standard tabular notation. As with the -\texttt{answers} environment an argument of \texttt1 specifies a list -environment. See \Nameref{multichoice} for more examples on the use of the -\cs{bChoices}/\cs{eChoices} pair. - -\subsection{Randomizing Choices}\label{s:random} - -Beginning with version~1.7 of \textsf{eqexam}, the choices of a -multiple choice/selection question can be randomized. The \texttt{random.tex} -macro file by Donald Arseneau is used for this purpose. - -\newtopic The randomization is only allowed if the \texttt{allowrandomize} -option of \textsf{eqexam} is used; otherwise, no randomization -can occur. - -The randomization is only defined for choices listed between the -pair \cs{bChoices} and \cs{eChoices}. The -\cs{bChoices} command now takes two optional key-value arguments: -\begin{itemize} - \item \texttt{nCols=\anglemeta{num}}: The number of columns to create, as described. - You can also use the old style by specifying just - \anglemeta{num}. Thus, \cs{bChoices[nCols=2]} and \cs{bChoices[2]} - are equivalent. - \item \texttt{random=\anglemeta{\upshape true|false}}: Specify this option if you want the choices - to be randomized. You can use the key word \texttt{random} instead of - \texttt{random=true}. For example, the following commands all will randomize the - choices, \cs{bChoices[random]} or \cs{bChoices[nCols=2,random]} or - \cs{bChoices[2,random=true]}. The default is to not randomize the - choices. -\end{itemize} - -\newtopic The following is an example of the \texttt{random} option of \cs{bChoices}. -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem}[5] -Try to guess the correct answer. - \begin{answers}{3} - \bChoices[nCols=2,random] - \Ans0 1 a choice\eAns - \Ans1\label{eq} 2 another choice\eAns - \Ans0 3 still another choice\eAns - \Ans0 4 another\eAns - \Ans0 5 incoming\eAns - \Ans0 6 more choices\eAns - \Ans0 7 another still\eAns - \Ans0 8 too many\eAns - \Ans0 9 choices\eAns - \eFreeze - \Ans0 10 None of these\eAns - \eChoices - \end{answers} -\end{problem} -\end{Verbatim} - -\newtopic Note the presence of the command \cs{eFreeze}. Any of -the items listed after \cs{eFreeze} are not randomized, and are -placed at the end of the list. So, for the example above, the first -nine items will be randomized, whereas, the last item (None of -these) will placed at the end of the list. - -\newtopic Additionally, there are five other commands that support the -randomization feature. - -\begin{Verbatim}[xleftmargin=\leftmargini] -\saveRandomSeed -\inputRandomSeed -\end{Verbatim} - -\newtopic A pseudo-random sequence of numbers requires an initial seed -value. The \texttt{random.tex} macro file creates, by default, a -seed value based on the data and time (the number of minutes since -midnight); consequently, after every minute, the random sequence -will change. By setting the value of the count register \cs{randomi}, as in -\texttt{\string\randomi=24}, -the document author can also set the initial seed of the pseudo-random -sequence. - -The command \cs{saveRandomSeed} will write the last seed used in the -source file to an auxiliary file (\cs{jobname\_ran.sav}), while the -command \cs{inputRandomSeed} inputs the seed stored in the -\cs{jobname\_ran.sav} back into the beginning of the source file. -These two commands should be placed in the preamble. - -By invoking both of these commands, a new pseudo-random sequence will be generated -each time the source file is latexed. - -Assuming a \cs{jobname\_ran.sav} has already been created, by -invoking the command \cs{inputRandomSeed} only (and not -\cs{saveRandomSeed}), the seed already saved will be used for every -subsequent compiling of the source document. Using the same seed is -necessary in two situations: -\begin{enumerate} - \item When the document contains one or more \cs{label} commands, using the same - seed gives you the same sequence every time you latex the document. This will - give the auxiliary files a chance to come up to date so that any referencing of the label - will be accurate. - - \item When creating an exam with randomization that has several - versions, which later you publish the solutions to, it is - important that the randomization for the document is the same as - that for the solution document. By using \cs{inputRandomSeed} (and - not \cs{saveRandomSeed}), you should get the same sequence for the - solution document (unless you modify the source file, adding or - removing questions that have randomization). -\end{enumerate} - -\newtopic\textbf{Things to look for:} If \textsf{eqexam} is not rearranging the order -of the choices as you expect it to, it could be that -\textsf{eqexam} is reading an old \texttt{.sav} file. Either delete that file -in your source folder, or comment out \cs{inputRandomSeed} in your document. - -\begin{Verbatim}[xleftmargin=\leftmargini,commandchars=!()] -\useRandomSeed{!meta(num)} -\end{Verbatim} - -You may have several sections of the same class take the exam with the -questions rearranged for each. Save the seed value used by -\textsf{eqexam} to randomize the choices (open the \texttt{.sav} -and copy and paste line you see into your document, for example, it -could read \cs{randomi=132088850}. Then use \cs{useRandomSeed} to -use that seed value for that class, for example -\begin{Verbatim}[xleftmargin=\leftmargini] -\useRandomSeed{132088850} % 11:00 class -% \useRandomSeed{634952429} % 12:30 class -\end{Verbatim} -Of course comment out \cs{inputRandomSeed}. - -\begin{Verbatim}[xleftmargin=\leftmargini] -\turnOnRandomize -\obeyLocalRandomize -\end{Verbatim} - -The command \cs{turnOnRandomize} overrides all local settings of \cs{bChoices} -and causes all choice lists to be randomized. While \cs{obeyLocalRandomize} -returns control to the local settings. For example, -\begin{Verbatim}[xleftmargin=\leftmargini] -\turnOnRandomize -... -\bChoices - \Ans...\eAns - \Ans...\eAns - ... -\eChoices -\end{Verbatim} -will cause the choice list to be randomized, even though the -\texttt{random} option was not specified. Whereas, in this code -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\turnOnRandomize -... -\obeyLocalRandomize -,,, -\bChoices - \Ans...\eAns - \Ans...\eAns - ... -\eChoices -\end{Verbatim} -the choices will not be randomized, because the \texttt{random} -option was not specified; or they will be randomized if the -\texttt{random} option is used. - -\newtopic\textcolor{red}{Limitations:} There are natural limitations on the use -of \cs{bChoices} and \cs{eChoices} and consequently, there are -limitations on the randomization. The content between \cs{Ans} and -\cs{eAns} cannot have any verbatim text. This is usually not a -problem for mathematical content, but could be a limitation for -computer science where questions about syntax may be posed. I have -in mind a work-around, but haven't pursued the problem as of yet. - -\subsection{Labeling Choices} - -The \cs{bChoices} command has a \texttt{label} key, -\verb~\bChoices[label=~\texttt{\anglemeta{label}]}, used to specify a (unique) label for the -current set of choices. When a label is specified, \textsf{eqexam} creates -commands that save the label of each correct answers (for multiple -choice/multiple selection problems), and saves the answer text for each -correct answer. These can be read back into the document using some -user-interface commands: \cs{useSavedAlts}, \cs{useSavedAns}, -\cs{useSavedAltsAns}, and \cs{useSavedNumAns}. - -%\handpoint The demo file for this feature is named \texttt{test03.tex}.\medskip - -\exAeBBlogPDF{p=1206} The demo file for this feature is named -\texttt{test03.tex}, download -\texttt{\href{\urlAcroTeXBlog/?p=1206}{test03.pdf}} from the {\AcroBlog} -website. The source file is attached to the PDF. - - -\settowidth{\aebdimen}{\ttfamily\string\useSavedAltsAns[\meta{num}]\darg{\meta{label}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\useSavedAlts[!meta(num)]{!meta(label)} -\useSavedAns[!meta(num)]{!meta(label)} -\useSavedAltsAns[!meta(num)]{!meta(label)} -\useSavedNumAns{!meta(label)} -\end{dCmd} -\noindent The optional argument is useful \emph{only if} the \cs{bChoices} appears in a -\texttt{manswers} environment where there are more than one selectable answer. The required -parameter is the value of the \texttt{label} key. -\begin{description}\def\NH{\hspace{-\labelsep}} - \item\NH\cs{useSavedAlts\darg{\meta{label}}} expands to the - \meta{label} of the correct answer(s). For example - \cs{useSavedAlts\darg{\meta{label}}} might expand to (c); if there - are multiple answers, it might expand to (a), (c), a - comma-delimited list of labels of the (correct) answers. For - multiple selection, \cs{useSavedAlts[2]\darg{\meta{label}}} might - expand to (c), the label of the second correct answer. - - \item\NH\cs{useSavedAns\darg{\meta{label}}} expands to the \emph{text} - of the correct answer(s). As an example, - \cs{useSavedAns\darg{\meta{label}}} might expand to $ y = x^3 $; if - there are multiple answers, it might expand to $ y = x^3 $, $ y = - -x^3 $, a comma-delimited list of the text of the (correct) - answers. For multiple selection, - \cs{useSavedAns[2]\darg{\meta{label}}} might expand to $ y = -x^3 - $, the text of the second correct answer. - - \item\NH\cs{useSavedAltsAns\darg{\meta{label}}} combines the two - previous commands. Again, for example, - \cs{useSavedAltsAns\darg{\meta{label}}} might expand to (c) $ y = - x^3 $. When there are multiple answers, it expands to a comma - delimited of labels and text. As with the other two commands, the - optional argument can be used to pick off a particular choice. - \item \NH\cs{useSavedNumAns\darg{\meta{label}}} is the number of - correct answers in the current list of choices. -\end{description} - -\subsection{Gizmos and Gadgets} - -I have a couple of crazy gizmos that you can use. - -\subsubsection{The \texttt{workarea} Environment} - -For a mathematics test, we often pose -a question that needs to be worked out. Vertical space is created -by the \texttt{solutions} environment, and appears when the -\texttt{nosolutions} or \texttt{vspacewithsolns} option is used; however, often we want to -mark up this vertical space with additional instructions, a -diagram or a figure. The problem is how can the author write over -the provided white space. For this, \textsf{eqexam} provides the -\texttt{workarea} environment. The syntax is: -%\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\settowidth{\aebdimen}{\ttfamily\anglemeta{Material that will overwrite the solutions vertical space}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\begin{workarea}[!meta(width)]{!meta(depth)} -... -!anglemeta(Material that will overwrite the solutions vertical space) -... -\end{workarea} -\end{dCmd} -This environment is placed immediately \emph{after} the \texttt{solutions} -environment, and the value of its parameter should be the same as the -optional parameter at the beginning the \texttt{solutions} environment -(\cs{begin\darg{solutions}[\meta{depth}]}). The optional \meta{width} -parameter is the width of the work area, which is \cs{linewidth} by default. -The required \meta{depth} parameter is the depth of the work area and it -should match the optional parameter of the \texttt{solutions} environment, -directly above it. - -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem}[3] -This is a question. - -\begin{solution}[2in] -This is the solution, let's hope it's correct, or I would be -embarrassed to no end. -\end{solution} - -\begin{workarea}{2in} -\textit{Hint}: Think long and hard before answering. -\par\vfill\hfill\setlength{\fboxsep}{2mm} -\fbox{Answer:\fillin[n]{1in}{The correct answer.}} -\end{workarea} -\end{problem} -\end{Verbatim} -\noindent When the \texttt{nosolutions} option is taken, the -\texttt{solutions} leaves $2$~inches of white space. The -\texttt{workarea} environment that follows also specifies -$2$~inches, and the content of this environment will overlap the -white space. (The student would then work around the written -material.) Here, we give a hint, and leave an answer box (a -fill-in) for the student to insert his/her answer. - -When the \texttt{nosolutions} is not specified, the vertical space -is not provided, and the \texttt{workarea} does nothing. If -\texttt{solutionsafter} is specified, that space is replaced by -the provided solution. - -\subsubsection{The \texorpdfstring{\cs{placeAtxy}}{\textbackslash placeAtxy} Command} - -The \cs{placeAtxy} command is another device that I've used to -place a block of text or a graphic on top of the vertical space -created by the \texttt{solutions} environment when the -\texttt{nosolutions} or \texttt{vspacewithsolns} option is in effect. -\settowidth{\aebdimen}{\ttfamily\string\placeAtxy\darg{\meta{x\_dim}}\darg{\meta{y\_dim}}\darg{\meta{content}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\placeAtxy{!meta(x_dim)}{!meta(y_dim)}{!meta(content)} -\end{dCmd} -\noindent The first two arguments are the $x$ and $y$ coordinates -(with dimensions) of where the \meta{content} is to be placed. -If this command is placed below the \texttt{solutions} -environment, then the origin is the lower left corner of the -solutions box. - -The following example, places the frame box \framebox{Place a -graph here} (roughly) one inch up and one inch shifted to the -right, measured from the bottom left corner of the \texttt{solutions} -environment (when the \texttt{nosolutions} option is in effect). -As with \texttt{workarea}, \cs{placeAtxy} does nothing if the -\texttt{nosolutions} option has not been taken. - -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem}[3] -This is a question. -\begin{solution}[2in] -This is the solution, let's hope it's correct, or I would be -embarrassed to no end. -\end{solution} -\placeAtxy{1in}{1in}{\framebox{Place a graph here}} -\end{problem} -\end{Verbatim} -\noindent The \cs{placeAtxy} command can also be used in -combination with the \texttt{workarea} environment. - -% -% Fixed with version 1.3. 02/07/05 -% -% \redpoint With this release of \textsf{eqexam}, the -% \texttt{splitsolution} environment does not obey the `\texttt{h}' -% or `\texttt{H}' options. These options were discussed in section -% on the \hyperref[problem]{\texttt{problem} environment}, on -% page~\hyperref[problem]{\pageref*{problem}}. - -\subsubsection{The \texttt{splitsolution} Environment} - -I developed this environment to solve a problem with the -\texttt{online} and \texttt{email} options. The white space -created by the \texttt{solution} environment is converted into -text fields (\PDF{} form fields). If the \texttt{workarea} -environment or the \cs{placeAtxy} command is used to place content -on the white space, the student will be in the position of having -to type on top of this content. (See the demo file -\texttt{\href{\urlAcroTeXBlog/?p=1198}{test01.pdf}}\marginpar{\mbox{\makebox[0pt][l]{\textcolor{blue}{\Pisymbol{webd}{254}}}\raisebox{-2pt}{\color{red}{{\zqacr -b\hspace{9.5pt}}}}}} for an illustration of this.) - - -Therefore, it was necessary to have a way to separate the space -reserved for the text field, and the additional content you might -want to appear in this white space area. The -\texttt{splitsolution} environment is my solution to this problem. - -As of 2012/12/10, a new syntax has been implemented for the -\texttt{splitsolution} and \texttt{panel} environments. Below is a -side-by-side comparison of the new syntax and the old. - -\settowidth{\aebdimen}{\small\ttfamily\string\begin\darg{splitsolution}[\meta{width}][\meta{depth}]} -\newtopic\begin{minipage}{\aebdimen+2\fboxsep+2\fboxrule} -\begin{Verbatim}[commandchars=!(),fontsize=\small,frame=single] -(!normalsize!normalfont!bfseries New Syntax) -\begin{splitsolution}[!meta(width)][!meta(depth)] -\begin{panel}[l|r] -... -\end{panel} -\begin{solution} -... -\end{solution} -\end{splitsolution} -\end{Verbatim} -\end{minipage}\quad -\begin{minipage}{.45\linewidth} -\begin{Verbatim}[commandchars=!(),fontsize=\small] -(!normalsize!normalfont!bfseries Old Syntax) -\begin{splitsolution}{!meta(depth)} -\begin{panel}[l|r]{!meta(width)} -... -\end{panel} -\begin{solution} -... -\end{solution} -\end{splitsolution} -\end{Verbatim} -\end{minipage} -\newtopic There has not been any feedback to this feature, so I am confident that -this change has little impact on users. Both \meta{width} and -\meta{height} are optional arguments for the new syntax of -\texttt{splitsolution}. If there are no optional arguments, the default -values of \cs{panelwidth} and \cs{panelheight}; these are automatically -measured. If only one optional parameter is given, it is interpreted as -\meta{height} (and the \meta{width} is taken to be \cs{panelwidth}). The -default value of the optional parameter for the \texttt{panel} environment -is now \texttt{r} rather than \texttt{l}. - -\redpoint Consider the following example. -\begin{Verbatim}[numbers=left,xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem}[7] -This is a question worth $7$ points. -\begin{splitsolution} -\begin{panel}\relax -\includegraphics[scale=.2]{fig1} -\end{panel} -\begin{solution} -This a really good solution. I hope this solution is correct or I -will be total embarrassed to no end. Even if it is wrong, maybe -the students will appreciate my tremendous effort. You can see -from the figure that the solution is obvious. -\end{solution} -\end{splitsolution} -\end{problem} -\end{Verbatim} -Note the use of \cs{relax} in line~(4). The first object in the panel -environment is a command. To prevent the command from expanding -prematurely, place a \cs{relax} as above. This will give you the default -parameter of \texttt{r} and prevent expansion. The use of \cs{relax} is -only needed when there is a command immediately following the opening of -the \texttt{panel} environment; otherwise, just \verb!\begin{panel}! should -work correctly. The optional argument can always be specified, -\verb!\begin{panel}[r]!; this too would prevent the premature expansion of -any command that immediately follows. - -The \texttt{panel} environment takes its contents and writes it verbatim -to a \textsf{CUT} file, then inputs it back in (at the end of the \texttt{panel} -environment), and places its contents in the box \cs{eqpanelbox} where it -takes it measurements of \cs{panelwidth} and \cs{panelheight} (the total -height). - -The \texttt{splitsolution} environment \emph{must} enclose two -other environments: The \texttt{panel} and the \texttt{solutions} -environments, \emph{in that order}. - -The \texttt{panel} environment comes first and takes optional argument. -The optional parameter has takes a value of `\texttt{r}' (the default) or -`\texttt{l}'. The \texttt{r} (resp., \texttt{l}) option means the panel is -to appear on the right (resp., left) of the solution (or vertical white -space). - -After the \texttt{panel} environment comes the \texttt{solutions} -environment. The optional parameter of this environment need not -be specified, as it gets its value from the \texttt{split\-solution} -parameter. - -There is a small gap of \texttt{3pt} (the default) inserted between the -panel and the solution. The value of this gap is contained in the -\cs{panelgap} command, -\begin{Verbatim}[xleftmargin=\leftmargini] -\newcommand\panelgap{3pt} -\end{Verbatim} -which can be redefined. - -\redpoint The depth (the default is \cs{panelheight}) that you specify as -the parameter of the \texttt{splitsolution} environment needs to be large -enough to accommodate your typeset solution; otherwise, the solution will -overlap the next problem. This is because, unlike the solutions inside a -\texttt{solution} environment (but not in a \texttt{splitsolution} -environment) are typeset in a \texttt{minipage} with a specified depth. - -To extend the height of the solution, use the following method. -\begin{Verbatim}[xleftmargin=\leftmargini] -\begin{splitsolution}[\panelheight+1in] -... -\end{splitsolution} -\end{Verbatim} -This sets the total height to be the natural height of the panel plus 1 inch. - -\section{\textsf{eqexam} Options}\label{eqoptions} - -The options documented here are entered as optional arguments of the eqexam package: -\begin{Verbatim}[xleftmargin=\leftmargini,commandchars=!()] -\usepackage[!meta(optionals)]{eqexam} -\end{Verbatim} -The optional arguments can also be introduced through \texttt{exambuilder.cfg}, the configuration file. -Create a text file with the name of \texttt{exambuilder.cfg} -and create the line shown below. -\begin{Verbatim}[xleftmargin=\leftmargini,commandchars=!()] -\ExecuteOptionsX{!meta(optionals)} -\end{Verbatim} -Place \texttt{exambuilder.cfg} in the folder of the source file and not on the {\LaTeX} -search path. - -\redpoint The \textsf{eqexam} package has numerous options, some -inherited from \textsf{web}, some from \textsf{exerquiz}, and a -number of new ones. -\begin{description} - \item[\texttt{forpaper}] Take this option when you want to create - a black and white paper version of your test. - - \item[\texttt{forcolorpaper}] Take this option - when you want to have a nice colorful paper version, - or are publishing on the web in {\PDF}. See \Nameref{customColor}. - - \item[\texttt{nosolutions}] This is the normal option taken when - you are printing a test for distribution to a class of - students. When this option is taken, vertical space is - generated by the \texttt{solutions} environment based on - the value of its optional parameter. This leaves room for - the student to solve/answer the question. - - \item[\texttt{nohiddensolutions}] If you use the \texttt{h} - optional parameter for \texttt{problem} or \cs{item}, the - solution will not be listed (at the end of the document) - \emph{when you do not specify} \texttt{nosolutions}; but - solutions will be typeset for the \texttt{solutionsafter} option. - This option will override this feature. - - \item[\texttt{noHiddensolutions}] Normally, when you use the - \texttt{H} optional parameter for \texttt{problem} or \cs{item}, the - solution will not be listed when you use the \texttt{nosolutions} or - \texttt{so\-lu\-tions\-af\-ter} options for \textsf{eqexam}. This option will - override this feature. - - \item[\texttt{solutionsafter}] Causes solutions to appear - following the statement of the problem. - - When the \texttt{solutionsafter} is in effect, the word - \textit{Solution:} is typeset at the beginning of the solutions. - The command \cs{renameSolnAfterTo} can be used for conveniently - changing the \texttt{solutionsafter} label, for example, executing - the command \verb!\renameSolnAfterTo{\textbf{Proof:}}! prior to a - \texttt{solution} environment changes the label to - \textbf{Proof:}; \verb!\renameSolnAfterTo{}! produces no - label. These changes will be local to the group in which they are - made, or global of there they are not made in a group. - - The command \cs{resetSolnAfterToDefault} sets the label text back to - the default. The default label is \verb!\textit{Solution}:!. - - \item[\texttt{preview}] The bounding boxes are shown when this - option is taken, provided the \texttt{online} or \texttt{email} - option is chosen. See the description of these two options - below. - - \item[\texttt{proofing}] Using this option will cause the - correct answer for multiple choice questions to be marked with - a check mark; the correct answers for fill-in questions - (\cs{fillin} or \cs{TF}) are also shown.\medskip - - The \texttt{answerkey} option, described below, - executes the \texttt{proofing} and \texttt{solutions\-after} - options. - -\end{description} - -\redpoint The following options are unique to the \textsf{eqexam} package. - -\begin{description} -\item[\texttt{pointsonleft}] The points for the problem are displayed in - the left margin. - -\item[\texttt{pointsonright}] The points for the problem are on the left - margin. - -\item[\texttt{pointsonboth}] Points are displayed in both margins. - -\item[\texttt{nopoints}] Causes points not to be displayed, or - calculated. Useful for writing documents that do not have points, - such as a questionnaire. - -\item[\texttt{totalsonleft}] The totals for each page can be - displayed at the bottom left corner of each page using this option. - -\item[\texttt{totalsonright}] The totals for each page can be - displayed at the bottom right corner of each page using this - option. - -\item[\texttt{nototals}] Use this option if you don't want any - totals at the bottom of the page. - -\item[\texttt{noparttotals}] When multiple \texttt{exam} environments appear on - the same page, they are separated by a horizontal rule. The page total - for the closing \texttt{exam} environment is inserted into the margin on - the same line as the horizontal rule. This option turns off the insertion - of the page total for the closing \texttt{exam} environment.\medskip - - There are two commands that can be used for local control of - this feature, they are \cs{eoeTotalOff} and \cs{eoeTotalOn}. - When an \texttt{exam} ends near the bottom of one page, the - new exam will begin on the next page, this results in the - horizontal rule being generated with the end of exam totals, - and the totals at the bottom as well. If these two numbers are - the same, then you can turn off the end of exam total using - \cs{eoeTotalOff}. Use this command just above - \verb+\end{exam}+ and the changes will be local to that exam - part. - -\item[\texttt{parttotalsonright}] Place the part totals in the right - margin, this is the default. - -\item[\texttt{parttotalsonleft}] Place the part totals in the left - margin. - -\item[\texttt{nosummarytotals}] When you use the - \texttt{instructions} environment, the total points for - \texttt{exam} are displayed following the instruction heading. - Using this option turns off this feature. - -\item[\texttt{noseparationrule}] When the document has multiple - \texttt{exam} environments, a separation rule is placed between - them. This option turns off that feature. - - The design of the separation rule may be modified by the document author - by redefining \cs{separationrule}, its definition is given below: -\begin{Verbatim}[xleftmargin=\leftmargini] -\newcommand{\separationrule}{\makebox[\linewidth]% -{\centering\rule{.67\linewidth}{.4pt}}} -\end{Verbatim} - -\item[\texttt{coverpage}] Some instructors like to have a cover - page for their exams, use this option to create a cover page. Use - the \cs{eqexcoverpagedesign} command to design your own cover page. - -\item[\texttt{coverpagesumry}] is a companion to the \texttt{coverpage} option, - \texttt{coverpagesumry} takes one of three values: \texttt{bypages}, \texttt{byparts}, \texttt{none}. - -\begin{description} - \item[\texttt{coverpagesumry=bypages}] If \texttt{bypages} is chosen, an ``Exam Record'' - appears on the cover page. See the left-hand figure in - Figure~\ref{fig:ExamRecord}. A page total appears on each line. Note - ``Page~3,'' in the figure; the total there is ``$37\,\text{pts}\ - (12\,\text{pts}+25\,\text{pts})$.'' This means that there are 37 - points on page~3; on this page the first \texttt{exam} environment - ended and a second \texttt{exam} environment begins, there are 12 - points on page~3 from the first \texttt{exam} environment, and 25 - points on that page from the second \texttt{exam} environment. - -\begin{figure}[htb] -\begin{center} -\includegraphics[width=.4\linewidth]{bypages}\quad -\includegraphics[width=.4\linewidth]{byparts} -\caption{Exam Record}\label{fig:ExamRecord} -\end{center} -\end{figure} - - \item [\texttt{coverpagesumry=byparts}] If \texttt{byparts} is chosen, an - ``Exam Record'' appears on the cover page that lists the number of - points per part. (Each exam environment is considered here a - ``part.'') See the right-hand figure in - Figure~\ref{fig:ExamRecord}. - - \item [\texttt{coverpagesumry=none}] If this option is chosen (the default), no - ``Exam Record'' is generated. If the key \texttt{coverpagesumry} does not - appear in the option list of \textsf{eqexam}, no ``Exam Record'' is written. - - \end{description} - - See \Nameref{examrecord} for more details on this topic. - -\item[\texttt{nospacetowork}] When the \texttt{nosolutions} option - is taken, the \texttt{solutions} - environment leaves vertical space in which to respond to the - question. Use this option to override this behavior.\medskip - - The command \cs{SpaceToWork} causes the white space to be - created again, and the \cs{NoSpaceToWork} turns it off again. - Use these two commands to turn on and off the creation of - vertical spaces in different parts of your exam. - -\item[\texttt{answerkey}] This is a convenience option equivalent - to \texttt{proofing} and \texttt{solutionsafter}. Useful for - creating an ``answer key'' with answers and solutions displayed. - -\item[\texttt{solutionsonly}] Using this option, it is possible to obtain -a typeset document consisting of only the solutions to \textsf{eqexam} document. -See \Nameref{solutionsonly} for further details. - -\item[\texttt{vspacewithsolns}] An unusual feature requested by a user - for homework assignments. This option is a combination of - \texttt{nosolutions} (where vertical space is left by the - \texttt{solutions} environment to respond to the question), but - the solutions are written the \cs{jobname.sol} and input back in - at the end of the document. - - This option is incompatible with \texttt{answerkey}, - \texttt{nosolutions}, and \texttt{solutionsafter}, so when - \texttt{vspacewithsolns} is used, it ``cancels'' these other - options. - - The command \cs{showAllAnsAtEnd} is inserted at the top of the - \cs{jobname.sol} file and when \cs{jobname.sol} are input back - in, the command \cs{showAllAnsAtEnd} is executed. The definition - of \cs{showAllAnsAtEnd} is -\begin{Verbatim}[xleftmargin=\leftmargini] -\newcommand{\showAllAnsAtEnd}{% - \makeAnsEnvForSolnsAtEnd - \answerkeytrue\eq@proofingtrue - \eq@solutionsaftertrue\vspacewithsolnstrue - \displayworkareafalse\withsoldoctrue -} -\end{Verbatim} -Basically, this turns on all the switches that correspond to the -\texttt{answerkey} option. This command may be redefined to suite your -purposes. - -\handpoint When this option is taken, the switch \cs{ifvspacewithsolns} -may be used to bring in alternate content. - -See \Nameref{vspacewithsolns} for further details. - -\item[\texttt{ftbsolns}] An alias for \texttt{vspacewithsolns}. - -\item[\texttt{useforms}] Multiple choice questions have two forms, - (1) the choices are labeled using letters (a), (b), (c), etc.; or - (2) using a rectangular fill box. The default is~(1). The - \texttt{useforms} switches the default to~(2). You can use the - commands \cs{sqLinks} and \cs{sqForms} to change back and forth - between these two types within the exam document. Using one of - these commands outside a \texttt{problem} environment will - globally change the default, from within, it will only change the - default locally. - -\item[\texttt{myconfig}] If this option is taken, \textsf{eqexam} - looks for the configuration file \texttt{eqexam.cfg}. This - configuration file is input at the end of the package, and can be used - to redefine, for language localization purposes, any of the (text) - macros described in this manual. See the section \Nameref{custom} for - a partial listing of macros that can be redefined and placed in - \texttt{eqexam.cfg}.\medskip - -\item[\texttt{myconfigi}\dots\texttt{myconfigvi}] Six additional - options for inputting a configuration file. If you take one of - these options, \textsf{eqexam} inputs the corresponding - configuration file \texttt{eqexami.cfg}\dots\texttt{eqexamvi.cfg}. - -\item[\texttt{cfg}] Syntax: \texttt{cfg=\anglemeta{basename}}. If this option is taken, -\textsf{eqexam} looks for a file named \texttt{\anglemeta{basename}.cfg} and is input. - - For one of my recent classes, I wrote many - standard handouts documents: first day handout, assignment documents, - homework assignments, review documents, test documents, and - in-class notes. Each document-type had its own \textsf{eqexam} - format (configuration file, \texttt{eqexami.cfg}\dots\texttt{eqexamiv.cfg}. - It got confusing to keep track of all these configuration files. At which point - I decided to add a \emph{named} configuration scheme. If you use the key \texttt{cfg} - in the option list \texttt{cfg=firstday}, \textsf{eqexam} will look for a file - named \texttt{firstday.cfg} - -\item[\texttt{obeylocalversions}] An option put in to give greater control over - versions. Perhaps you have a \textsf{eqexam} file that has questions - with multiple versions. You would like to pick and choose the versions - to be used. In this case, using \texttt{obeylocalversions} will cause - \textsf{eqexam} to obey any \cs{selectVersion} commands embedded in - the document. - -\item[\texttt{allowrandomize}] Use this option to randomize - the multiple choice/selection questions. See \Nameref{s:random} for details. - -\item[\texttt{showgrayletters}] When \texttt{showgrayletters} is used, multiple choice -questions will have a gray capital letter -\texttt{A}, \texttt{B}, \texttt{C}, etc. underneath it. This letter -can then be referred to in the text or the solution using the \cs{REF} command. - -See \Nameref{showgraylettersOpt} for more information. - - \item[\texttt{usexkv}] When this option is used, and the document - author has the \textsf{xkeyval} package on his/her system, there is a - re-definition of the \cs{fillin} command. For more information, - see \Nameref{extendfillin}. - - \item[\texttt{allowcirc4mc}] Allows to use of circles (created by - the \texttt{lcircle10} font) for multiple choice questions. See - \Nameref{allowcirc4mc} for details. - - -\end{description} - -\redpoint The next option concerns a major new feature, available -in \textsf{eqexam}, version 3.0 or later. - -\begin{description} - \item[\texttt{fortextbook}]\label{fortextbook} This option is designed support - textbook authors. See \mlNameref{ftbop} for a greater explanation. -\end{description} - -\redpoint The next two apply to files that have several versions in them, -these were defined for use by the \textsf{AeB Exam Builder} -utility,\footnote{\url{http://www.acrotex.net/builders/}} but they are -available to the document author. - -\begin{description} - \item[\texttt{max}] The value of \texttt{max}, \texttt{max=\anglemeta{N}}, - is a positive integer. The value of \texttt{max} is the - number of versions for this document. This option executes - \cs{numVersions\darg{\anglemeta{N}}} at the end of the package. - - \item[\texttt{rendition}] This is a key-value pair. - \texttt{rendition=\anglemeta{alpha}}, where \anglemeta{alpha} letter corresponding to - the version that is to be typeset. At the end of the package, the - command \cs{forVersion\darg{\anglemeta{alpha}}} is executed. - -\end{description} - -\redpoint The next four options require the {\cAcroB}, and all of -its required packages, such as \textsf{hyperref}, their use -implies you are going to publish the document as a {\PDF}. - -\begin{description} - -\item[\texttt{pdf}] This option doesn't do much, it brings in the - \textsf{web} package, which in turn, places the values of the - keywords (\cs{title}, \cs{author}, \cs{subject}, etc.) into the - Document Description dialog of the {\PDF}. - -\item[\texttt{links}] This option brings in both \texttt{web} and - \texttt{exerquiz}. When you do not use a solutions option - (\texttt{nosolutions} and \texttt{solutionafter}), the solutions - appear at the end of the document. When the \texttt{links} option - is used, links from the questions to the solutions are created. - Unless you use a ``paper option'' (\texttt{forpaper} and - \texttt{forcolorpaper}), each solution is on a different page, - making a document with a lot of pages. When you also specify a - paper option, the solutions are separated by a \cs{medskip}. - -\item[\texttt{online}] The \texttt{online} option implies the - previous two options, but does more. When this option is taken, - and the \texttt{nosolutions} option is specified, {\PDF} forms are - created: multiple choice questions become radio button fields; - fill-in questions become text fields, and the vertical space - created by the \texttt{solutions} environment become multi-line - text fields.\medskip - - This may be a useful option for an exam taken in a - CBT\footnote{Computer Based Testing} lab, where the students - can type in their responses and when finished, print the - document to a lab printer to hand in. - -\item[\texttt{email}] This option implies the \texttt{online} - option, in addition, adds a submit button to the upper left corner - of the first page of the exam. The student can take the test in a - CBT lab, then submit the results to the instructor via email. - -\end{description} -\noindent See the section \Nameref{email} for additional details -of these last two options. - -\redpoint When any one of the four options above are taken, a -driver needs to be specified as well, the choices are\dots - -\begin{description} -\item[\texttt{dvipsone}] For users of the - {Y\!{\footnotesize\&}\!Y\TeX} System, such as myself. - -\item[\texttt{dvips}] For users of \textsf{dvips}, the - dvi-to-postscript converter. - -\item[\texttt{pdftex}] For users of \textsf{pdftex} application. - -\item[\texttt{dvipdfm}] For users of \textsf{dvipdfm} application. - -\item[\texttt{textures}] For \textsf{textures} users. (This -option is totally untested.) -\end{description} -\noindent These options are passed on to \textsf{hyperref} and to -\texttt{eforms}\footnote{A component of \AcroB.} for the proper -creation of links and form fields. - -\subsection{Configuration Files} - -The \textsf{eqexam} looks for two configuration files, they are -\texttt{web.cfg} and \texttt{eqexam.cfg}. - -The first one \texttt{web.cfg} may be already present on your hard -drive if you use the {\AcroB}. Typically, desired default driver -option is placed in here, for example, \texttt{web.cfg} might -contain the single line, -\begin{Verbatim}[xleftmargin=\leftmargini] -\ExecuteOptions{dvips} -\end{Verbatim} -\noindent for users of the \textsf{dvips} application for -converting \texttt{.dvi} files to \texttt{.ps} file. The drivers -supported by \textsf{eqexam} are listed in the previous section. - -The second configuration file, \texttt{eqexam.cfg}, is input at -the end of the package, provided the document author takes the -\texttt{myconfig} option. Use this file to redefine some of the -commands described in \Nameref{custom}, and elsewhere, to -customize \textsf{eqexam}. An obvious use for this is to have a -language customization of the package, input through -\texttt{eqexam.cfg}. - -If you place \texttt{eqexam.cfg} in the {\LaTeX} search path, -these customization will be global to all documents that specify -the \texttt{myconfig} option. If is is placed in the source -document folder (which is not in the {\LaTeX} search path) the -changes are local to all documents developed in that folder. - -\subsection{The \texttt{solutionsonly} Option}\label{solutionsonly} - -With this option, it is possible to obtain a listing of only the solutions -in an \textsf{eqexam} source file. A possible application of this feature -is if you publish homework or practice test questions, you can later -publish the solutions to them. - -%\handpoint The demo file for this option is \texttt{eqex\_solnsonly.tex}, where you -%will find detailed instructions for how to do this. See also the file -%\texttt{text03.tex}, which demos both the \texttt{solutionsonly} option and the -%\texttt{vspacewithsolns} option. - -\exAeBBlogPDF{p=1227} The demo file for this option is -\texttt{\href{\urlAcroTeXBlog/?p=1227}{eqex\_solnsonly.pdf}}, available from -the {\AcroBlog} website. The source file is attached to the PDF. Within the -source file, you will find detailed instructions for how to create a -solutions-only file. - - -\subsection{The \texttt{vspacewithsolns} Option}\label{vspacewithsolns} - -With option is a combination of \texttt{nosolutions} (where vertical -spaces are left for extended response questions, and multiple choice and -fill-in the blank are left, well, blank) and compiling the document -with no options at all, in this case the solutions appear at the end of -the document. - -To summarize, when \texttt{vspacewithsolns} is used, the test section is -left blank for the student to fill in, but at the end of the document are -the solutions. I've recently used this option to compile an old test (from -a previous semester) and publish it on the web. The student can try -solving the old test, with the solutions at the end of the -document.\footnote{Another option is to first publish your old exam with -the \texttt{nosolutions} option, then, after a suitable time, publish the same document -with the \texttt{solutionsonly} option.} - -\newtopic An alias for this option is the option \texttt{ftbsolns}. - -\exAeBBlogPDF{p=1220} The demo file for this feature is named -\texttt{\href{\urlAcroTeXBlog/?p=1220}{hw02.pdf}}. See also the file -\texttt{\href{\urlAcroTeXBlog/?p=1206}{test03.pdf}}, which demos both the -\texttt{solutionsonly} option and the \texttt{vspacewithsolns} option. - -\subsection{The \texttt{fortextbook} Option and \textsf{fortextbook} Package}\label{ftbop} - -This option is designed for authors of textbooks. The \texttt{fortextbook} -option defines the \texttt{probset} environment---used to create problems -sets in the textbook---as a re-purposing of the \texttt{exam} -environment. When the text is compiled with the \texttt{studented} option -(student edition), only odd-numbered solutions/answers are written to the -end of the document; when the \texttt{instred} option (instructor edition) is -used, all solutions/answers are written to the end of the document, there -are options for annotating the book with the answers in the margins or -following the questions (instructor edition). - -Documentation for this option is found in the \texttt{doc/fortextbook} -folder. See the file \texttt{fortextbook.pdf} and its source file -\texttt{fortextbook.ltx}. - -To use the \texttt{fortextbook} option, a whole panoply of options are needed, -\begin{Verbatim}[xleftmargin=\leftmargini] -\usepackage[% - fortextbook,ftbsolns,usecustomdesign, - forcolorpaper,noseparationrule,usexkv -]{eqexam} -\end{Verbatim} -Accompanying the \textsf{eqexam} is a simple wrapper package called -\texttt{fortextbook}, which basically calls \textsf{eqexam} with all the above -options. So, the textbook author needs only to specify, - -\begin{Verbatim}[xleftmargin=\leftmargini] -\usepackage{fortextbook} -\end{Verbatim} -The documentation for this option is quite extensive and is -available in the separate document \texttt{fortextbook.pdf}. This -document is a short ``textbook'' that illustrates and documents -the features of this option. - -See the \textbf{\ulSetLink{http://www.acrotex.net/blog}{Acro\TeX{} -Blog}} for several articles on the \texttt{fortextbook} option, -beginning with the first article -\textsl{\ulSetLink{http://www.acrotex.net/blog/?p=604}{The -\texttt{fortextbook} option, Part 1, The Instructor Edition}}. A -listing of all articles of the -\ulSetLink{http://www.math.uakron.edu/~dpstory/eqexam.html}{\textsf{eqexam} -package} may be obtained by following -\ulSetLink{http://www.acrotex.net/blog/?tag=eqexam-package}{this -link}. - -The full series of articles on the \texttt{fortextbook} option may be found under the -\ulSetLink{http://www.acrotex.net/blog/?tag=fortextbook}{fortextbook tag} at the blog site. - - - -\section{The \texttt{online} and \texttt{email} Options}\label{email} - -When you use the \texttt{online} option, all fields created by the -\cs{fillin} command, and this includes \cs{TF}, are converted into -text fields, and the white space created by the \texttt{solutions} -environment is converted to a multi-line text field. The fields -manifest themselves when the document is viewed within the Adobe -Reader, or any other {\PDF} viewer that supports form fields. - -This may be a useful option to the few people out there who are -not in a technical field that requires specialized symbols to -respond to a question. An exam created by the \texttt{online} -option can be filled out online, printed, and submitted to the -course instructor, perhaps within a lab setting. - -There are other applications, such as creating a course survey, or -a questionnaire of some type the students can fill out and submit. -The \texttt{email} option may be more appropriate for these -applications. - -\subsection{The \texttt{email} Option} - -When you pass the \texttt{email} option to \textsf{eqexam}, this -does everything the \texttt{online} option does, in addition, it -creates a ``Submit'' button that appears in the top-left margin of -the exam (it does not appear on the cover page), and is placed -there by the \cs{maketitle} command, that normally goes just after -the opening of the document environment, \verb+\begin{document}+. - -The forms button is all setup to submit to the server-side script, -\textsf{eqAttach.asp}, an active server page using -\textsf{vbscript} as its scripting language. This script, when -properly installed and functional, receives the form data -generated by the document and attaches it to an email, which it -sends off to the designated destination. Before discussing how to -install and use \textsf{eqAttach.asp}, let me cover some commands -that controls this button as well as options for changing what is -sent to the server-side script. - -When you take the \texttt{email} option, you need to supply a -minimum of two pieces of information: the path to the server-side -script \textsf{eqAttach.asp} and the email address of the person -the results are to be sent. The command \cs{SubmitInfo} is used to -supply this info, for example, -\begin{Verbatim}[xleftmargin=\leftmargini] -\SubmitInfo{http://localhost/scripts}{dpstory@uakron.edu} -\end{Verbatim} -This command takes two arguments, the first is the URL to the -server-side folder that contains \textsf{eqAttach.asp}, the second -argument is the email address of the recipient of the email. (You -can have multiple recipients by separating the address by an -comma.) - -After the student submits the responses to the questions, an email -is sent to the recipient (the instructor, perhaps). When the -recipient receives the email, s/he can save the {\FDF} attached file -(containing the student responses) to a folder on the local hard -drive. At least for a Windows machine when you open the {\FDF}, the -{\PDF} will be fetched and the student data will be populated into -the form fields. - -Once this is done, the instructor can either save the populated -file to the hard drive for later processing (the Acrobat -application needed for this step) or print it to a printer for -grading by hand. - -If the instructor has Acrobat, s/he can use the markup capability -of Acrobat to grade the electronic version of the test, and return -the electronic version, with markup, to the student. - -Below is the subject and message body of a ``typical'' submittal for the -student ``John Q. Student''. - -\begin{flushleft} -Message Subject: -\begin{Verbatim}[xleftmargin=\leftmargini] -Exam Results: Test 1 of U. S. History -\end{Verbatim} -\end{flushleft} - -\begin{flushleft} -Message Body: -\begin{Verbatim}[xleftmargin=\leftmargini] -Exam Information: - Course Name: U. S. History - Exam: Test 1 - Student: John Q. Student - TimeOfQuiz: 1/19/2005 12:07:56 PM -\end{Verbatim} -The {\FDF} is attached. -\end{flushleft} - - -\noindent The following commands can be used to modify the email message. - -\redpoint\cs{EmailCourseName} is used to specify the name of the -course. The default value for this is \cs{websubject}, obtained -from the \cs{subject} macro used in the preamble; however, if you -want a different name in the email, perhaps with more information -included, you can redefine the value using this macro. -\begin{Verbatim}[xleftmargin=\leftmargini] -\EmailCourseName{\websubject} % the default -\end{Verbatim} - -\noindent\textbf{\color{red}Important:} When you use {\TeX} -formatting in the subject, such as -\begin{Verbatim}[xleftmargin=\leftmargini] -\subject{\bfseries Calculus 1} -\end{Verbatim} -and you are using the \texttt{email} option, it will -be necessary to use \cs{EmailCourseName} to redefine the subject, e.g., -\verb+\EmailCourseName{Calculus 1}+, to avoid possible {\TeX} compile -errors, or to prevent {\TeX} primitives being a part of your -email! - -\redpoint\cs{EmailExamName} is used to specify the exam name of -the course. The default value for this is \cs{webtitle}, obtained -from the \cs{title} macro used in the preamble; however, if you -want a different name in the email, perhaps with more information -included, you can redefine the value using this macro. -\begin{Verbatim}[xleftmargin=\leftmargini] -\EmailExamName{\webtitle} % the default -\end{Verbatim} - -\noindent\textbf{\color{red}Important:} If you use some {\TeX} -formatting in the title, such as -\begin{Verbatim}[xleftmargin=\leftmargini] -\title{\bfseries Test 1} -\end{Verbatim} -and you are using the \texttt{email} option, it will be necessary -to use \cs{EmailExamName} to redefine the title, e.g., -\verb+\EmailExamName{Test 1}+, to avoid possible {\TeX} compile -errors, or to prevent {\TeX} primitives being a part of your -email! - -\redpoint\cs{EmailSubject} The document author might want a custom -subject in the email, instead of the standard one. By using this -macro, he can design his own email subject. -\begin{Verbatim}[xleftmargin=\leftmargini] -\EmailSubject{} % the default -\end{Verbatim} -\noindent In this case \textsf{eqAttach.asp} inserts the standard one. -\begin{Verbatim}[xleftmargin=\leftmargini] -Exam Results: \webtitle of \websubject -\end{Verbatim} -\noindent The email would read ``\texttt{Exam Results: Test 1 of -Calculus I}'', for example. - -To change the email subject we would put the following command in -the preamble: -\begin{Verbatim}[xleftmargin=\leftmargini] -\EmailSubject{Another Set of Cool Results} -\end{Verbatim} - -\redpoint \cs{ServerRetnMsg} The server script -(\textsf{eqAttach.asp}) returns a message acknowledging the -receipt of the data, this command allows the document author to -customize the return message. The default definition is: -\begin{Verbatim}[xleftmargin=\leftmargini] -\ServerRetnMsg{} -\end{Verbatim} -\noindent In this case \textsf{eqAttach.asp} inserts the standard -one, ``Exam results successfully sent to your instructor!''. - -To change the return message to something more meaningful, put -this command in the preamble, for example, -\begin{Verbatim}[xleftmargin=\leftmargini] -\ServerRetnMsg{Your responses to the \\TeX Survey have been - received, thank you!} -\end{Verbatim} - -\redpoint\cs{SubmitButtonLabel} is the label that appears on the -submit button. -\begin{Verbatim}[xleftmargin=\leftmargini] -\SubmitButtonLabel{Submit} % the default -\end{Verbatim} - - -\subsubsection{Installing \textsf{eqAttach.asp}} - -On the server side, in order for \textsf{eqAttach.asp} to run -correctly, Microsoft Internet Information Server (IIS), version -4.0 or greater, is needed. The script \textsf{eqAttach.asp} needs -to be placed where ASP scripts have execute permissions. - -The \textsf{eqAttach.asp} uses the \textsl{Acrobat FDF -Toolkit}\footnote{Currently located at the -\href{http://partners.adobe.com/public/developer/acrobat/devcenter.html} -{Acrobat Family Developer Center}.}, version 6.0. Follow the -directions for installation contained in the accompanying -documentation. - -Install \textsf{eqAttach.asp} in a folder (perhaps called -\texttt{Scripts}) designated to execute scripts. If you don't -have such a folder, then the following steps explain how to -create a virtual directory through IIS that points to this folder. - -\begin{enumerate} -\item Create a new folder on the system (\texttt{Scripts}, for -example). Its recommended location is inside the \texttt{Inetpub} -folder. - -\item Place \textsf{eqAttach.asp} in this newly created folder. - -\item In the MMC snap-in for IIS, create a virtual directory by -right-clicking on the Default Web Site and selecting \texttt{New > -Virtual Directory}. - -\item Type ``Scripts'' (or whatever the name of the folder you -created in~Step~1) as the alias for the virtual directory, and -then link it to the physical directory you created in Step~1. - -\item Make sure that ``Script execution'' privileges are enabled. -If not, enable them. -\end{enumerate} - - -\subsubsection{Setting up and Modifying the Script} - -On the server side, in order for \textsf{eqAttach.asp} to run -correctly, Microsoft Internet Information Server (IIS), version -4.0 or greater, is needed. The script \textsf{eqAttach.asp} should -be placed where ASP scripts have execute permissions. There are -two methods of sending e-mail: -\begin{enumerate} - \item \texttt{CDONTS}: This method (which is commented out by - default) can be used on an NT server. Uncomment if you want to - use CDONTS, and comment out the CDOSYS code lines that follow. - \item \texttt{CDOSYS}: This can be run on a Win2000 or WinXP - server. -\end{enumerate} - -The script needs to be modified appropriate to your server, in -particular, search down in \texttt{eqAttach.asp} for the -configuration line -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -eqMail.Configuration.Fields.Item - ("http://schemas.microsoft.com/cdo/configuration/smtpserver") - = "mySMTP" -\end{Verbatim} -\noindent replace \texttt{mySMTP} with your SMTP server. - -\subsubsection{Some Options} - -The default behavior of \textsf{eqAttach.asp} is to return a -message to the document that indicates the receipt of the data, -this message is``Exam results successfully sent to your -instructor!'' The message, as explained earlier, can be changed -using the \cs{ServerRetnMsg}, like so -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\ServerRetnMsg{Your TeX survey results have been received, thank you.} -\end{Verbatim} -\noindent Now, if for whatever reason you don't want this -confirmation message to return to the document for display in -alert box, you can sent the \texttt{silent} as part of the query -string. For example, if -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\SubmitInfo{http://myWebSite/scripts/eqAttach.asp?silent\#FDF} - {myname@mymailprovider} -\end{Verbatim} -\noindent placed in the preamble of your document specifies the -path to the script, silent mode, and the email address of the -recipient of the form data. - -\medskip\noindent -Another other feature of \textsf{eqAttach.asp} that can be changed -through the query string is the \texttt{/F} key-value pair of the -\texttt{FDF} sent out in email. The value of this key is the path -to the document that sent the \texttt{FDF}, it may be a url (an -address on the Internet) or it could be a file specification of a -local hard drive. If you specify \texttt{nopath} in the query -string, like so -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\SubmitInfo{http://myWebSite/scripts/eqAttach.asp?nopath\#FDF} - {myname@mymailprovider} -\end{Verbatim} -\noindent then \textsf{eqAttach.asp} strips out the file path and -leaves only the file name. - -\redpoint This is what I did with the \texttt{tex\_survey.tex} -source file. I placed \texttt{tex\_survey.pdf} in a \texttt{LaTeX -Survey} folder on my desktop. As the emails came in, I saved the -\textsf{FDF} attachments to this folder. By (double) clicking on -the \textsf{FDF}, \texttt{tex\_survey.pdf}, which is in the same -folder, opened and the form data populated the fields from whence -they were sent. It worked well for me. - -If you don't use the \texttt{nopath} option, when you click -on an \texttt{FDF} file you've received by email, your browser -opens and the PDF on the Internet is brought into the -browser and the form data populates the form fields, \dots at least on -a Windows machine. \texttt{:-)} - -\subsubsection{References} - -The following links were used as a reference in the development of the -\texttt{Email.asp} script. -\begin{itemize} - \item CDOSYS: - \begin{itemize} - \item \href{http://invisionportal.com/show_tutorial.asp?TutorialID=160}{Invision Portal} Tutorial: CDOSYS email tutorial - \item \href{http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdosys/html/_cdosys_imessage_interface.asp} - {MSDN}: CDO for Windows 2000. The IMessage Interface. (Use MIE to view this page.) - \item \href{http://www.asp101.com/articles/john/cdosmtprelay/default.asp}{ASP 101} Sending Email Via an External SMTP Server Using CDO - \end{itemize} - \item CDONTS - \begin{itemize} - \item \href{http://www.juicystudio.com/tutorial/asp/cdonts.html}{Juicy Studio} The ASP CDONTS Component - \item \href{http://www.devasp.com/Samples/mail.asp}{DevASP} Sending Mail from ASP with CDONTS.NewMail Object - \end{itemize} -\end{itemize} - -\section{Bells, Whistles and other Customizations} - -\subsection{Customizations}\label{custom} - -We enumerate some commands for changing the default design of \textsf{eqexam}. - -\subsubsection{Course Info Commands}\label{courseInfo} - -\textsf{eqexam} has several commands for the student to provide some identification -information. - -\redpoint \cs{eqexamName}. This command defines the macro -\cs{eq@ExamName} that creates the underlined space for the student -to enter his/her name, and also defines the text box form field, -in the case the \texttt{online} or \texttt{email} options are -taken. There are two (design) parameters for \cs{eqexamName} -\begin{Verbatim}[xleftmargin=\leftmargini,commandchars=!()] -\eqexamName[!meta(eforms_opts)]{!meta(width)} -\end{Verbatim} -\noindent The first optional parameter can be used to modify the -appearance of the text field, see the \href{eformman.pdf}{eForms} -documentation for details. The second parameter is the width of -the field. The default definition is -\begin{Verbatim}[xleftmargin=\leftmargini] -\eqexamName[\Ff\FfRequired]{2.25in} -\end{Verbatim} -\noindent Here, the text field that will be generated (when -\texttt{online} or \texttt{email} is specified) will be a required -field. The total width of the space provided is $2.25$ inches. - -The command \cs{examNameLabel} controls the label to be used for -this name field. It takes one parameter, the label -to be used for the name field; the default definition is -\verb+\examNameLabel{Name:}+. - -\redpoint \cs{eqSID}. This command defines the macro \cs{eq@SID} -that creates the underlined space for the student to enter his/her -student Identification number (SID), and also defines the text box -form field, in the case the \texttt{online} or \texttt{email} -options are taken. There are two (design) parameters for -\cs{eqSID} -\begin{Verbatim}[xleftmargin=\leftmargini,commandchars=!()] -\newcommand\eqSID[!meta(eforms_opts)]{!meta(width)} -\end{Verbatim} -\noindent The first optional parameter can be used to modify the -appearance of the text field, see the \href{eformman.pdf}{eForms} -documentation for details. The second parameter is the width of -the field. The default definition is -\begin{Verbatim}[xleftmargin=\leftmargini] -\eqSID[\Ff\FfRequired]{2.25in} -\end{Verbatim} -\noindent Here, the text field that will be generated (when -\texttt{online} or \texttt{email} is specified) will be a required -field. The total width of the space provided is $2.25$ inches. - -The command \cs{examSIDLabel} controls the label used for this SID field. -It takes one parameter, the label to be used for the name field; the -default is \verb+\examSIDLabel{SID:}+. - -\redpoint \cs{eqEmail}. This command defines the macro -\cs{eq@Email} that creates the underlined space for the student to -enter his/her student email address, and also defines the text box -form field, in the case the \texttt{online} or \texttt{email} -options are taken. There are two (design) parameters for -\cs{eqEmail} -\begin{Verbatim}[xleftmargin=\leftmargini,commandchars=!()] -\newcommand\eqEmail[!meta(eforms_opts)]{!meta(width)} -\end{Verbatim} -\noindent The first optional parameter can be used to modify the -appearance of the text field, see the \href{eformman.pdf}{eForms} -documentation for details. The second parameter is the width of -the field. The default definition is -\begin{Verbatim}[xleftmargin=\leftmargini,] -\eqEmail{2.25in} -\end{Verbatim} -\noindent Here, the text field that will be generated (when -\texttt{online} or \texttt{email} is specified). The total width -of the space provided is $2.25$ inches. - - -The command \cs{examEmailLabel} controls the label to be used for -this email field. It takes one parameter, the -label to be used for the name field; the default definition is -\verb+\examEmailLabel{Email:}+. - - -\subsubsection{Changing the Title and Cover Page} - -\redpoint \cs{maketitle}. The main heading that appears at the top -of the first page of the exam is created by the {\LaTeX} -(redefined) command \cs{maketitle}. The \cs{maketitle} has some -code to place the email button in the top margin, followed by the -expansion of the command \cs{maketitledesign}, whose definition is -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\newcommand\maketitledesign -{% - \makebox[\textwidth]{\normalsize - \shortstack[l]{\strut\websubject\\\@date}\hfill - \shortstack[c]{\webtitle\\\strut\@altTitle}\hfill - \shortstack[l]{\strut\eq@ExamName\\\webauthor}}% -} -\end{Verbatim} -This command can be redefined using \cs{renewcommand} to suite your needs, for example, -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\makeatletter -\renewcommand\maketitledesign -{% - \makebox[\textwidth]{\normalsize - \shortstack[l]{\strut\websubject\\\webauthor, \@date}\hfill - \shortstack[l]{\webtitle\\\strut\@altTitle}\hfill - \shortstack[l]{\strut\eq@ExamName\\\eq@SID}}% -} -\makeatother -\end{Verbatim} -\noindent This code adds in a field for the student to enter -his/her student Id, here we enclose the code in a -\cs{makeatletter}/\cs{makeatother} because this redefinition -occurs in the preamble, and the code has an `\texttt{@}' in it. - -Command elements that are appropriate to the redefinition are \cs{maketitledesign} are\dots -\begin{description} - \item[\cs{websubject}] This is the course name, as determined by the \cs{subject} command. - \item[\cs{webtitle}] This is the exam name as determined by the \cs{title} command. - \item[\cs{altTitle}] An additional text field that is placed below \cs{webtitle}. - \item[\cs{@date}] This is the date as determined by the \cs{date} command. - \item[\cs{eq@ExamName}] This is the name field for the student to enter his/her name, as defined - by default or redefined by \cs{eqexamName}, see \Nameref{courseInfo}. - \item[\cs{eq@SID}] This is the student ID field for the student to enter his/her ID, as - defined by default, or redefined by the command \cs{eqSID}, see \Nameref{courseInfo}. - \item[\cs{eq@Email}] This is the student email field for the student to enter an email address, as - defined by default, or redefined by \cs{eqEmail}, see \Nameref{courseInfo}. - \item[\cs{theduedate}] This is a text macro defined by the \cs{duedate} command. For example, setting - \verb+\duedate{03/10/05}+ defines \cs{theduedate} so that it expands to \texttt{03/10/05}. May - be useful when redefining \cs{maketitledesign} for a homework assignment page. -\end{description} - -\redpoint \cs{eqexcoverpagedesign}. When the \texttt{coverpage} option is -taken, a default cover page appears unless it is redefined. The -\textsf{eqexam} package provides \cs{eqexcoverpagedesign} to design your -own cover page. The default cover page uses the - -\begin{description} - \item[\cs{websubject}] This is the course name, as determined by the \cs{subject} command. - \item[\cs{webtitle}] This is the exam name as determined by the \cs{title} command - \item[\cs{webuniversity}] This is the value set by the \cs{university} command, given - in the preamble. - \item[\cs{@date}] This is the date as determined by the \cs{date} command. - \item[\cs{eq@ExamName}] This is the name field for the student to enter his/her name, as defined - by default or redefined by \cs{eqexamName}, see \Nameref{courseInfo}. - \item[\cs{eq@SID}] This is the student ID field for the student to enter his/her ID, as - defined by default, or redefined by the command \cs{eqSID}, see \Nameref{courseInfo}. - \item[\cs{eq@Email}] This is the student email field for the student to enter his/her email address, as - defined by default, or redefined by \cs{eqEmail}, see \mlNameref{courseInfo}. -\end{description} -Copy the definition of \cs{eqexcoverpagedesign} from -\textsf{eqexam.dtx} and modify as desired. Place the new -definition in the preamble (enclosed between -\cs{makeatletter} and \cs{makeatother}) or in a custom style file. No -special support for this design is offered, because a cover page -can be designed in so many different ways. - -\newtopic Another command associated with the \texttt{coverpage} option,is the -\cs{place\-Cover\-Page\-Logo}, a simple command used to insert a logo on the cover page. -The logo can be used to cover the score in the next page if the -instructor places the score under the logo. Example of usage -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\placeCoverPageLogo{5in}{-1.5in}{\includegraphics{nwfsc_logo}} -\end{Verbatim} -Working from the upper left corner, the first parameter is the amount to move to logo -to the right, the second parameter is the amount to move the logo vertically. The -Third parameter is the content; perhaps an \cs{includegraphics} command. - - -\subsubsection{Changing the Running Headers} - -There are two running headers, one header for the exam itself, and -another when the solutions are shown at the end of the document. - -\redpoint Running Header for Exam. The commands \cs{lheadeqe}, -\cs{cheadeqe} and \cs{rheadeqe} are used for defining the left, right, and -center running headers. \textbf{Note:} these commands have been recently -renamed, originally they were named \cs{lhead}, \cs{chead} and \cs{rhead}, -but this conflicts with the \textsf{fancyhdr} package. If -\textsf{fancyhdr} has not been loaded by the time \textsf{eqexam} is -loaded, the eqexam definitions for \cs{lhead}, \cs{chead} and \cs{rhead} -still hold. Generally, it is recommended that the new command be used, -\cs{lheadeqe}, \cs{cheadeqe} and \cs{rheadeqe}. - -\begin{enumerate} -\item \begin{Verbatim}[commandchars=!()] -\lheadeqe{!meta(text)} -\end{Verbatim} -Changes the left header text of the running header. This command defines an -internal macro \cs{eq@lhead} that actually contains the text. The default is -\begin{Verbatim}[xleftmargin=\leftmargini] -\lheadeqe{\shortwebsubject/\shortwebtitle} -\end{Verbatim} - -\item \begin{Verbatim}[commandchars=!()] -\cheadeqe{!meta(text)} -\end{Verbatim} -Changes the center header text of the running header. -This command defines an internal macro \cs{eq@chead} that actually -contains the text. The default is -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\cheadeqe{-- Page \arabic{page}\space of \nPagesOnExam\space--} -\end{Verbatim} - -\item \begin{Verbatim}[commandchars=!()] -\rheadeqe{!meta(text)} -\end{Verbatim} -\noindent Changes the right header text of the running header. -This command defines an internal macro \cs{eq@rhead} that actually -contains the text. -\item[]The default is \verb+\rhead{\eq@ExamName}+. -\end{enumerate} -If you want to redesign the layout of the running -header, here is the macro that the above components fill. -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\newcommand\runExamHeader{\eq@lhead\hfill\eq@chead\hfill\eq@rhead} -\end{Verbatim} - -\redpoint Running Header for Solutions. The components of the -running header for the solutions pages occur, as above, on the left, center -and right of each header are defined by the commands \cs{lheadSol}, -\cs{cheadSol} and \cs{rheadSol}. - -\begin{enumerate} -\item \begin{Verbatim}[commandchars=!()] -\lheadSol{!meta(text)} -\end{Verbatim} -\noindent Changes the left header text of the running header. This -command defines an -internal macro \cs{eq@lheadSol} that actually contains the text. The default is -\begin{Verbatim}[xleftmargin=\leftmargini] -\lheadSol{\shortwebsubject/\shortwebtitle} -\end{Verbatim} - - -\item \begin{Verbatim}[commandchars=!()] -\cheadSol{!meta(text)} -\end{Verbatim} -\noindent Changes the center header text of the running header. -This command defines an internal macro \cs{eq@cheadSol} that -actually contains the text. The default is -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\cheadSol{-- Page \arabic{page}\space of \nPagesOnExam\space--} -\end{Verbatim} - -\item \begin{Verbatim}[commandchars=!()] -\rheadSol{!meta(text)} -\end{Verbatim} -\noindent Changes the right header text of the running header. -This command defines an internal macro \cs{eq@rheadSol} that -actually contains the text. The default definition is -\verb+\rheadSol{SOLUTIONS}+. -\end{enumerate} -\noindent If you want to redesign the layout of the running -header, here is the macro that the above components fill. -\begin{Verbatim}[xleftmargin=\leftmargini] -\newcommand\runExamHeaderSol - {\eq@lheadSol\hfill\eq@cheadSol\hfill\eq@rheadSol} -\end{Verbatim} - -\subsubsection{Changing the Running Footers} - -The default set up of \textsf{eqexam} is to use no running footers; -actually, that's not quite right. \textsf{eqexam} places the command -\cs{settotalsbox} in the footer; this command is the one that places the -totals boxes, when requested. - -\newtopic\textsf{eqexam} defines three commands for the footer, -\settowidth{\aebdimen}{\ttfamily\string\lfooteqe\darg{\meta{text}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\lfooteqe{!meta(text)} -\cfooteqe{!meta(text)} -\rfooteqe{!meta(text)} -\end{dCmd} -\noindent where the \meta{text} is placed at the left, center, and -right of the running footer. The default for each is empty text. These -three comprise the definition of \cs{runExamFooter} -\begin{dCmd}{\linewidth} -\newcommand{\runExamFooter}{\eq@lfoot\hfill\eq@cfoot\hfill\eq@rfoot} -\end{dCmd} -\noindent The \cs{settotalsbox} and \cs{runExamFooter} then appear in the definition -of \cs{@oddfoot} in the definition of the \texttt{eqExamheadings} page style. -\begin{Verbatim}[xleftmargin=\leftmargini] -\renewcommand{\@oddfoot}{\settotalsbox\runExamFooter} -\end{Verbatim} -When doing any re-definition of the running footers at the \cs{@oddfoot} command, -be sure to include \cs{settotalsbox} on the \emph{left side of the running footer}; otherwise, -you will not have a totals box when you request one. - - -\subsubsection{Exam Strings} - -In this section we list a new commands that contain information about the exam. - -\settowidth{\aebdimen}{\ttfamily\string\nPagesOnExam} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\nPagesOnExam -\end{dCmd} -\noindent The command \cs{nPagesOnExam} expands to the total number of pages in the exam. - -\settowidth{\aebdimen}{\ttfamily\string\nQuesInExam\darg{\meta{exam\_name}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\nQuesInExam[!meta(exam_name)] -\end{dCmd} -\noindent \cs{nQuesInExam} expands to the total number of questions in the -exam. The command takes an optional argument, the \meta{exam\_name} -(this is the name given the exam as the required argument of the -\texttt{exam} environment). If the argument is not given, the name of the -current exam is used (when executed within an \texttt{exam} environment). -When \cs{nQuesInExam} outside an \texttt{exam} environment, the value of -the optional argument needs to be specified. - -\newtopic There are several commands are useful for documents that have several -\textsf{eqexam} environments, these are -\settowidth{\aebdimen}{\ttfamily\string\percentForPart\darg{\meta{exam\_name}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\theGrandTotal -\totalForPart{!meta(exam_name)} -\percentForPart{!meta(exam_name)} -\end{dCmd} -\noindent The first command sums the point totals for each of the -\texttt{exam} environments. The latter two, each taking one argument, the -name associated with the \texttt{exam}, reports the points for that -\texttt{exam} environment and the percent of the total for that -\texttt{exam} environment. - -\newtopic Below is a recent example taken from a final exam that I constructed for my class. -\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] -\begin{eqComments}[Final Exam:] (\theGrandTotal\space points) The -final exam has two parts: - \textbf{Part I} (\totalForPart{InstrQuestions} points or - \percentForPart{InstrQuestions} of the total points) consists of - questions written by the instructor; - \textbf{Part II} (\totalForPart{GenEd} points or - \percentForPart{GenEd} of the total points) consists of - questions provided by the Department of Mathematics. -\end{eqComments} -\end{Verbatim} - -\promoteNewPageHere{10pt} - -\handpoint The calculation of \cs{percentForPart} is done in one of two ways: -\begin{enumerate} - \item If the \textsf{fp} package is loaded, ``floating point - arithmetic'' is used and results are rounded to the number of - decimal points determined by \cs{nPctDecPts}, the default - definition of which is \verb!\newcommand{\nPctDecPts}{1}!. This command may be redefined - to another nonnegative integer value. -\item Otherwise---if the \textsf{fp} package is \emph{not - loaded}---\TeX's count registers are used, the percentage rounded - to the nearest integer. -\end{enumerate} - -\newtopic The calculations are made when the \cs{maketitle} command is -expanded. If, for whatever reason, you are not using \cs{maketitle}, you -can place the command that does the calculations, -\cs{EQEcalculateAllTotals}, just after \verb!\begin{document}!, and before -the first use of \cs{theGrandTotal} and \cs{percentForPart}. - -\settowidth{\aebdimen}{\ttfamily\string\firstPageOfExam\darg{\meta{exam\_name}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\firstPageOfExam{!meta(exam_name)} -\lastPageOfExam{!meta(exam_name)} -\end{dCmd} -\noindent These two commands expand the page numbers of the beginning and the ending -of the exam environment, respectively, with name \meta{exam\_name}. - -\subsubsection{Localization of Strings} - -% Added 01/10/06 -% \examNameLabel -% \ptsLabel, \ptsLabel -% \eachLabel -% \pointsLabel, \pointLabel -% \defaultInstructions - -In this section we list various macros that expand to text -appearing on an \textsf{eqexam} document. The default text is in -English. These commands can be redefined to other English -language phrases, or to other languages, and placed in the preamble of your document, -or in one of the \texttt{.cfg} files. - -\begin{itemize} -% Added 01/10/06 -\item\cs{examNameLabel}: On each page of the exam, there is a place -for the student to enter her/his name. \cs{examNameLabel} can be -used to define the name label, the default is -\begin{Verbatim}[xleftmargin=\leftmargini] -\examNameLabel{Name:} -\end{Verbatim} -\item \cs{examAnsKeyLabel}: When the \texttt{answerkey} option is in - effect, the line in which the student enters her/his name (labeled by - \cs{examNameLabel}) is filled by the value of the text macro - \cs{examAnsKeyLabel}. The default definition is -\begin{Verbatim}[xleftmargin=\leftmargini] -\examAnsKeyLabel{Answer Key} -\end{Verbatim} -Thus, when the \texttt{answerkey} -option is used, the name field appears as follows: -\begin{flushleft} -\underbar{\makebox[2.5in][l]{Answer Key}} -\end{flushleft} - -\item\cs{ptLabel} and \cs{ptsLabel}: Labels for indicating the points of a problem, the first is -the singular form of the second. The default is -\begin{Verbatim}[xleftmargin=\leftmargini] -\ptLabel{pt} % singular form -\ptsLabel{pts} % plural form -\end{Verbatim} -\item\cs{eachLabel}: Label for indicating the common point value of each of several parts -of the same problem. -\begin{Verbatim}[xleftmargin=\leftmargini] -\eachLabel{ea.} -\end{Verbatim} -\item\cs{pointLabel} and \cs{pointsLabel}: The word for `points' used in the \texttt{instructions} environment - that lists the number of points in this exam. The default is -\begin{Verbatim}[xleftmargin=\leftmargini] -\pointLabel{point} % singular form -\pointsLabel{points} % plural form -\end{Verbatim} -The \cs{pointsLabel} command defines \cs{eq@pointsLabel}, which, -in turn, is used in the \cs{summaryTotalsTxt}, the definition of -which follows: -\begin{Verbatim}[xleftmargin=\leftmargini] -\newcommand{\summaryTotalsTxt} - {($\summaryPointTotal\,\text{\eqpointsLabel}$)} -\end{Verbatim} -\item\cs{defaultInstructions}: The \texttt{instructions} environment has a default heading. -The command \cs{defaultInstructions} allows you to change this heading. The default is -\begin{Verbatim}[xleftmargin=\leftmargini] -\defaultInstructions{Instructions.} -\end{Verbatim} -\end{itemize} - -\newtopic See \Nameref{ptTotalsBoxes} as well as the section \mlNameref{courseInfo} for -additional details on these and commands useful for laying out the -standard text of an \textsf{eqexam} document. - -\subsubsection{Customization of Color}\label{customColor} - -When the \texttt{forcolorpaper} option is used, various elements---such as -section titles, instruction headers, color for fill-in problems, and so on---have default colors. In -this section we list the color controls, along with their default definitions. - -\begin{Verbatim}[numbers=left,xleftmargin=\leftmargini,fontsize=\fontsize{10}{14}\selectfont] -\proofingsymbolColor{red} -\instructionsColor{blue} -\eqCommentsColor{blue} -\eqCommentsColorBody{black} -\universityColor{blue} -\titleColor{black} -\authorColor{black} -\subjectColor{blue} -\linkcolor{blue} -\nolinkcolor{blue} -\fillinColor{red} -\forceNoColor -\end{Verbatim} - -\noindent\textbf{Description of Color Commands:} -\begin{enumerate} - \item The color of the proofing symbol, it appear for multiple - choice questions with the \texttt{answerkey} option in effect. - \item The color of the header text for the \texttt{instructions} environment. - The header is the text that appears in the optional argument. - \item The color for the header text for the \texttt{eqComments} environment. - The header is the text that appears in the optional argument. - \item The color for the body of the text for the \texttt{eqComments} environment. - \item The color of the university, visible only when the \texttt{coverpage} option is taken. - \item The color of the title, visible only when the \texttt{coverpage} option is taken. - \item The color of the author, visible only when the \texttt{coverpage} option is taken. - \item The color of the subject, visible only when the \texttt{coverpage} option is taken. - \item The color applied to a link, applies only when \textsf{hyperref} is included through one of the PDF options, - \texttt{links}, \texttt{online}, or \texttt{email}. - \item The color applied to a link that has been turned off, applies - only when \textsf{hyperref} is included through one of the PDF options, - \texttt{links}, \texttt{online}, or \texttt{email}. - \item The color of the a fill-in (including a True/False question) - when one of the options \texttt{answerkey}, - \texttt{vspacewithsolns}, or \texttt{solutionsonly} is - taken. - \item This convenience command forces all the above colors to black. Useful when you want to use the - \texttt{showgrayletters}. This produces a black and white document, with gray letters. (If you use the - \texttt{forpaper} option, the gray letters appear black.) -\end{enumerate} - - -\subsection{Creating Multiple Versions of Exam} - -Unfortunately, I teach multiple sections of the same course, and -am faced with the problem of writing different exams for the same -course each administered to a different section. - -Typically, I only have a need for two variations on the test; however, -further extensions can be made, if needed (See \Nameref{mutiVerNew}) - -\subsubsection{The Original Version Scheme}\label{mutiVerOrig} - -The \textsf{eqexam} package defines a boolean switch, -\cs{ifVersionA} for this purpose. The two sections of the same -course are ``Version A'' and ``Version B''. The default is that -you are preparing an exam for ``Version A''. - -The command \cs{forVersion} sets the version: \verb+\forVersion A+ -sets version to ``Version A'', and \verb+\forVersion B+ set the -version to ``Version B''. (The argument of the \cs{forVersion} command is case -insensitive, so you also type in \verb+\forVersion b+.) - -For small variations in text, there is the \cs{ifAB} macro, -\settowidth{\aebdimen}{\ttfamily\string\ifAB\darg{\anglemeta{Version A text}}% -\darg{\anglemeta{Version B text}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\ifAB{!anglemeta(Version A text)}{!anglemeta(Version B text)} -\end{dCmd} -\noindent for example, one could say, -\begin{Verbatim}[xleftmargin=\leftmargini] -\begin{problem}[2] -Compute $\frac{d}{dx}\ifAB{x^2}{x^3}$. -\end{problem} -\end{Verbatim} -\noindent For longer variations, the \texttt{comments} package is -used to create comment environments that are included or excluded. -The two environments are \texttt{verA} and \texttt{verB}. -\begin{Verbatim}[xleftmargin=\leftmargini] -\begin{problem}[2] -Compute $\frac{d}{dx}\ifAB{x^2}{x^3}$. - -\begin{solution}[1in] -We use standard techniques: -\begin{verA} -$$ - \frac{d}{dx} x^2 = 2x -$$ -\end{verA} -\begin{verB} -$$ - \frac{d}{dx} x^3 = 3x^2 -$$ -\end{verB} -\end{solution} -\end{problem} -\end{Verbatim} - -There are several convenience macros for referring to the exams -generated by the two variations. - -Usually, an exam, test, homework assignment has a number associate -with it, e.g. ``Exam 1'', ``Test 2'', ``Assignment~\#12'', etc\@. -This number should be defined using the \cs{examNum} macro. -\settowidth{\aebdimen}{\ttfamily\string\examNum\darg{\meta{num}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\examNum{!meta(num)} -\end{dCmd} -where \meta{num} is the number to be associated -with the exam (test, assignment) under construction. - -This command \emph{must appear before} \cs{title} in the -preamble. The command \cs{examNum} takes its argument and defines -another macro \cs{nExam}, which has no arguments, but expands to -\meta{num}. - -The \textsf{eqexam} package defines two commands \cs{Exam} and -\cs{sExam} to automatically enter the test information for the -current version. In the preamble, you can say, -\begin{Verbatim}[xleftmargin=\leftmargini] -\title[\sExam]{\Exam} -\end{Verbatim} -\noindent \cs{Exam} is the long version of the test name, and takes as its -argument the exam number. \cs{sExam} is the short version, having no -argument. Both \cs{Exam} and \cs{sExam} use the value determined by -\cs{examNum}, described above. - -The text of \cs{Exam} and \cs{sExam} are generated by the four -commands, -\begin{enumerate} -\item \cs{VersionAtext\darg{\meta{text}}} This is the text for the long -version of the exam name for ``Version A''. The default text is -\begin{Verbatim}[xleftmargin=\leftmargini] -\VersionAtext{Exam~\nExam--Version A} -\end{Verbatim} - -\item \cs{VersionBtext\darg{\meta{text}}} This is the text for the long -version of the exam name for ``Version B''. The default text is -\begin{Verbatim}[xleftmargin=\leftmargini] -\VersionAtext{Exam~\nExam--Version B} -\end{Verbatim} - -\item \cs{shortVersionAtext\darg{\meta{text}}} This is the text for the -short version of the exam name for ``Version A''. The default text -is -\begin{Verbatim}[xleftmargin=\leftmargini] -\VersionAtext{Exam~\nExam A} -\end{Verbatim} - -\item \cs{shortVersionBtext\darg{\meta{text}}} This is the text for the -short version of the exam name for ``Version B''. The default text -is -\begin{Verbatim}[xleftmargin=\leftmargini] -\VersionAtext{Exam~\nExam B} -\end{Verbatim} -\end{enumerate} - -\redpoint All the above commands, -\textbf{\textcolor{blue}1}--\textbf{\textcolor{blue}4}, need to -appear before \cs{title} in the preamble.\medskip - -\noindent Below is a ``typical'' example of how to correctly -redefine all the version text. -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\documentclass{article} -\usepackage{amsmath} -\usepackage[forpaper,pointsonleft,noparttotals,nosolutions]{eqexam} - -\examNum{1} -\forVersion{B} -\VersionAtext{Test~\nExam--003} -\VersionBtext{Test~\nExam--007} -\shortVersionAtext{T{\nExam}s3} -\shortVersionBtext{T{\nExam}s7} - -\title[\sExam]{\Exam} -\author{D. P. Story} -\subject[C2]{Calculus II} -\date{Spring \the\year} -\keywords{Test \nExam, Section \ifAB{003}{007}} -\end{Verbatim} - - -\subsubsection{New Version Control}\label{mutiVerNew} - -In this section we introduce a new set of commands that supersede -the commands defined above. Those commands were limited to only -two versions. The ones below can handle up to $26$ versions. - -The steps for creating a multiple version \textsf{eqexam} document are as follows. -\settowidth{\aebdimen}{\ttfamily\string\numVersions\darg{\meta{num}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\numVersions{!meta(num)} -\end{dCmd} -\noindent In the preamble, declare the number of versions for this document - using \cs{numVersions}, e.g., \verb|\numVersions{3}|. -\begin{Verbatim}[xleftmargin=\leftmargini,commandchars=!()] -\longTitleText - {!anglemeta(Text_1)} - {!anglemeta(Text_2)} - ... - {!anglemeta(Text_n)} -\endlongTitleText -\end{Verbatim} -\begin{Verbatim}[xleftmargin=\leftmargini,commandchars=!()] -\shortTitleText - {!anglemeta(Text_1)} - {!anglemeta(Text_2)} - ... - {!anglemeta(Text_n)} -\endshortTitleText -\end{Verbatim} -\textbf{Note:} If there are more titles than what are declared, the rest -of the titles are absorbed (gobbled). If there are fewer titles than declared, a -{\LaTeX} package error is generated, and ``fake'' titles are -generated. - - -\newtopic Next, state the long and short titles for the document, -one for each of the declared number of versions given earlier in \cs{numVersions}. -For example, we can use the value \cs{nExam} in our titles. Usage: -\begin{Verbatim}[xleftmargin=\leftmargini] -\longTitleText - {Test~\nExam--Version A} - {Test~\nExam--Version B} - {Test~\nExam--Make Up} -\endlongTitleText -\shortTitleText - {T\nExam A} - {T\nExam B} - {T\nExam MU} -\endshortTitleText -\end{Verbatim} -These two commands give values to \cs{Exam} and \cs{sExam}. If -\verb!\forVersion{a}! is executed, \cs{Exam} expands to the text \verb|Test~\nExam--Version A| and -\cs{sExam} expands to \verb|T\nExam A|, using the example above. The value of \cs{nExam} -is determined by the \cs{examNum} command, as described above. - -\newtopic Next is the command that does all the work. It creates alternate -text macros for each of the versions declared using \cs{numVersions}. The syntax is -\settowidth{\aebdimen}{\ttfamily\string\forVersion\darg{\meta{letter}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\forVersion{!meta(letter)} -\end{dCmd} -For example, assuming \verb|\numVersions{3}|, \verb|\forVersion{a}| (or \verb|\forVersion{A}|) defines $3$ text commands \cs{vA}, \cs{vB} and -\cs{vC}, each taking one argument, the text you want to display: -\begin{Verbatim}[xleftmargin=\leftmargini] - Name the \vA{place}\vB{date}\vC{year} of the signing - of the Magna Carta. -\end{Verbatim} -\noindent Since \verb|forVersion{a}| was declared, only the \cs{vA} text -is displayed, the others are gobbled up. But wait, time out, the \cs{forVersion} -does more than that! It also creates a series of comment environments -\verb|\begin{verA}/\end{verA}|, \verb|\begin{verB}/\end{verB}|, \verb|\begin{verC}/\end{verC}|, etc., -where only the version for which this compile applies will be typeset, -the others are commented out. -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\numVersions{3} -\forVersion{b} -... -\begin{document} -... -Solve the equation for $\vA{x}\vB{y}\vC{z}$: -\[ -\begin{verA} - 2x + 4 = 7 -\end{verA} -\begin{verB} - 5y + 2 = 4 -\end{verB} -\begin{verC} - 3z - 2 = 2 -\end{verC} -\] -\end{Verbatim} - -\noindent Here is a final example of the multiple version scheme, taken from the preamble of one of -my Calculus tests. - -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\documentclass{article} -\usepackage{amsmath,graphicx} -\usepackage[forpaper,pointsonleft,nototals,nosolutions]{eqexam} -%\usepackage[forpaper,pointsonleft,nototals,answerkey]{eqexam} - -\numVersions{3} -\forVersion{a} -\examNum{1} -\longTitleText - {Test \nExam--Version A} - {Test \nExam--Version B} - {Test \nExam--Make Up} -\endlongTitleText -\shortTitleText - {T\nExam A} - {T\nExam B} - {T\nExam MU} -\endshortTitleText - -\subject[C3]{Calculus III} -\title[\sExam]{\Exam} -\author{Dr.\ D. P. Story} -\university -{% - THE UNIVERSITY OF AKRON\\ - Department of Theoretical and Applied Mathematics -} -\date{\thisterm\space\the\year} % Fall 2005 -\duedate{09/26/05} % actual date of the test -% If you convert to pdf using a pdf (links, online, email) -% option, this will appear in the keywords field of the -% document info dialog. -\keywords{\Exam, administered \theduedate} -\end{Verbatim} - -\newtopic There is one additional command that can be used to locally control -which version that is typeset in the document. -\settowidth{\aebdimen}{\ttfamily\string\selectVersion\darg{\meta{num}}% -\darg{\meta{total\_versions}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\selectVersion{!meta(num)}{!meta(total_versions)} -\end{dCmd} -You can place the \cs{selectVersion} command in front of a question or a part of a question -that has multiple versions. Through this command you can select which version to typeset, -provided the option \texttt{obeylocalversions} is set. For example, -\begin{Verbatim}[xleftmargin=\leftmargini] -\selectVersion{3}{4} -\begin{problem}[10] -... -\end{problem} -\end{Verbatim} -\noindent The \cs{selectVersion} command says there are four variations on the next question -and the document author wants to use the third one (that would correspond to C, in the -\cs{forVersion} command). Again, the \texttt{obeylocalversions} must be taken for -\textsf{eqexam} to obey this command. - -\newtopic \textbf{Recommendation:} Each problem should -have the command \cs{selectVersion} in front of it, even for parts. -Suppose the document author says \verb!\numVersions{5}!, but some -problems don't have five versions, what do you do? If there is a -\cs{selectVersion} in front of a problem with multiple versions, the -\cs{selectVersion} will partially expand to determine if it is -needed. It is needed if the version specified by \cs{forVersion}, is -greater than the number of versions for the problem. In this case, -\cs{selectVersion} performs modular arithmetic to compute which -version is to be used. For example, if \verb!\forVersion{E}! has -been declared in the preamble, but a problem has only three -variations, the \textsf{eqexam} will use variation B; if -\verb!\forVersion{D}! was declared, version A is -used, and so on. - - -\subsection{The Point and Totals Boxes}\label{ptTotalsBoxes} - -There are two types of points boxes, but only one type of totals -box. All the commands listed below can be redefined for language -localizations, for example. - -\redpoint Points that appear in the left margin (the -\texttt{pointsonleft} or \texttt{pointsonboth} options). There are two text macros -that are used, -\begin{Verbatim}[xleftmargin=\leftmargini] -\newcommand\leftmarginPtsTxt[1]{(\small$#1^{\text{pts}}$)} -\end{Verbatim} -\noindent when the total points for that problem are shown, and the other -\begin{Verbatim}[xleftmargin=\leftmargini] -\newcommand\leftmarginPtsEaTxt[1] - {(\small$#1_{\text{ea.}}^{\text{pts}}$)} -\end{Verbatim} -\noindent when the author indicates that each sub-part of a problem -is weighted the same, (when the author begins a \texttt{problem*} -environment with \verb+\begin{problem*}[3ea]+, for example). - -\redpoint Points that appear in the right margin (options -\texttt{pointsonright} or \texttt{pointsonboth}). These points appear -in the bottom half of a box, the text for that box is determined by the -following definition. -\begin{Verbatim}[xleftmargin=\leftmargini] -\newcommand\marginpointsboxtext[2]{\small$#1\,\text{pts}$} -\end{Verbatim} -\noindent By the way, the purpose of the upper part of the box is -for the instructor to enter the number of points a student -received for that problem. - -\redpoint Points specified by the \cs{PTs} command. This text is -defined by \cs{itemPTsTxt} as follows. See the paragraphs on -\Nameref{problemstar} for a discussion of the use of \cs{PTs}. -\begin{Verbatim}[xleftmargin=\leftmargini] -\newcommand\itemPTsTxt[1]{($#1$ pts)} -\end{Verbatim} - -\redpoint \textbf{The totals box.} When you specify either option -\texttt{totalsonleft} or \texttt{totalsonright}, you get a page totals -box appearing in the lower left or right bottom corner. -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\small] -\newcommand\totalsboxtext{\small$\theeqpointsthispage\,\text{pts}$} -\end{Verbatim} -where \texttt{eqpointsthispage} is a counter whose value -at the end of each page \emph{should} be the page total. For tests -that have multiple \texttt{exam} environments, if one exam part -ends on a page, and another begins on the same page, this number -(\texttt{eqpointsthispage}) is the total on the page from the -beginning of the new exam part. In this case, at the end of the -exam part, there should also appear a remaining total for that -part on that page. - -The totals boxes are located in the lower right corner -(\texttt{totalsonright}) or in the lower left corner -(\texttt{totalsonleft}). Vertical placement of these boxes is controled -by the length \cs{eqevtranstotbox}, its default value is -\texttt{0pt}. To raise the boxes \texttt{6pt}, for example, -execute \verb!\setlength{\eqevtranstotbox}{6pt}!; the box may be lowered -by using a negative length. - -\redpoint \textbf{Summary Totals.} When you use the \texttt{instructions} -environment to give initial instructions for an exam, the total -points appears automatically in the text, unless you specify the -\texttt{nosummarytotals} option. This text is defined by -\cs{summaryTotalsTxt}, whose definition follows: -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\newcommand\summaryTotalsTxt{($\summaryPointTotal\,\text{points}$)} -\end{Verbatim} -\noindent where \cs{summaryPointTotal} is a macro that expands to -the total for this \texttt{exam} environment. - -\subsection{The \texttt{eqComments} Environment} - -In addition to the \texttt{instructions} environment, as explained -in the section~\ref*{exam}, entitled \Nameref{exam}, should you want to insert -additional instructions from within the body or the exam, use the -\cs{eqComments} environment. The \cs{eqComments} environment has -one optional argument, a formatted heading for the comments you -want to make. For example, -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{eqComments}[Proofs.] -Solve each of the problems~5--8 on a separate sheet of paper, -do not write on the back of the paper. Follow the instructions -provided for each problem. Use your little gray cells. -\end{eqComments} -\end{Verbatim} -\noindent Such instructions must go between problems, of course, -not within the body of either a \texttt{problem} or a -\texttt{problem*} environment. - -\redpoint The optional argument has a color associated with it, and -is visible when you compile the document with the -\texttt{forcolorpaper} option. \cs{eqCommentsColor} colors the text that may appear -in the optional argument of the environment; \cs{eqCommentsColorBody} colors the body -of the text. Each take a single named color argument. -\begin{Verbatim}[xleftmargin=\leftmargini] -\eqCommentsColor{blue} -\eqCommentsColorBody{black} -\end{Verbatim} -The above are the default definition. - -\subsection{The \texorpdfstring{\protect\cs{OnBackOfPage}}{\textbackslash OnBackOfPage} Command}\label{onbackofpage} - -In order to reduce the number of pages needed for an exam, I often -cheat by asking the student to work on the back of one of the test -pages. -\begin{Verbatim}[xleftmargin=\leftmargini] -\newcommand\bopText{on the back of page~\boPage} -\newcommand\bopCoverPageText{(the cover page)} -\newcommand\OnBackOfPage[1][\bopText]{% -\end{Verbatim} - -For this, I use the \cs{OnBackOfPage} command -\settowidth{\aebdimen}{\ttfamily\string\OnBackOfPage[\meta{text}]} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\OnBackOfPage[!meta(text)] -\end{dCmd} -\noindent The optional argument allows you to enter variational -text, text that varies from the default text. The default text is -contained in \cs{bopText} macro, its definition is -\begin{Verbatim}[xleftmargin=\leftmargini] -\newcommand\bopText{on the back of page~\boPage} -\end{Verbatim} -\noindent where \cs{boPage} is the page the student is instructed -to do the work. Thus, if you say, ``Continue \cs{OnBackOfPage}.'' -This would expand to ``Continue on the back of page 2.'', or -whatever \cs{boPage} is determined to be. - -\newtopic To illustrate the use of the optional argument of -\cs{OnBackOfPage}, you might say, -\begin{quote} - \verb+\OnBackOfPage[The back of page~\boPage]+ can be used\\ - to continue work, if necessary. -\end{quote} -This expands to -``The back of page 2 can be used to continue work, if necessary.'' - -The algorithm used to compute the page, \cs{boPage}, on which to -continue to work is as follows: For all pages, except for the -first page of the test, the student works on the back of the -previous page. For the first page of the test, the student works -on the back of the first page, unless there is a cover page, in -which case the student is instructed to work on the back of that -page. - -In the case of working on the back of the cover page, there is a variation on the -instructions, \cs{OnBackOfPage} expands to ``on the back of page 1 (the cover page)''. -The phrase ``(the cover page)'' can be redefined using the \cs{bopCoverPageText} command. -The definition of this command is -\begin{Verbatim}[xleftmargin=\leftmargini] -\newcommand\bopCoverPageText{\space(the cover page)} -\end{Verbatim} -\noindent We could change this as follows, -\begin{Verbatim}[xleftmargin=\leftmargini] -\renewcommand\bopCoverPageText{, the cover page} -\end{Verbatim} -\noindent so that it would now read, ``on the back of page 1, the cover page''. To remove this feature -altogether, you could redefine as -\begin{Verbatim}[xleftmargin=\leftmargini] -\renewcommand\bopCoverPageText{} -\end{Verbatim} - -\subsection{\texorpdfstring - {The \cs{pushProblem} and \cs{popProblem} Commands} - {The \CMD{pushProblem} and \CMD{popProblem} Commands} -} - - -There may be an occasion when a multi-part question needs to be broken between parts, -use the \cs{pushProblem} and \cs{popProblem} for this purpose. The push saves the -counter value, and ends the \texttt{parts} environment. The pop restarts the -\texttt{parts}, and resets the parts counter. - -\newtopic -In the \texttt{multicols} environment below, we \cs{pushProblem}, then close \texttt{multicols}, we execute \cs{popProblem}, and then continue with the multi-parts in single column. -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem*}[\auto] -Do each of the following without error. -\begin{multicols}{2} - \begin{parts} - \item\PTs{3} This is a problem. - \begin{solution}[1in]\end{solution} - - \item\PTs{3} This is a problem. - \begin{solution}[1in]\end{solution} -\pushProblem -\end{multicols} -\popProblem - \item\PTs{4} Do this harder problem. - \begin{solution}[.5in]\end{solution} - \end{parts} -\end{problem*} -\end{Verbatim} -\newtopic In the example, the first two questions appear in two -column format, while the third appears in single column format. The -same thing can be done in reverse, like so: -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem*}[\auto] -Do each of the following without error. - \begin{parts} - \item\PTs{3} This is a problem. - \begin{solution}[1in]\end{solution} -\pushProblem -\begin{multicols}{2} -\popProblem - \item\PTs{4} This is a hard problem. - \begin{solution}[1in]\end{solution} - \item\PTs{4} Do this harder problem. - \begin{solution}[1in]\end{solution} - \end{parts} -\end{multicols} -\end{problem*} -\end{Verbatim} -\newtopic Now, first question is in single column and the next two are in two column format. - -\handpoint In order to get the correct formatting, the \texttt{multicols} environment must begin -before the \texttt{parts} environment. - -%\newtopic See \texttt{quiz02.tex} for an example of \cs{pushProblem} and \cs{popProblem}. - -\exAeBBlogPDF{p=1211} See \texttt{\href{\urlAcroTeXBlog/?p=1211}{quiz02.pdf}} -for an example of \cs{pushProblem} and \cs{popProblem}. - - -\subsection{\texorpdfstring{\protect\cs{qNewPage}, \protect\cs{aNewPage}, - and \protect\cs{promoteNewPage}} - {\CMD{qNewPage}, \CMD{aNewPage}, and \CMD{promoteNewPage}}}\label{aqpNewPage} - -The command \cs{qNewPage} (questions newpage) and \cs{aNewPage} -(answers newpage) are convenience commands for creating new pages. -The first one expands to \cs{newpage} when the \cs{ifanswerkey} is -false and the second one expands to \cs{newpage} when the -\cs{ifanswerkey} is true; their definitions are -\begin{Verbatim}[xleftmargin=\leftmargini] -\newcommand\qNewPage{\ifanswerkey\else\newpage\fi} -\newcommand\aNewPage{\ifanswerkey\newpage\fi} -\end{Verbatim} - -The \cs{promoteNewPage} can be used to insert a page break, if needed. -\settowidth{\aebdimen}{\ttfamily\string\promoteNewPage\darg{\meta{vspace}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\promoteNewPage[!meta(vspace)] -\end{dCmd} -If there is more than \meta{vspace} left on the current page, a -\cs{newpage} command is executed (a \cs{columnbreak} if in a -\texttt{multicols} environment). The default value for \meta{vspace} -is \cs{@fvsizeskip}\cs{textheight}, where \cs{@fvsizeskip} is a decimal -number between 0 and 1 that is set by \cs{fvsizeskip}. The default is -\verb!\fvsizeskip{.3}!. This means that if there is less than -\verb!.3\textheight!, and new page is created. This may be too large for -most applications, so you can pass a \meta{vspace} through the optional argument. -For example, \cs{promoteNewPage[.25in]}. - - - -\subsection{Support for Solution Sets from a Text}\label{solnSets} - -I use \textsf{eqexam} not only for exams, quizzes and homework -assignments, but also for solution sets for problems assigned from the text. - -Suppose the assignment was to solve, on a certain page in the text, -problems which include \textbf{2}, \textbf{6} and \textbf{12(b)(d)} and -it is desired to provide solutions to these problem. For this -purpose, \textsf{eqexam} provides \cs{forproblem} and \cs{foritem}. These -commands are used as follows: -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{exam}{HW\nExam} -\begin{instructions}[Description] (10 points) -Selected solutions from Assignments~24, 25, \S7.1. -\end{instructions} - -\begin{eqComments}[\S7.1] -\textbf{Solving Linear Equations} -\end{eqComments} - -\forproblem{2} -\begin{problem} -Statement of problem. -\begin{solution} -Solution to this problem. -\end{solution} -\end{problem} - -\forproblem{6} -\begin{problem} -Statement of problem. -\begin{solution} -Solution to this problem. -\end{solution} -\end{problem} - -\forproblem{12} -\begin{problem*} -Statement of problem. -\begin{parts} - \foritem{b} Statement for item (b) - \begin{solution} - Solution to this problem. - \end{solution} - - \foritem{d} Statement for item (d) - \begin{solution} - Solution to this problem. - \end{solution} -\end{parts} -\end{problem*} -\end{exam} -\end{Verbatim} - -\subsection{Referencing Multiple Choice Questions}\label{showgraylettersOpt} - -When the \texttt{showgrayletters} option is used, each alternatives in a -multiple choice question will have a gray capital letter \texttt{A}, -\texttt{B}, \texttt{C}, etc. underneath it. This letter can then be -referred to in the text or the solution. - -The use of this option is global and is controlled by the switch, -\cs{ifaeb\-show\-gray\-letters}. The gray letter feature can be turned on -and off locally: To turn on this feature, insert the command -\cs{graylettersOn} at some appropriately chosen point in -the document; to turn off the gray letter feature insert -\cs{graylettersOff}. - -\newtopic In support of the \texttt{showgrayletters} option is a new -command \cs{REF}. \cs{REF} acts like the {\LaTeX} command \cs{ref} -with the hyperref modifications, but it converts the reference to -uppercase. When \cs{ref} would typeset the letter `a', for example, -\cs{REF} would typeset the letter `A'. \cs{REF}, like \cs{ref}, -typesets a hyperref link. Hyperref defines a \texttt{*} version of -\cs{ref}; \cs{ref*} typesets the reference, but does not create a -link; \cs{REF*} does the same. When \cs{aebshowgraylettersfalse} is -in effect, \cs{REF} does not capitalize the reference. - -\redpoint Below is an example of this. -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{problem}[5] -Answer this if you can! -\begin{answers}{2} -\bChoices - \Ans0\label{testsqFirst} This is a possible answer.\eAns - \Ans1\label{testsqSecond} Try this one (the correct one).\eAns - \Ans0 This is an answer.\eAns - \Ans0 Another alternative.\eAns -\eChoices -\end{answers} -\begin{solution} -We reference alternatives (\REF*{testsqFirst}), an incorrect answer, -and (\REF{testsqSecond}), the correct answer. -\end{solution} -\end{problem} -\end{Verbatim} -\newtopic Notice that the gray letters was not turned to off -until after the usage of \cs{REF}. - -\newtopic\textcolor{red}{\bfseries Important} The gray letters are typeset into the document. Do not -use a background color for the checkboxes as this color will cover -up the gray letters. The default background color checkboxes is -transparent, keep it that way. - -\newtopic When typesetting an exam for paper (using the \texttt{forpaper} -option), the gray letters appear as black letters. If you want actual gray -letters, you have to use the \texttt{forcolorpaper} option. In this case, -you'll see the blue color appearing in various places. Change these blue -colors to black using the following commands in the preamble: -\settowidth{\aebdimen}{\ttfamily\string\forceNoColor} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\forceNoColor -\end{dCmd} - - -\subsection{Displaying Points between two Markers} - -Some instructors might like a subdivide the exam into segments (or parts) and to have a total for -that segment of problems. The \textsf{eqexam} package offers three commands for that purpose. -\settowidth{\aebdimen}{\ttfamily\string\calcFromMarkers[\meta{formatting}]\darg{\meta{name2}}\darg{\meta{name3}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\placeMarkerHere{!meta(name)} -\calcFromMarkers[!meta(formatting)]{!meta(name2)}{!meta(name3)} -\markerTotalFmt{!meta(formatting)} -\end{dCmd} -Place \cs{placeMarkerHere} outside of a \texttt{problem}/\texttt{problem*} environment, giving each -a unique name; for example \verb!\placeMarkerHere{bQForm}!. Place -\cs{calcFromMarkers} wherever you wish a calculation to be displayed, for example, - -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\placeMarkerHere{bQForm} -\begin{eqComments}[Quadratic Formula\calcFromMarkers{eQForm}{bForm}.] -Solve each of the following equations using the quadratic formula. -\end{eqComments} -.. -\begin{problem}[5] -... -\end{problem} -... -% Finished with problems that use the quadratic formula, -% now create another marker for the next set of questions. -\placeMarkerHere{eQForm} -... -\end{Verbatim} -After you {\LaTeX} three times (and the totals are all brought up to date), -the header of the \textbf{eqComments} should read \textbf{Quadratic -Formula (12 points)}, where the \textbf{12 points} are the total of all -points assigned between the \texttt{bQForm} marker and the \texttt{eQForm} -marker. - -The formatting for the total points between markers is determined by the optional first parameter -of \cs{calcFromMarkers}, and if there is no optional first parameter, by a global command, -\cs{markerTotalFmt}, which sets the default formatting. The default definition of -\cs{markerTotalFmt} is -\begin{Verbatim}[xleftmargin=\leftmargini] -\markerTotalFmt{ (\themarkerCnt\space points)} -\end{Verbatim} -The command \cs{themarkerCnt} references the counter \texttt{markerCnt} in which the calculations are made. -Any redefinition of \cs{markerTotalFmt} should use \cs{themarkerCnt} to reference to value. - -You use the optional first parameter the same way as the definition of \cs{marker\-Total\-Fmt}. You can say, for -example, you can type -\begin{Verbatim}[xleftmargin=\leftmargini] -\calcFromMarkers[ $\themarkerCnt^{\text{pts}}$]{eQForm}{bForm} -\end{Verbatim} -to get a formatted total \verb*! $12^{\text{pts}}$!, which typesets to ` $12^{\text{pts}}$'. - -You might have noticed that I've inserted a space character at the beginning of the definition -\verb*!\markerTotalFmt{ (\themarkerCnt\space points)}!, and place \cs{calc\-From\-Markers} up against -the previous word, as in -\begin{Verbatim}[xleftmargin=\leftmargini] -Quadratic Formula\calcFromMarkers{eQForm}{bForm}. -\end{Verbatim} -This is so that when the required totals are not defined---early in the {\LaTeX}ing process---there -is no space between \texttt{Formula} and the period (.); this is nothing but a cosmetic trivial point. After -you {\LaTeX} enough times, the full expansion appears as, -\begin{Verbatim}[xleftmargin=\leftmargini] -Quadratic Formula (12 points). -\end{Verbatim} - - -\subsection{Extending the \texorpdfstring{\protect\cs{fillin}}{\CMD{fillin}} Command}\label{extendfillin} - -When the document author uses the \texttt{usexkv} option, and the -\textsf{xkeyval} package is found on the document author's system, -the \cs{fillin} command is redefined to use key-value pairs in the -optional first argument. The syntax for \cs{fillin} now is, -%\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\fontsize{9}{11}\selectfont] -\begin{dCmd}[commandchars=!(),fontsize=\small]{\linewidth} -\fillin[ - underline=true|false,u,b,boxed=true|false,boxpretext=!anglemeta(text), - align=l|r|c,boxsize=!anglemeta(!upshape(\tiny|...|normalsize|large|...|Huge)), - color=!anglemeta(namedcolor),format=!anglemeta(!upshape\bfseries|\ttfamily|\Large|!meta(whatever)), - enclosesoln=!anglemeta(!upshape(true|false)),fitwidth=!anglemeta(!upshape(true|false)) -]{!meta(width)}{!meta(answer)} -\end{dCmd} -\textbf{Parameter Description.} \cs{fillin} takes three parameters. -\begin{enumerate} -\item The first optional parameter uses a key-value system, these allow the document author -to set the appearance and behavior of the field. The keys are described below. - -\item The second parameter \meta{width} is the amount of horizontal -space to leave for the student to write in the response. For example, -\begin{Verbatim}[xleftmargin=\leftmargini] -\fillin[boxed,boxsize=Large]{1.5in}{$2x - 3$} -\end{Verbatim} -Yields the following results, depending on the option. -\begin{alignat*}{2} -&\makebox[1.5in][c]{\text{\texttt{nosolutions} option}}&&\qquad -\makebox[1.5in][c]{\text{\texttt{answerkey} option}}\\ -&\boxed{\text{\Large\strut}\makebox[1.5in]{\hfill}}&&\qquad -\boxed{\text{\Large\strut}\makebox[1.5in]{$2x-3$}} -\end{alignat*} -If this parameter is left empty, -the \textsf{eqexam} uses the \meta{answer} parameter to determine the width of the field. -The code -\begin{Verbatim}[xleftmargin=\leftmargini] -\fillin[boxed,boxsize=Large]{}{$2x - 3$} -\end{Verbatim} -gives a box the same width as the answer, $2x-3$, which is not very wide -in this case. On the test, (compiled with the \texttt{nosolutions} option) -the student would see this box -$\boxed{\text{\Large\strut}\text{\phantom{$2x-3$}}}$. Though we can typeset the -answer into this box, it is too narrow for the student to write the answer -into; a better strategy is as follows: -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\small] -\fillin[boxed,boxsize=Large]{\ifNoSolutions{1.5in}{}}{$2x - 3$} -\end{Verbatim} -Now, when the file is compiled under different options, we obtain -\begin{alignat*}{2} -&\makebox[1.5in][c]{\text{\texttt{nosolutions} option}}&&\qquad -\makebox[1.5in][c]{\text{\texttt{answerkey} option}}\\ -&\boxed{\text{\Large\strut}\makebox[1.5in]{\hfill}}&&\qquad -\makebox[1.5in][c]{$\boxed{\text{\Large\strut}2x-3}$} -\end{alignat*} -For the answer key version, the answer is enclosed is tightly enclosed, a -cosmetic difference. See also the \texttt{fitwidth} option. - -\item[] The command \verb!\ifNoSolutions{#1}{#2}! executes the first parameter if -the compile option is \texttt{nosolutions}, otherwise it executes the second parameter. - -\item The third argument, \meta{answer}, is the correct answer; this correct answer -appears when the document is compiled with the \texttt{answerkey} option. -\end{enumerate} - -\newtopic\textbf{The description of the key-value pairs for \cs{fillin}:} -\begin{description} - \item[\texttt{underline}:] A Boolean switch, which if \texttt{true}, the - fill-in region is underlined. The default is \texttt{false}, the region - is not underlined. - \item[\texttt{u,b}:] Legacy options. If \texttt{u} is chosen, the region is - underlined, if \texttt{b} is chosen, the region is not underlined. Use - of the \texttt{underline} key is recommended. - \item[\texttt{boxed}:] A Boolean switch, which if \texttt{true}, the - fill-in region is boxed in using the \cs{boxed} command of - \textsf{amsmath} package. The default is \texttt{false}, the region is - not boxed. - \item[\texttt{boxpretext}:] A key that takes \meta{text} as its value. This - value will be placed in front of the third argument, labeled - \meta{answer} above. The \meta{text} appears in the box even when - the \texttt{answerkey} is not in effect. This key is ignored if the - \texttt{boxed} option is not taken. - - This option allows you to create an expression like -\begin{equation*} - \boxed{ y =\hspace{1in}\text{\Large\strut}}\quad\text{and with \texttt{answerkey}}\quad - \boxed{ y = \rlap{$2x^2 + 1$}\hspace{1in}\text{\Large\strut}} -\end{equation*} - \item[\texttt{boxsize}:] This is a choice key, the choices being \texttt{tiny}, \texttt{scriptsize}, \texttt{footnotesize}, \texttt{small}, \texttt{normalsize}, - \texttt{large}, \texttt{Large}, \texttt{LARGE}, \texttt{huge} and \texttt{Huge}. the smaller sizes probably are not useful, - I give them to you for free. This key allows you to adjust the height of the box. This key is ignored if the - \texttt{boxed} key does not appear in the option list. For example, -\begin{flushleft} -\hskip\leftmargini\begin{tabular}{@{}cc} - \makebox[1.2in][c]{\texttt{boxsize=Large}}&\makebox[1.2in][c]{\texttt{boxsize=Huge}}\\ - \multicolumn{1}{@{}p{1.2in}}{\kern0pt\centering\fbox{\hspace{1in}\Large\strut}}& - \multicolumn{1}{p{1.2in}}{\kern0pt\centering\fbox{\hspace{1in}\Huge\strut}} -\end{tabular} -\end{flushleft} - Choice of size depends on the height of the anticipated response of - the student. The default is \texttt{normalsize}. - - \item[\texttt{enclosesoln}:] This Boolean key only takes effect when the - \texttt{boxed} key is used, and when either the \texttt{nosolutions} or the - \texttt{vspacewithsolns} option is taken. When these conditions are - met, a box is created around the solution (the third parameter of \cs{fillin}); the solution - is enclosed in a \cs{phantom} so it is not seen, but the dimensions of the solution are used. - This key allows you to create a box or arbitrary dimension. - -A simple example would be -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\small] -\fillin[boxed,enclosesoln,parbox={[t][1in]}]{2.4in}{% - The box is 2.4 inch wide and 1 inch high. The solution to - this problem appears when \texttt{answerkey} is in effect. -} -\end{Verbatim} -Below shows how this command appears under different options. -\begin{equation*}\def\fb#1{#1-2\fboxrule-2\fboxsep} -\boxed{\phantom{\parbox[b][\fb{1in}][t]{\fb{2.4in}}{% - The box is 2.4 inch wide and 1 inch high. The solution to - this problem appears when the answerkey is in effect} -}}\quad\boxed{\parbox[b][\fb{1in}][t]{\fb{2.4in}}{% - The box is 2.4 inch wide and 1 inch high. The solution to - this problem appears when \texttt{answerkey} is in effect. -}} -\end{equation*} -The box on the left is appears when the \texttt{nosolutions} or -\texttt{vspacewithsolns} is in effect. The one on the right appears when -the \texttt{answerkey} option is taken. Note the size of the two boxes are -the same. - -\textbf{Note:} The explanation of the \texttt{parbox} option used in this -example appears below. - -\item[\texttt{fitwidth}] This key is an implementation of the - \cs{ifNoSolutions} strategy discussed earlier. If \texttt{fitwidth} is - specified and the \texttt{nosolutions} option (an \textsf{eqexam} - option) is in effect, the width of the fill-in region is taken from - the second parameter; however, if the \texttt{answerkey} option is - specified, the natural with of the answer (the third parameter) is - used. - - \item[\texttt{align}:] A key that takes one of three values, \texttt{l}, - \texttt{\texttt{r}}, and \texttt{c}. This key aligns the text within - the fill-in field (when the \texttt{answerkey} option is taken): - \texttt{l} (left-aligned), \texttt{c} (center, the default), \texttt{r} - (right-aligned). This parameter affects the position of the - \meta{answer}, and does not affect the position of the - \meta{text}, which is aligned left, of the \texttt{boxpretext} key. - The alignment becomes visible when the \texttt{answerkey} option is in - effect. - - \item[\texttt{hiddenbox}:] When the \texttt{boxed} option is used, - \textsf{eqexam} uses an \cs{fbox} to enclose the content. - The \texttt{hiddenbox} is used with the \texttt{boxed} option and it - resets the lengths of \cs{fboxrule} and \cs{fboxsep} to - \texttt{0pt}. In this way, some of the features - (\texttt{enclosesoln} and \texttt{boxpretext}, for example) that - apply to boxed content can be used without the surrounding boundary - rule. See \texttt{parbox} for an example. - - \item[\texttt{parbox}:] When this option is taken, \textsf{eqexam} - encloses the third argument (the answer) in a \cs{parbox}. The value - of the \texttt{parbox} option is the first three parameters of a - \cs{parbox}; for example \verb!parbox={[t][.5in][c]}! causes \cs{fillin} - to enclose the content in a \cs{parbox} with a height of \texttt{.5in}. The width - of the \cs{parbox} is taken to be the second parameter of - \cs{fillin} macro. The third parameter of \cs{fillin} becomes - \cs{parbox[t][.5in][c]\darg{\meta{width}}\darg{\meta{answer}}}. - The value of the \texttt{parbox} key needs to be - enclosed in braces, as just illustrated. - -Here is an example of the use of this key-value pair: -\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\small] -\fillin[parbox={[t][.5in]},boxed,hiddenbox, - boxpretext={\textbf{\textcolor{black}{Conclusion: }}}, - format=\normalfont,enclosesoln]{\linewidth}{% - There is sufficient evidence at the $\alpha=0.05$ level to - conclude that the mean microwave repair cost is less than - \$100.} -\end{Verbatim} -If you say \cs{fillin[parbox,boxed,\meta{options}]\darg{\meta{width}}\darg{\meta{answer}}} (\texttt{parbox} with the -empty argument), translates into \cs{parbox\darg{\meta{text}}}, the height of the box is the -natural height of the content. - -Note the presence of the \texttt{hiddenbox} key, in this case, no rule -or additional spacing appears around the box. - - This typesets, when \texttt{answerkey} option is used as - - \parbox[t][.5in]{\linewidth}{\textbf{\textcolor{black}{Conclusion: }} - There is sufficient evidence at the $\alpha=0.05$ level to - conclude that the mean microwave repair cost is less than - \$100.} - - When \texttt{answerkey} is not used, the following is seen (by the student at test time): - - \parbox[t][.5in]{\linewidth}{\textbf{\textcolor{black}{Conclusion: }}} - - The same vertical space is used in both cases because of the \texttt{enclosesoln} - option taken in this example. - - If the \texttt{hiddenbox} key is removed, a proper boxed region appears, - - $\def\FB#1{#1-2\fboxrule-2\fboxsep} - \boxed{\parbox[t][\FB{.5in}]{\FB{\linewidth}}{\textbf{\textcolor{black}{Conclusion: }} - There is sufficient evidence at the $\alpha=0.05$ level to - conclude that the mean microwave repair cost is less than - \$100.}}$ - - Similarly, when \texttt{answerkey} is not used, the following is seen, - - $\def\FB#1{#1-2\fboxrule-2\fboxsep} - \boxed{\parbox[t][\FB{.5in}]{\FB{\linewidth}}{% - \textbf{\textcolor{black}{Conclusion: }}\hfill\vfill}}$ - - - \item[\texttt{color}:] The value of this key is a named color. The - \meta{answer} appears in this color, when \texttt{answerkey} option is - in effect. The default is red. - - \item[\texttt{format}:] A general purpose formatting key. The value of the key can be most anything: - \cs{bfseries} (to change font series), \cs{ttfamily} (to change font family), \cs{Large} (to change size of - the \meta{answer} and \meta{text} (the value of \texttt{boxpretext}). Several formatting commands can appear - as the value; thus, \verb!format={\bfseries\Large}! makes the answer, when \texttt{answerkey} is in effect, appear in large bold font. - The default is \verb!format={\fillInFormatDefault}!, where the definition of the command \cs{fillInFormatDefault} is -\begin{Verbatim}[xleftmargin=\leftmargini] -\newcommand{\fillInFormatDefault}{\bfseries} -\end{Verbatim} -\end{description} -The next three keys apply when a \texttt{boxed} option is not taken, that is, they -apply to the case of \texttt{u} (\texttt{underlined}) or \texttt{b} (blank). The keys were designed -for the \texttt{underline} option, however. -\begin{description} -\item[\texttt{lift}:] The syntax is \texttt{lift=length} This key lowers the underline without changing the baseline reference -point of the content. For example, \texttt{lift=10pt} lowers the underlining by \texttt{10pt}. -\begin{equation*} -\frac{1}{2}+\frac{1}{3} = \underbar{\makebox[1in]{\ensuremath{\displaystyle\frac{3}{4}}}} -\qquad -\frac{1}{2}+\frac{1}{3} = \raisebox{-10pt}{\underbar{\raisebox{10pt}{\makebox[1in]{\ensuremath{\displaystyle\frac{3}{4}}}}}} -\end{equation*} -The expression on the right corresponds to -\begin{Verbatim}[xleftmargin=\leftmargini] -$...\fillin[lift=10pt]{1in}{\frac{3}{4}}...$ -\end{Verbatim} -The underline is lowered to include the baseline of the denominator of the fraction. - -\item[\texttt{autolift}:] The \texttt{autolift} key takes the guesswork - out of the \texttt{lift}. When \texttt{autolift} is used, the depth of - the content of the answer field. For example, with the \texttt{autolift} key, - \verb!\fillin[autolift]{1in}{\frac{3}{4}}! yields - {\setbox0=\hbox{$\displaystyle\frac{3}{4}$} - \raisebox{-\dp0}{\underbar{\raisebox{\dp0}{\makebox[1in]{\ensuremath{\displaystyle\frac{3}{4}}}}}}}. - Now the fraction is exactly underlined. - -\item[\texttt{addtoautolift}:] The \texttt{addtoautolift} key is a companion to \texttt{autolift}. - If we assign \texttt{addtoautolift=3pt}, \texttt{3pt} additional lift is added - to the amount of lift determined by \texttt{autolift}. For example, -\begin{small}% -\begin{equation*} -\setbox0=\hbox{$\displaystyle\frac{3}{4}$} -\dimen0=\dp0 \advance\dimen0by3pt - \verb!\fillin[autolift,addtoautolift=3pt]{.5in}{\frac{3}{4}}!\ \text{yields}\ - \raisebox{-\dimen0}{\underbar{\raisebox{\dimen0}{\makebox[.5in]{\ensuremath{\displaystyle\frac{3}{4}}}}}} -\end{equation*} -\end{small}% -the number three-fourths is underlined plus \texttt{3pt} more. -\end{description} -The keys are processed by an \cs{edef}, this allows you to define a -command with your favorite options; for example, you can define -\begin{Verbatim}[xleftmargin=\leftmargini] -\newcommand{\myBoxOpts}{boxed,boxsize=Large,align=l} -\end{Verbatim} -then in the exam, type -\begin{Verbatim}[xleftmargin=\leftmargini] -$\frac{\sqrt{-18}}{\sqrt{6}}=\fillin[\myBoxOpts]{1.5in}{3\imath}$ -\end{Verbatim} - -% dps Need to revise this section, I've changed how \fillin works. - -\paragraph*{\cs{fillin} boxed.} When the \texttt{boxed} key is used, -the \cs{boxed} command of \texttt{amsmath} is used; This command needs to -be in math mode. If the \texttt{boxed} key is used and the \cs{fillin} -command is in math mode, then \cs{fillin} puts the \meta{answer} and -\texttt{boxpretext} in math mode too; if \cs{fillin} command \emph{not in -math mode} (i.e., it is in text mode), \cs{fillin} typesets the -\meta{answer} and \texttt{boxpretext} in text mode. For example, -\begin{Verbatim}[xleftmargin=\leftmargini] -Let $ x = 4 $ and $ y = -3 $ and let $ z = 2x - 4y $ then - $\fillin[boxed,align=l,boxpretext={z=}]{1in}{20}$ -\end{Verbatim} -When \texttt{answerkey} is used, the above question appears as -\begin{quote} -Let $ x = 4 $ and $ y = -3 $ and let $ z = 2x - 4y $ then - \fbox{\makebox[1in][l]{$ z=20 $ }} -\end{quote} -Here is an example in text mode -\begin{Verbatim}[xleftmargin=\leftmargini] -The first president of the US is - \fillin[boxed,align=c]{1.5in}{Washington} -\end{Verbatim} -When \texttt{answerkey} is used, the above question appears as -\begin{quote} -The first president of the US is - \fbox{\makebox[1.5in][c]{Washington}} -\end{quote} -Here is an example of mixed mode -\begin{Verbatim}[xleftmargin=\leftmargini] -The width of a rectangle is 20 feet and length is 15 feet. -Find the area: $\fillin[boxed,align=l, - boxpretext={\text{Area: }}]{1in}{300\,\text{feet}}$ -\end{Verbatim} -The answer is typeset in math mode, but the value of \texttt{boxpretext} -needs to be typeset in text mode. When \texttt{answerkey} is used, the -above question appears as -\begin{quote} -The width of a rectangle is 20 feet and length is 15 feet. -Find the area: \fbox{\makebox[1in][l]{Area: $300\,\text{feet}$}} -\end{quote} - -\paragraph*{\cs{fillin} not boxed.} The \cs{fillin} command will typeset -the answer in math mode if \cs{fillin} is in math mode, and in text mode, -otherwise. For example, each of the following typesets the same. -\begin{Verbatim}[xleftmargin=\leftmargini] -The area of a circle of radius $2$ is \fillin[u]{.5in}{$4\pi$} -The area of a circle of radius $2$ is $\fillin[u]{.5in}{4\pi}$ -\end{Verbatim} - -\subsection{Vertical Space Fill Types} - -When the \texttt{nosolutions} or the \texttt{vspacewithsolns} is used, a -vertical space is generated by the \texttt{solution} environment. -Previously, this has just been a vertical white space, now, we provide -the ability to fill the space with horizontal rules of different types. - -%\redpoint The demo file for these features is \texttt{hw03.tex}. - -\exAeBBlogPDF{p=1222} The demo file for this feature is named -\texttt{\href{\urlAcroTeXBlog/?p=1222}{hw03.pdf}} - - -\newtopic There are two sets of commands. -\settowidth{\aebdimen}{\ttfamily\string\useFillerDefault} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\useFillerLines -\useFillerDefault -\end{dCmd} -\noindent The first command sets the code to draw rule lines in the -vertical white space, the second command reverts back to the default, -plain vertical white space. - -\newtopic The next set of commands determine the type of line to be drawn -in the white space. -\settowidth{\aebdimen}{\ttfamily\string\fillTypeDashLine} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\fillTypeHRule -\fillTypeDashLine -\fillTypeDots -\fillTypeDefault -\end{dCmd} -\noindent The rule types are in the order listed: draw solid horizontal lines; draw -dashed lines; draw dotted lines; draw the default line type (\cs{fillTypeHRule)}. - -\newtopic These two command determine color of the lines, and the spacing between lines. -\settowidth{\aebdimen}{\ttfamily\string\eqWriteLineColor\darg{\meta{named\_color}}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\eqWriteLineColor{!meta(named_color)} -\eqWLSpacing{!meta(length)} -\end{dCmd} -\noindent The default color is \texttt{gray} and the default vertical -spacing between lines is -\texttt{14pt}. - -\subsection{Keep vertical space with \texttt{answerkey}} - -One thing that has bothered me in my efforts to create the ``perfect'' -exam package, is the differences in vertical spacing between the exam the -student sees (which is compiled with the \texttt{nosolutions} option), and -the solutions document the instructor sees (as compiled with the -\texttt{answerkey} option). The differences in vertical space of the two -documents makes it harder for the eye to move from the student's exam to -the answer key document and back again. In the past, I've used -\cs{aNewPage} or \cs{qNewPage} to force page breaks so that the page -breaks of the two document match, this makes it easier to get one page at -a time. - - -Below is a simple example to illustrate the above points. In the example below, -we simulate -\begin{Verbatim}[xleftmargin=\leftmargini] -\begin{solution}[1in] -$ x+1 = 4 \implies x = 3 $ -\end{solution} -\end{Verbatim} -\begin{flushleft} -\setlength{\fboxsep}{0pt} -\begin{tabular}{@{\hskip\leftmargini}cc} -\texttt{nosolutions} & \texttt{answerkey}\\ -\fbox{\parbox[t][1in]{.4\linewidth}{\strut\kern0pt\vfill\hfill}}& -\fbox{\parbox[t]{.4\linewidth}{\strut\textit{Solution:} $ x+1 = 4 \implies x = 3 $}}\\ -\end{tabular} -\end{flushleft} -We have put an \cs{fbox} around the vertical space so you can see the -bottom of the vertical space, and better appreciate the point I am trying -to make. When \texttt{nosolutions} is in effect, a vertical space of 1 -inch is created; when the \texttt{answerkey} is used, the vertical spacing -is ignored, and the solution is typeset, as shown above. Notice the -difference in the vertical spacing between the two. - -The \textsf{eqexam} package now attempts to build the solution environment -so the vertical spacing is (roughly) the same. -\settowidth{\aebdimen}{\ttfamily\string\vspacewithkeyOff} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\vspacewithkeyOn -\vspacewithkeyOff -\end{dCmd} -\noindent The first command turns on this new feature---the feature of trying to -place the vertical spacing in the \texttt{answerkey} mode as requested by -the optional argument of the \texttt{solution} environment. The second -one, \cs{vspacewithkeyOff} (the default) turns off this new feature, and -reverts to the old behavior of \textsf{eqexam}. - -Here is a representation of the effects of the command \cs{vspacewithkeyOn}. - -\begin{Verbatim}[xleftmargin=\leftmargini] -\begin{solution}[1in] -$ x+1 = 4 \implies x = 3 $ -\end{solution} -\end{Verbatim} -\begin{flushleft} -\setlength{\fboxsep}{0pt} -\begin{tabular}{@{\hskip\leftmargini}cc} -\texttt{nosolutions} & \texttt{answerkey}\\ -\fbox{\parbox[t][1in]{.4\linewidth}{\strut\kern0pt\vfill\hfill}}& -\fbox{\parbox[t][1in]{.4\linewidth}{\strut\textit{Solution:} $ x+1 = 4 \implies x = 3 $\hfill\vfill}}\\ -\end{tabular} -\end{flushleft} -As you can see, the vertical spacing with solutions is the same as -without, the page breaks should be the same, and the positioning of the problems should be -(roughly) the same throughout the test. - -\newtopic The commands \cs{vspacewithkeyOn} and \cs{vspacewithkeyOff} may -be used anywhere (between problems or parts), but normally, one would put -\cs{vspacewithkeyOn} in the preamble. - -\subsection{Annotating a Continuing Problem with Parts} - -% http://www.acrotex.net/blog/?p=698 -% Annotating a Continuing Problem with Parts, and Page totals -The demonstration file for this feature is -\begin{equation*} -\textsl{\textsl{\ulSetLink{http://www.acrotex.net/blog/?p=698}{Annotating a -Continuing Problem with Parts, and Page totals}}} -\end{equation*} -found at the \textbf{\ulSetLink{http://www.acrotex.net/blog}{Acro\TeX{} Blog}} - -\newtopic A situation often encountered is when a problem with parts crosses a page -boundary; the problem continues on the next page without any annotation. -This feature works to insert a text string at the top of the next page, a -string that gives the reader (student) the context of the part. - -\medskip\noindent -\begin{minipage}{\linewidth} -\begin{minipage}[t]{.5\linewidth-5pt} -\emph{(Page 2)}\\ -\textbf{4.} Solve each of the following. -\begin{enumerate} -\item[(a)] Solve this -\item[(b)] Solve this -\end{enumerate} -\end{minipage}\hfil\vrule\hfill -\begin{minipage}[t]{.5\linewidth-10pt} -\emph{(Page 3)}\\ -\textbf{Problem~4 continued.} -\begin{enumerate} -\item[(c)] Solve this -\item[(d)] Solve this -\end{enumerate} -\end{minipage} -\end{minipage} -\newtopic Above is an illustration of how this feature works. - -%the default string is \textbf{Problem \texttt{} continued.} - -\settowidth{\aebdimen}{\ttfamily\string\turnContAnnotOff} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\turnContAnnotOff -\turnContAnnotOn -\end{dCmd} -\noindent The feature may be turned off and on using the above two commands. These -commands are usually in the preamble, but they can appear between problems -or between \texttt{exam} environments. - -\newtopic The annotatation text that appears is determined by the definition of -\cs{annotContStr}. -\begingroup\obeyspaces% -\settowidth{\aebdimen}{\ttfamily \string\textbf\darg{Problem\string~\string\eqeCurrProb\string\space continued.}\}}% -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\newcommand{\annotContStr}{% - \textbf{Problem~\eqeCurrProb\space continued.}} -\end{dCmd} -\endgroup\noindent where \cs{eqeCurrProb} is the current problem number. -\cs{annotContStr} may be redefined, but be sure to include the problem -number \cs{eqeCurrProb}. - -The insertion of the continuation annotation uses \cs{promoteNewPage}, see -Section~\ref{aqpNewPage} on page~\pageref{aqpNewPage} for a description of -\cs{promoteNewPage}. - -\settowidth{\aebdimen}{\ttfamily\string\newcommand\darg{\string\ic@vspacedefault}\darg{1in}} -\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} -\acvspace{!meta(vspace)} -\resetacvspace -\newcommand{\ic@vspacedefault}{1in} -\end{dCmd} -\noindent The above three lines describes some commands for controlling the generation of a new page -through the use of \cs{promoteNewPage}. The first one \cs{acvspace} is used to set the option -parameter of \cs{promoteNewPage}. The default value for promoting a new page is \texttt{.25in}, as -defined by \cs{ic@vspacedefault}, which can be redefined. The command \cs{resetacvspace} resets -the optional argument of \cs{promoteNewPage} back to its default. All definitions are local, so the revert to -their original values when a group is exited. - - -\subsection{The Exam Record}\label{examrecord} - -% http://www.acrotex.net/blog/?p=703 -% The Exam Record on the Cover Page - -The demonstration file for this feature is -\begin{equation*} -\textsl{\textsl{\ulSetLink{http://www.acrotex.net/blog/?p=703}{The Exam Record on the Cover Page}}} -\end{equation*} -found at the \textbf{\ulSetLink{http://www.acrotex.net/blog}{Acro\TeX{} Blog}} - - -\newtopic When choose the \texttt{coverpage} option and the \texttt{coverpagesumry} option is set to either -\texttt{byparts} or \texttt{bypages}, you get an \textbf{Exam Record} appearing on the cover page. -See Figure~\ref{fig:ExamRecord}, page~\pageref{fig:ExamRecord}. - -There are several commands that can be used to customize the layout of the \textbf{Exam Record} -\begin{Verbatim}[xleftmargin=\leftmargini,numbers=left] -\eqeSumryHoriz -\eqeSumryVert -\end{Verbatim} -These two commands arrange the \textbf{Exam Record} -relative to the student/instructor information. The former is a horizontal -arrangement, the latter is a vertical arrangement, \cs{eqeSumryVert} is the default. - -\newtopic Below are several text commands for customizing the text in the \textbf{Exam Record} -box: -\begin{Verbatim}[xleftmargin=\leftmargini,numbers=left] -\newcommand{\cpSumryHeader}{\textbf{Exam Record}} -\newcommand{\cpSumryPts}{\,\text{pts}} -\newcommand{\cpSumryPage}{Page} -\newcommand{\cpSumryTotal}{Total:} -\newcommand{\cpSumryGrade}{Grade:} -\cpSetSumryWidth{.5\linewidth} -\end{Verbatim} -The meanings of numbers~(1)--(5) are apparent from Figure~\ref{fig:ExamRecord}, page~\pageref{fig:ExamRecord}, -where these strings are on display. Number~(6) determines the width of the \textbf{Exam Record}, its default -is half the \cs{linewidth}. - -\newtopic The \textbf{Exam Record} by default is enclosed in an \cs{fbox}, use the command -\cs{cpNofbox} in the preamble to remove this enclosing box. - -\newtopic\textbf{Naming conventions for \texttt{byparts}.} When -\texttt{coverpagesumry=byparts}, there are several naming options -available. The default name of each part is the exam name (the required -argument of the \texttt{exam} environment. By specifying -\cs{useUIPartNames} in the preamble, the user friendly name is used (the -one that appears as the optional first argument of the \texttt{exam} -environment. The user friendly names are used when the solutions are -listed in the back of the document (for example, when the option -\texttt{vspacewithsolns} is specified). These user-friendly names may be too wide -to put in the \textbf{Exam Record}, in this case, you can executed -\cs{useCustomPartNames} in the preamble. This allows you to define your own names -that are to appear in the \textbf{Exam Record}. To define your custom names, use -the \cs{customNaming} command: -\begin{Verbatim}[xleftmargin=\leftmargini,commandchars=+\(\)] -\customNaming{+meta(name)}{+meta(text)} -\end{Verbatim} -where, \meta{name} is the name of the exam, and \meta{text} is the text to appear -in the \textbf{Exam Record}. For example, the following definitions might be made -for a two part final exam, the first part the instructor is free to pose questions, -the second part are Department supplied questions. -\begin{Verbatim}[xleftmargin=\leftmargini] -\customNaming{Part1}{Instr Qs:} -\customNaming{Part2}{Dept Qs:} -\end{Verbatim} - -\subsection{Calculate problem range between two markers} - -I have defined the command In response to a user who wanted more -information about problem ranges between two marks, the command -\cs{calcQsBtwnMarkers} is the proposed solution. The syntax is\dots -\begin{Verbatim}[xleftmargin=\leftmargini,commandchars=+\(\)] -\calcQsBtwnMarkers[+meta(Mrk2)]{+meta(Mrk1)} -\end{Verbatim} -The required parameter (\meta{Mrk1}) is called the \emph{primary mark}. -The command defines a number of other commands based on the primary -mark name. \cs{calcQsBtwnMarkers} calculates the first and -last problem numbers of the questions between the command -\cs{calcQsBtwnMarkers} that has \meta{Mrk1} as its \emph{primary marker} and -another command \cs{calcQsBtwnMarkers} that has \meta{Mrk2} as its \emph{primary -marker}. The names of the commands produced are all based in the primary -marker name \meta{Mrk1}. - -\newtopic As mentioned above, there are several other commands -\cs{calcQsBtwnMarkers} defines. -\cs{calcQsBtwnMarkers[\meta{Mrk2}]}\verb!{!\meta{Mrk1}\verb!}! defines the -following commands: -\begin{itemize} - -\item \cs{\meta{Mrk1}Start} is the first question number that follows the placement -of the command \cs{calcQsBtwnMarkers} with \meta{Mrk1} as its primary marker. - -\item \cs{\meta{Mrk1}End} is the last question number between two -\cs{calcQsBtwnMarkers} commands having \meta{Mrk1} and \meta{Mrk2} as their -primary marks. - -\item \cs{\meta{Mrk1}nQs} is the number of questions appearing -between \cs{calcQsBtwnMarkers} commands having primary marks of -\meta{Mrk1} and \meta{Mrk2}. -\end{itemize} -Three other commands are defined for easy user access. -\begin{itemize} -\item \cs{markStartFor}\verb!{!\meta{Mrk1}\verb!}! expands to \cs{\meta{Mrk1}Start}. -\item \cs{markEndFor}\verb!{!\meta{Mrk1}\verb!}! expands to \cs{\meta{Mrk1}End}. -\item \cs{markNumQsFor}\verb!{!\meta{Mrk1}\verb!}! expands to \cs{\meta{Mrk1}nQs}. -\end{itemize} -Use the command \cs{calcQsBtwnMarkers} without the optional first argument as the last mark -in your \texttt{exam} environment. - -%\handpoint The demo file for this feature is named \texttt{markqs.tex}. - -\exAeBBlogPDF{p=1231} The demo file for this feature is named -\texttt{\href{\urlAcroTeXBlog/?p=1231}{markqs.pdf}} - -\newpage -\markright{References} - -\begin{thebibliography}{[1]}\label{references} -\addcontentsline{toc}{section}{\protect\numberline{}References} -\backrefparscanfalse -\def\srtln{\vskip-\baselineskip\vskip-\parsep} -\def\lngln{\vskip-\parsep} - -\bibitem{book:AEBB} - D. P. Story, \textsl{\AEBBook}, in preparation. \backrefprint - -\end{thebibliography} - - -\end{document} diff --git a/texmf-dist/source/latex/eqexam/doc/fortextbook.zip b/texmf-dist/source/latex/eqexam/doc/fortextbook.zip deleted file mode 100644 index e3210cfd..00000000 Binary files a/texmf-dist/source/latex/eqexam/doc/fortextbook.zip and /dev/null differ diff --git a/texmf-dist/source/latex/eqexam/doc/fortextbook/fortextbook.pdf b/texmf-dist/source/latex/eqexam/doc/fortextbook/fortextbook.pdf deleted file mode 100644 index 4619dc88..00000000 Binary files a/texmf-dist/source/latex/eqexam/doc/fortextbook/fortextbook.pdf and /dev/null differ diff --git a/texmf-dist/source/latex/eqexam/eqexam.drv b/texmf-dist/source/latex/eqexam/eqexam.drv new file mode 100644 index 00000000..7a5a2b67 --- /dev/null +++ b/texmf-dist/source/latex/eqexam/eqexam.drv @@ -0,0 +1,66 @@ +%% +%% This is file `eqexam.drv', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% eqexam.dtx (with options: `copyright,driver') +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% eqexam.sty package, %% +%% Copyright (C) 2005--2018 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.2 of %% +%% the License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\documentclass{ltxdoc} +\GlossaryPrologue{\section{{Change History}}}% +\IndexPrologue{\section{{Index}}}% +\value{IndexColumns}=2 +\value{GlossaryColumns}=2 +\usepackage{makeidx} +\usepackage[colorlinks,hyperindex=false]{hyperref} +\def\darg#1{\texttt{\{#1\}}} +\let\env\texttt +\let\opt\texttt +\let\app\textsf +\def\visispace{\symbol{32}} +\def\ameta#1{\ensuremath{\langle\textit{\texttt{#1}}\rangle}} +\def\meta#1{\textsl{\texttt{#1}}} +\def\SUB#1{\ensuremath{{}_{\mbox{\scriptsize\ttfamily#1}}}} +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\InputIfFileExists{aebdocfmt.def}{\PackageInfo{eqexam}{Inputting aebdocfmt.def}} + {\def\IndexOpt{\DescribeMacro}\let\setupFullwidth\relax + \PackageInfo{eqexam}{aebdocfmt.def cannot be found}} +\makeatletter + \let\@latex@warning\@gobble +\makeatother +\begin{document} + \let\pkg\textsf + \def\switchCats{\catcode`\{=12\relax\catcode`\}=12\relax + \catcode`\(=1\relax\catcode`\)=2\relax} + \GetFileInfo{eqexam.sty} + \title{\textsf{eqexam}: An Exam Construction Package} + \author{D. P. Story\\ + Email: \texttt{dpstory@uakron.edu}} + \date{Processed \today} + \maketitle + \tableofcontents + \let\Email\texttt + \DocInput{eqexam.dtx} +\IfFileExists{\jobname.ind}{\newpage\setupFullwidth\PrintIndex}{\paragraph*{Index} The index goes here.\\Execute + \texttt{makeindex -s gind.ist -o eqexam.ind eqexam.idx} on the command line and recompile + \texttt{eqexam.dtx}.} +\IfFileExists{\jobname.gls}{\PrintChanges}{\paragraph*{Change History} The list of changes goes here.\\Execute + \texttt{makeindex -s gglo.ist -o eqexam.gls eqexam.glo} on the command line and recompile + \texttt{eqexam.dtx}.} +\end{document} +\endinput +%% +%% End of file `eqexam.drv'. diff --git a/texmf-dist/source/latex/eqexam/eqexam.dtx b/texmf-dist/source/latex/eqexam/eqexam.dtx index 951c5f74..2f4589aa 100644 --- a/texmf-dist/source/latex/eqexam/eqexam.dtx +++ b/texmf-dist/source/latex/eqexam/eqexam.dtx @@ -4,20 +4,20 @@ %<*copyright> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% eqexam.sty package, %% -%% Copyright (C) 2005--2017 D. P. Story %% +%% Copyright (C) 2005--2018 D. P. Story %% %% dpstory@uakron.edu %% %% %% %% This program can redistributed and/or modified under %% -%% the terms of the LaTeX Project Public License 1.2 %% +%% 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. %% +%% macros/latex/base/lppl.txt; either version 1.2 of %% +%% the License, or (at your option) any later version. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %\NeedsTeXFormat{LaTeX2e} %\ProvidesPackage{eqexam} -% [2017/03/16 v4.9 An Exam Construction Package (dps)] -%\def\eqexamdefReq{2017/03/16} +% [2018/12/13 v5.1.3 An Exam Construction Package (dps)] +%\def\eqexamdefReq{2018/12/13} %<*driver> \documentclass{ltxdoc} \GlossaryPrologue{\section{{Change History}}}% @@ -25,7 +25,16 @@ \value{IndexColumns}=2 \value{GlossaryColumns}=2 \usepackage{makeidx} -\usepackage[colorlinks,hyperindex]{hyperref} +\usepackage[colorlinks,hyperindex=false]{hyperref} +\def\darg#1{\texttt{\{#1\}}} +\let\env\texttt +\let\opt\texttt +\let\app\textsf +\def\visispace{\symbol{32}} +\def\ameta#1{\ensuremath{\langle\textit{\texttt{#1}}\rangle}} +\def\meta#1{\textsl{\texttt{#1}}} +\def\SUB#1{\ensuremath{{}_{\mbox{\scriptsize\ttfamily#1}}}} +%\def\cs#1{\texttt{\bslash#1}} %\pdfstringdefDisableCommands{\let\\\textbackslash}% \EnableCrossrefs \CodelineIndex @@ -33,6 +42,9 @@ \InputIfFileExists{aebdocfmt.def}{\PackageInfo{eqexam}{Inputting aebdocfmt.def}} {\def\IndexOpt{\DescribeMacro}\let\setupFullwidth\relax \PackageInfo{eqexam}{aebdocfmt.def cannot be found}} +\makeatletter + \let\@latex@warning\@gobble +\makeatother \begin{document} \let\pkg\textsf \def\switchCats{\catcode`\{=12\relax\catcode`\}=12\relax @@ -243,6 +255,7 @@ \let\eqe@YES=y \let\eqe@NO=n \let\eqe@One=1 \let\eqe@Zero=0 \let\eqe@Two=2 \let\eqe@Three=3 \let\eqe@Four=4 +\def\eqe@h{h} \DeclareOptionX{nototals}{\AtEndOfPackage{\NoTotals}} \DeclareOptionX{noparttotals}{% \AtEndOfPackage{\let\eq@parttotals\eqe@NO}} @@ -293,10 +306,28 @@ % \IndexOpt{answerkey} % Equivalent to solutionsafter and proofing. % \begin{macrocode} -\newif\ifanswerkey \answerkeyfalse -\DeclareOptionX{answerkey}{\AnswerKey} -\def\AnswerKey{\answerkeytrue\eq@proofingtrue - \eq@solutionsaftertrue} +\@ifundefined{ifanswerkey}{\newif\ifanswerkey\answerkeyfalse}{} +\@ifundefined{ifsolutionsAtEnd} + {\newif\ifsolutionsAtEnd\solutionsAtEndtrue}{} +% \end{macrocode} +% A more intelligent processing of certain options is deployed: Now, we allow +% only one of the options \texttt{answerkey}, \texttt{nosolutions}, +% \texttt{vspacewithsolns}, \texttt{solutionsafter}, and +% \texttt{solutionsonly} at a time. +% \begin{macrocode} +\let\thisOpt@OK \eqe@YES +\def\w@rningBadOpts{\PackageWarningNoLine{eqexam}{You've chosen two + conflicting options,\MessageBreak \l@stPO\space and \CurrentOption. + We will recognize\MessageBreak the \l@stPO\space option. + Please correct\MessageBreak this if my guess is wrong}} +\def\eqe@optiont@kenMsg{\PackageInfo{eqexam} + {Option \CurrentOption\space taken}} +\DeclareOptionX{answerkey}{\ifx\thisOpt@OK\eqe@YES + \def\l@stPO{answerkey}\let\thisOpt@OK\eqe@NO + \eqe@optiont@kenMsg\expandafter\AnswerKey\else + \w@rningBadOpts\fi} +\def\AnswerKey{\solutionsAtEndfalse\answerkeytrue + \eq@proofingtrue\eq@solutionsaftertrue\displayworkareafalse} % \end{macrocode} % \IndexOpt{vspacewithsolns} % When \texttt{vspacewithsolns} is used, vertical space is created by @@ -316,14 +347,36 @@ % \begin{macrocode} \newif\ifvspacewithsolns\vspacewithsolnsfalse \def\ifkeyalt{\csname ifvspacewithsolns\endcsname} + \let\keyalttrue\vspacewithsolnstrue + \let\keyaltfalse\vspacewithsolnsfalse +%\def\ifkeyalt{\csname ifvspacewithsolns\endcsname} \def\ifkeyOrkeyalt{\ifanswerkey \def\eqe@next{\csname iftrue\endcsname}\else \ifvspacewithsolns\def\eqe@next{\csname iftrue\endcsname}\else \def\eqe@next{\csname iffalse\endcsname}\fi\fi\eqe@next} -\DeclareOptionX{vspacewithsolns}{% - \vspacewithsolnstrue\displayworkareatrue} -\DeclareOptionX{ftbsolns}{% - \vspacewithsolnstrue\displayworkareatrue} +\DeclareOptionX{vspacewithsolns}{\ifx\thisOpt@OK\eqe@YES + \def\l@stPO{vspacewithsolns}\let\thisOpt@OK\eqe@NO + \eqe@optiont@kenMsg + \vspacewithsolnstrue\expandafter\displayworkareatrue + \else\w@rningBadOpts\fi} +\DeclareOptionX{ftbsolns}{\ExecuteOptionsX{vspacewithsolns}} +% \end{macrocode} +% The \IndexKey{flextended}\opt{flextended} is an (experimental) option +% to allow filler lines (fl) to be superimposed under the solutions, when the \opt{answerkey} +% option is taken. +% \changes{2017/12/05}{v5.0g}{Added option \string\texttt{flextended}.} +% \begin{macrocode} +\DeclareOptionX{flextended}{\AtEndOfPackage{\flextendedInput}} +\def\flextendedInput{\eqe@flextendedtrue + \InputIfFileExists{flextended.def} + {\PackageInfo{eqexam}{Inputting flextended.def for + flextended\MessageBreak option}} + {\eqe@flextendedfalse\PackageWarning{eqexam} + {Cannot find flextended.def for flextended\MessageBreak + option. You should rebuild the package. Removing\MessageBreak + flextended for now}}} +\@ifundefined{ifeqe@flextended} + {\newif\ifeqe@flextended \eqe@flextendedfalse}{} % \end{macrocode} % \IndexOpt{useforms} % Use forms (if online option is taken); otherwise draw rectangles for @@ -437,6 +490,7 @@ % \subsection{Options from and for \textsf{web}} % \IndexOpt{forpaper} % \IndexOpt{forcolorpaper} +% \IndexOpt{forcolorpaper*} % Here is the list of options of \textsf{exerquiz} we plan to recognize. % \changes{v4.6a}{2016/06/04}{Added \string\cs{ifequsecolor} to easily distinguish between % \string\texttt{forpaper} and \string\texttt{forcolorpaper} options.} @@ -444,7 +498,10 @@ \@ifundefined{ifequsecolor}{\newif\ifequsecolor\equsecolorfalse}{} \DeclareOptionX{forpaper}{\equsecolorfalse\eqforpapertrue \PassOptionsToPackage{monochrome}{\eq@ColorPackage}} -\DeclareOptionX{forcolorpaper}{\equsecolortrue\eqforpapertrue} % for print +\DeclareOptionX{forcolorpaper}{\equsecolortrue\eqforpapertrue} +\newif\ifForceNoColor\ForceNoColorfalse +\DeclareOptionX{forcolorpaper*}{\equsecolortrue\eqforpapertrue + \ForceNoColortrue} % for print % \end{macrocode} % \IndexOpt{preview} % Preview shows outlines for form fields. @@ -474,17 +531,25 @@ % \IndexOpt{solutionsonly} % Solutions related options % \begin{macrocode} -% dps 03/04/11 -\DeclareOptionX{nosolutions}{\eq@nolinktrue\eq@nosolutionstrue - \displayworkareatrue} +\DeclareOptionX{nosolutions}{\ifx\thisOpt@OK\eqe@YES + \def\l@stPO{nosolutions}\let\thisOpt@OK\eqe@NO + \eqe@optiont@kenMsg\eq@nolinktrue\eq@nosolutionstrue + \expandafter\displayworkareatrue + \else\w@rningBadOpts\fi} \DeclareOptionX{nohiddensolutions}{\eq@globalshowsolutionstrue} \DeclareOptionX{noHiddensolutions}% {\eq@globalshowsolutionstrue\AtBeginDocument{\def\Hidesymbol{h}}} -\DeclareOptionX{solutionsafter}{\eq@solutionsaftertrue - \displayworkareafalse} -\DeclareOptionX{solutionsonly}{% - \solutionsonlytrue\answerkeytrue\displayworkareafalse - \AtEndOfPackage{\therearesolutionstrue\let\exerSolnsHeadnToc\relax}} +\DeclareOptionX{solutionsafter}{\ifx\thisOpt@OK\eqe@YES + \def\l@stPO{solutionsafter}\let\thisOpt@OK\eqe@NO + \eqe@optiont@kenMsg + \eq@solutionsaftertrue\expandafter + \displayworkareafalse\else\w@rningBadOpts\fi} +\DeclareOptionX{solutionsonly}{\ifx\thisOpt@OK\eqe@YES + \def\l@stPO{solutionsafter}\let\thisOpt@OK\eqe@NO + \eqe@optiont@kenMsg\AtEndOfPackage{\therearesolutionstrue + \let\exerSolnsHeadnToc\relax} + \solutionsonlytrue\answerkeytrue\expandafter + \displayworkareafalse\else\w@rningBadOpts\fi} % \end{macrocode} % \IndexOpt{proofing} % The \texttt{proofing} option sets a switch that controls whether @@ -516,13 +581,21 @@ {\AtEndOfPackage{\aebshowgrayletterstrue}} % \end{macrocode} % -%\changes{v2.0i}{2011/04/17 } +%\changes{v2.0i}{2011/04/17} %{ % Added the switch \cs{ifdisplayworkarea} to better control when the % work area is to be displayed. %} +%\changes{v5.1.3}{2018/12/13}{\string\cs{ifdisplayworkarea} conditionally defined; +% defined \string\cs{displayworkareaOn} and +% \string\cs{displayworkareaOff}. Consistent with exerquiz.} +% Define \cs{ifdisplayworkarea}\DescribeMacro\ifdisplayworkareaOn\DescribeMacro\ifdisplayworkareaOff\space +% and user commands to turn off and on. % \begin{macrocode} -\newif\ifdisplayworkarea \displayworkareafalse +\@ifundefined{ifdisplayworkarea}{\newif\ifdisplayworkarea + \displayworkareafalse}{} +\providecommand\displayworkareaOn{\displayworkareatrue} +\providecommand\displayworkareaOff{\displayworkareafalse} % \end{macrocode} % % \paragraph*{Color packages} @@ -562,7 +635,6 @@ % \IndexOpt{dvipdfmx} % \IndexOpt{xetex} % \IndexOpt{textures} -% The list of recognized and supported drivers. % \begin{macrocode} \DeclareOptionX{dvipsone}{% \def\eqe@drivernum{0}\def\eqDriverName{dvipsone}% @@ -594,6 +666,9 @@ % in web, exerquiz, or eforms. % \begin{macrocode} \newif\ifeq@solutionsafter \eq@solutionsafterfalse +\def\ifsolutionsafter{\csname ifeq@solutionsafter\endcsname} + \let\solutionsaftertrue\eq@solutionsaftertrue + \let\solutionsafterfalse\eq@solutionsafterfalse \newif\ifsolutionsonly\solutionsonlyfalse \newif\ifeq@hidesolution \eq@hidesolutionfalse \newif\ifeq@globalshowsolutions \eq@globalshowsolutionsfalse @@ -662,6 +737,17 @@ % \begin{macrocode} \ProcessOptionsX % \end{macrocode} +% When the online or email option is taken, as well as answserkey, we cancel the \texttt{flextended} option. +% \begin{macrocode} +\ifeqeonline + \ifanswerkey + \def\flextendedInput{\let\turnfl@nskeyMsg\@empty + \PackageWarningNoLine{eqexam} + {You've chosen the online or email option\MessageBreak + with the flextended option. This is not\MessageBreak + supported, removing the flextended option}}\fi +\fi +% \end{macrocode} % \changes{v3.2c}{2013/02/23}{Added \cs{selectedMC} at end of package} % The \cs{selectedMC} command contains the choice for the styling for the % region multiple choice questions: rectangles or circles. The default is @@ -714,7 +800,7 @@ \makeAnsEnvForSolnsAtEnd\eqTopOfSolnPage \answerkeytrue\eq@proofingtrue \eq@solutionsaftertrue\vspacewithsolnstrue - \displayworkareafalse\withsoldoctrue + \displayworkareafalse %\withinsoldoctrue % now within \eqTopOfSolnPage } % \end{macrocode} % \begin{macro}{\makeAnsEnvForSolnsAtEnd} @@ -747,6 +833,7 @@ \eqe@IWO\quiz@solns{\string\eqeAEFormatting}\fi \fi } +\def\writeWithSolDocTrue{\writeT@SolnFile{\protect\withinsoldoctrue}} % \end{macrocode} % \end{macro} % \end{macro} @@ -754,7 +841,7 @@ % Sets the value of \cs{eqemargin} in the context of the solution file, % this command is redefined later. % \begin{macrocode} -\newcommand{\setSolnMargins}[1]{\setlength\eqemargin{#1}} +\newcommand{\setSolnMargins}[1]{\setlength\eqemargin{#1}\ignorespaces} % \end{macrocode} % \end{macro} % (2011/05/08) In the new version of \textsf{eqexam}, the one that makes @@ -766,17 +853,20 @@ % to the solution file, but leave a back door open to write an alternate string. % (2014/03/20) \DescribeMacro{\altSetSolnMargins}\cmd{\altSetSolnMargins} allows you, % through its argument to pass an alternate string. +% \changes{v5.1.1}{2018/12/05}{Added \string\cs{eqprior}} % \begin{macrocode} \def\altSetSolnMargins#1{\def\alt@SetSolnMargins{#1}} \let\alt@SetSolnMargins\@empty -\def\writeBeginEqeQuestions{% - \ifsolutionsonly\else +\def\writeBeginEqeQuestions{\ifsolutionsonly\else + \ifOKToWriteExamData \let\quiz@solns\ex@solns \ifx\alt@SetSolnMargins\@empty - \writeToSolnFile{\string\setSolnMargins{\the\eqemargin}}\else - \writeToSolnFile{\alt@SetSolnMargins}\fi - \writeToSolnFile{\string\noindent\string\begin{eqequestions}}% + \writeT@SolnFile{\string\setSolnMargins{\the\eqemargin}}\else + \writeT@SolnFile{\alt@SetSolnMargins}\fi + \writeT@SolnFile{\protect\eqgriii\string\noindent + \string\begin{eqequestions}}% \fi + \fi } % \end{macrocode} % (2011/05/08) We define the command that writes the end of the \texttt{eqequestions} @@ -788,19 +878,36 @@ \setBtwnExamSkip{6pt} \def\writeEndEqeQuestions{% \ifsolutionsonly\else + \ifOKToWriteExamData \let\quiz@solns\ex@solns - \eqe@IWO\quiz@solns{\string\end{eqequestions}^^J}% - \writeToSolnFile{\string\btwnExamSkip^^J}% - \fi + \eqe@IWO\quiz@solns{\string\eqgrii + \string\end{eqequestions}^^J}% + \writeT@SolnFile{\string\btwnExamSkip^^J}% + \fi\fi } % \end{macrocode} % If \cs{ifvspacewithsolns} we set the switches need to simulate % \texttt{nosolutions}. % \begin{macrocode} -\ifvspacewithsolns +\def\csarg#1#2{\expandafter#1\csname#2\endcsname} +\def\saveIFEQE#1{\def\ARG{#1ifSave}% + \expandafter\csarg\expandafter + \let\expandafter\ARG\csname#1\if#1true\else false\fi\endcsname} +\saveIFEQE{vspacewithsolns}\saveIFEQE{answerkey} +\saveIFEQE{eq@proofing}\saveIFEQE{eq@solutionsafter} +\saveIFEQE{eq@nolink}\saveIFEQE{eq@nosolutions} +\saveIFEQE{displayworkarea} +\def\vpwsSimulateNoSolns{% dps28 + \ifvspacewithsolns \answerkeyfalse\eq@proofingfalse\eq@solutionsafterfalse \eq@nolinkfalse\eq@nosolutionsfalse\displayworkareatrue -\fi + \fi} +\def\reverseVSWS{\vspacewithsolnsfalse + \answerkeyifSave\eq@proofingifSave + \eq@solutionsafterifSave\eq@nolinkifSave + \eq@nosolutionsifSave\displayworkareaifSave +} +\vpwsSimulateNoSolns % \end{macrocode} % % \subsection{Save Switch Values} @@ -831,8 +938,14 @@ % \end{macrocode} % Bring the \texttt{comment} package in early, before \texttt{verbatim}, these two % clash a bit. +% \changes{v5.1.2}{2018/12/05}{Use version 3.2 of comment style under the name of aeb-comment} % \begin{macrocode} -\RequirePackage{comment} +\RequirePackage{aeb-comment} +\def\eqe@commentChkMsg{\@ifpackageloaded{comment} + {\PackageWarningNoLine{eqexam} + {The comment package is incompatible with the\MessageBreak + aeb-comment package, do not use the comment package}}{}} +\AtBeginDocument{\eqe@commentChkMsg} % \end{macrocode} % The macro \cs{includeexersolutions} is defined in \textsf{eqexam.def}. We execute % the command \cs{include@solutions} before the web package is loaded. The \textsf{web} package @@ -925,8 +1038,6 @@ % We've processed the options, I need to detect whether the document author % has not chosen any solutions options. % \begin{macrocode} -\@ifundefined{ifsolutionsAtEnd} - {\newif\ifsolutionsAtEnd\solutionsAtEndtrue}{} \ifvspacewithsolns\solutionsAtEndtrue\fi \ifanswerkey\solutionsAtEndfalse\fi \ifeq@nosolutions\solutionsAtEndfalse\fi @@ -1022,12 +1133,14 @@ % on the current page. \DescribeEnv{eq@numparts} The counter \texttt{eq@numparts} % holds the number of parts of the multi-part question. % \begin{macrocode} +\newcount\eqe@tempcnta \newcounter{eqpointsofar} \newcounter{eqpointsthispage} \newcounter{eq@numparts} \newcounter{eq@count} \newtoks\partNames \partNames={} \newlength{\eq@tmplengthA} +\newlength{\eq@tmplengthB} \newbox{\eq@pointbox} \newlength{\eq@pointboxtotalheight} % \end{macrocode} @@ -1073,6 +1186,14 @@ \displayworkareatrue} \@onlypreamble\NoSolutions % \end{macrocode} +% Added \cs{chngToNoSolns}, useful for book authors that want to switch between +% \cs{AnswerKey}, \cs{chngToNoSolns}, and \cs{SolutionsAtEnd}. +% \changes{v5.0o}{2017/12/26}{Added \string\cs{chngToNoSolns}} +% \begin{macrocode} +\def\chngToNoSolns{\solutionsAtEndfalse\answerkeyfalse + \eq@proofingfalse\eq@solutionsafterfalse + \eq@nosolutionstrue\displayworkareatrue} +% \end{macrocode} % \begin{macro}{\vspacewithkeyOn} % \begin{macro}{\vspacewithkeyOff} %\changes{v2.0k}{2011/04/29}{Added user interface to the switch @@ -1156,15 +1277,36 @@ \providecommand{\sectionColor}[1]{\def\web@sectionsColorOld{#1} \def\aeb@sectioncolor{#1}} \sectionColor{blue} -\newcommand{\forceNoColor}{% - \proofingsymbolColor{black}\instructionsColor{black} - \eqCommentsColor{black}\universityColor{black} - \titleColor{black}\authorColor{black} - \subjectColor{black}\linkcolor{black} - \nolinkcolor{black}\fillinColor{black} - \eqEndExamTotalColor{black} - \if\load@web\eqe@YES\sectionColor{black}\fi -} +\def\forceNoColorSet{\proofingsymbolColor{black}% + \instructionsColor{black}% + \eqCommentsColor{black}\universityColor{black}% + \titleColor{black}\authorColor{black}% + \subjectColor{black}\linkcolor{black}% + \nolinkcolor{black}\fillinColor{black}% + \instructionsColor{black}\eqCommentsColor{black}% + \eqCommentsColorBody{black}% + \eqEndExamTotalColor{black}\ckboxColor{}% + \ckcirColor{}\if\load@web\eqe@YES + \sectionColor{black}\fi +} +\ifForceNoColor + \AtBeginDocument{\forceNoColorSet} +\fi +\newcommand{\forceNoColor}{\ifForceNoColor\else\ForceNoColortrue + \AtBeginDocument{\forceNoColorSet}\fi} +% \end{macrocode} +% The \DescribeMacro{\ckboxColor}\cs{ckboxColor} provides color for the MC and MS boxes, +% then a PDF-related option is not in effect, while \DescribeMacro{\ckcirColor}\cs{ckcirColor} +% provides color for circular checkboxes. Usually, these are black or both the same color. +%\changes{v4.9b}{2017/10/10}{Provides color for check boxes when a PDF-related option +% is not taken} +% \begin{macrocode} +\providecommand{\ckboxColor}[1]{\def\@rgi{#1}\ifx\@rgi\@empty + \let\ckbox@Color\relax\else + \def\ckbox@Color{\color{#1}}\fi}\ckboxColor{} +\providecommand{\ckcirColor}[1]{\def\eq@rgi{#1}\ifx\eq@rgi\@empty + \let\ckcir@Color\relax\else + \def\ckcir@Color{\color{#1}}\fi}\ckcirColor{} % \end{macrocode} % \end{macro} % \end{macro} @@ -1988,7 +2130,7 @@ \newcommand{\optsRadioBtnl}[1]{\def\eqe@optsRadiol{#1}} \let\eqe@optsRadiof\@empty\let\eqe@optsRadiol\@empty \def\eqExam@Ans@sq@l{\leavevmode - \if\eq@listType1\stepcounter{quizno}\else\ifwithsoldoc + \if\eq@listType1\stepcounter{quizno}\else\ifwithinsoldoc \stepcounter{quizno}\else\refstepcounter{quizno}\fi\fi \PBS\raggedright\settowidth{\eq@tmplength}{\eq@lw@l}% \sbox{\eq@tmpbox}{\eq@l@l}\eq@tmpdima=\wd\eq@tmpbox @@ -2015,7 +2157,7 @@ \eq@hspanner\ignorespaces } \def\eqExam@Ans@sq@f{\if\eq@listType1\stepcounter{quizno}\else - \ifwithsoldoc\stepcounter{quizno}\else\refstepcounter{quizno}\fi\fi + \ifwithinsoldoc\stepcounter{quizno}\else\refstepcounter{quizno}\fi\fi \PBS\raggedright\settowidth{\eq@tmplength}{\eq@lw@f}% \eq@tmpdima=\wd\eq@tmpbox% \hangindent=\eq@tmplength\hangafter=1\relax @@ -2026,8 +2168,6 @@ \ifanswerkey\previewtrue \Ans@sq@f@driver \else -% \ifallowcircmc -% \ifx\Bbox\eqe@BboxCirc\symbolchoice{circle}\fi\fi \edef\fieldName{% \if\probstar*eqexam.\curr@quiz.\theeqquestionnoi.% part\thepartno% @@ -2051,7 +2191,7 @@ \let\eqe@optscbl\@empty\let\eqe@optscbf\@empty \def\eqExam@Ans@ck@sq@l{\leavevmode \if\eq@listType1\stepcounter{quizno}\else - \ifwithsoldoc\stepcounter{quizno}\else\refstepcounter{quizno}\fi\fi + \ifwithinsoldoc\stepcounter{quizno}\else\refstepcounter{quizno}\fi\fi \PBS\raggedright\settowidth{\eq@tmplength}{\eq@lw@l}% \sbox{\eq@tmpbox}{\eq@l@l}\eq@tmpdima=\wd\eq@tmpbox \def\link@@Content{\linkContentWrapper}% @@ -2077,7 +2217,7 @@ \eq@hspanner\ignorespaces } \def\eqExam@Ans@ck@sq@f{\if\eq@listType1\stepcounter{quizno}\else - \ifwithsoldoc\stepcounter{quizno}\else\refstepcounter{quizno}\fi\fi + \ifwithinsoldoc\stepcounter{quizno}\else\refstepcounter{quizno}\fi\fi \PBS\raggedright\settowidth{\eq@tmplength}{\eq@lw@f}% \eq@tmpdima=\wd\eq@tmpbox% \hangindent=\eq@tmplength\hangafter=1\relax @@ -2163,7 +2303,8 @@ % \begin{macrocode} \AtBeginDocument{% \ifvspacewithsolns\writeAllAnsAtEnd\else - \ifeqfortextbook\writeAllAnsAtEnd\fi\fi + \ifeqfortextbook\writeAllAnsAtEnd\else + \writeWithSolDocTrue\fi\fi } % \end{macrocode} % We execute \cs{vspacewithkeyOff}, which sets \cs{ifkeepdeclaredvspacing} to false, @@ -2207,13 +2348,9 @@ % \end{macrocode} % \DescribeMacro{\eqe@Bbox}When the \texttt{preview} option has been used, draw a frame box % around the bounding rectangle. -% \changes{}{2015/06/04}{Added \cs{previewColor}} -% \DescribeMacro\previewColor\cmd{\previewColor} adds some color to the preview (bounding boxes). The -% default is \texttt{black}. % \begin{macrocode} -\providecommand\previewColor{black} -\def\eqe@BboxRect#1#2{\hbox{\color{\previewColor}\vbox{\hrule width #1 - \hbox to#1{\vrule height#2\hfill\vrule height#2}\vfill\hrule}}} +\def\eqe@BboxRect#1#2{\hbox{\ckbox@Color\vbox{\hrule width #1 + \hbox to#1{\vrule height#2\hfill\vrule height#2}\vfill\hrule}}} \def\useRectForMC{\let\Bbox\eqe@BboxRect} \def\selectedMC{\useRectForMC} % \end{macrocode} @@ -2265,14 +2402,13 @@ % A command to use the circle (h) and the filled circle (x). % \begin{macrocode} \def\circ@Glyph#1#2{\hbox{\smash{\raisebox{\eqe@cirRadius}% - {\makebox[\eqe@cirDiam]{\llap{\rlap{\eqe@lcir#1}% - \hskip#2\relax}}}}}} + {\makebox[\eqe@cirDiam]{\llap{\ckcir@Color + \rlap{\eqe@lcir#1}\hskip#2\relax}}}}}} % \end{macrocode} % Added preview color to the circle version of the bounding box. The color % accessed through \cs{previewColor}, its default is \texttt{black}. % \begin{macrocode} - \def\eqe@BboxCirc#1#2{\hbox{% - \textcolor{\previewColor}{\circ@Glyph{h}{0pt}}}} + \def\eqe@BboxCirc#1#2{\hbox{\ckcir@Color{\circ@Glyph{h}{0pt}}}} % \end{macrocode} % For proofing purposes, prepare the filled circle in the form of the command % \cs{circProofingForCirc}. @@ -2378,26 +2514,34 @@ \newcommand{\preExamSolnHead}{\goodbreak\noindent} \newcommand{\examSolnHeadFmt}[1]{\textbf{#1}} \newcommand{\postExamSolnHead}{\par\medskip} +% \end{macrocode} +% Write to solution file if \emph{not} \textsf{solutions-only} +% \changes{v5.1.3}{2018/12/13}{Write to solution file if not \string\textsf{solutions-only}} +% \begin{macrocode} +\@ifundefined{ifOKToWriteExamData}{\newif\ifOKToWriteExamData + \OKToWriteExamDatatrue}{} \newcommand{\writeToSolnFile}[1]{% + \ifsolutionsonly\else\ifOKToWriteExamData \let\quiz@solns\ex@solns \set@display@protect \eqe@IWO\quiz@solns{#1}% \set@typeset@protect -} + \fi\fi} +\let\writeT@SolnFile\writeToSolnFile % \end{macrocode} % We will write all solutions to the \texttt{.sol} auxiliary file. % \begin{macrocode} -\def\eqe@writetoSolns#1{% - \set@display@protect - \eqe@IWO\quiz@solns{\string\preExamSolnHead - \string\examSolnHeadFmt{#1}\string\postExamSolnHead}% - \set@typeset@protect -} +\def\eqe@writetoSolns#1{% dpsD17 + \ifsolutionsonly\else + \ifOKToWriteExamData + \set@display@protect + \eqe@IWO\quiz@solns{\string\preExamSolnHead + \string\examSolnHeadFmt{#1}\string\postExamSolnHead}% + \set@typeset@protect\fi\fi} \def\eqe@writetoAux#1{% \set@display@protect \eqe@IWO\@auxout{#1}% - \set@typeset@protect -} + \set@typeset@protect} % \end{macrocode} % \end{macro} % \end{macro} @@ -2417,22 +2561,30 @@ \fi\fi } % \end{macrocode} -% This macro gets the page number of the last page of the exam. It is read in through +% This macro \DescribeMacro\eq@ExamLastPage gets the page number of the last page of the exam. It is read in through % a macro definition made and written to the \texttt{.aux} file. % \begin{macrocode} \def\eq@ExamLastPage{\csname eqExamLastPage\endcsname} +% \end{macrocode} +% \DescribeMacro\nPagesOnExam is the number of pages in the exam. +% \begin{macrocode} \newcommand{\nPagesOnExam}{\csname eqExamLastPage\endcsname} +% \end{macrocode} +% \DescribeMacro\nPagesOnQues is the number of pages in the questions. +% \begin{macrocode} \newcommand{\nPagesOfQues}{\ifvspacewithsolns \csname eqExamQuesLastPage\endcsname\else \csname eqExamLastPage\endcsname\fi} +% \end{macrocode} +% \DescribeMacro\nPagesOnSols is the number of pages of solutions. +% \begin{macrocode} \newcommand{\nPagesOfSols}{\def\eqExamNumPagesSolns{0}% \csarg\ifx{eqExamLastPage}\relax\else \csarg\ifx{eqExamLastPage}\relax\else {\count\z@=\nPagesOnExam\relax\advance \count\z@-\nPagesOfQues\relax \xdef\eqExamNumPagesSolns{\the\count\z@}}\fi\fi - \eqExamNumPagesSolns -} + \eqExamNumPagesSolns} % \end{macrocode} % \begin{macro}{\lastPageOfExam} %\changes{v2.0l}{2011/05/05}{% @@ -2502,7 +2654,7 @@ % \begin{macrocode} \newcommand{\makeRefsNums}{% \@ifundefined{thePartNames}{}{\begingroup - \def\\##1{\typeout{processing ##1}% + \def\\##1{\PackageInfo{eqexam}{processing exam: ##1}% \eqe@defNumRefii {##1PageEnd}\eqe@defNumRefii{##1PageBegin}}% \thePartNames @@ -2924,33 +3076,33 @@ % for each part. % \begin{macrocode} \newcommand{\cpSumrybyparts}{% - \eqe@@SumryVert\cp@Usefbox{% - \ifx\cp@Usefbox\fbox - \def\cp@sumryWdth{\cp@SetSumryWidth-2\fboxrule-2\fboxsep}\else - \def\cp@sumryWdth{\cp@SetSumryWidth}\fi - \begin{minipage}[b]{\cp@sumryWdth}\kern0pt - \begin{flushleft} - \setlength{\eqetmplengtha}{\cprulelength}% - \edef\eqe@cprulelength{\the\eqetmplengtha}% - \csarg\ifx{NumberOfParts}\relax - \else - \count2=0 - \medskip - \cpSumryHeader\par\parskip\bigskipamount - \def\\##1{\advance\count2by\csname ##1total\endcsname - \underbar{\makebox[0pt][l]{% - \cp@IsertNaming{##1}}\hspace*{\eqe@cprulelength}}% - / $\eqe@ptsFmt{\csname ##1total\endcsname}% - \cpSumryPts$\par}\thePartNames - \fi - \underbar{\makebox[0pt][l]{\cpSumryTotal}% - \hspace{\eqe@cprulelength}}/ - $\eqe@ptsFmt{\the\count2\relax}\cpSumryPts$ \par - \underbar{\makebox[0pt][l]{\cpSumryGrade}% - \hspace{\eqe@cprulelength}}% - \ifx\cp@Usefbox\fbox\medskip\fi - \end{flushleft}\kern0pt - \end{minipage}}\par + \eqe@@SumryVert\cp@Usefbox{% + \ifx\cp@Usefbox\fbox + \def\cp@sumryWdth{\cp@SetSumryWidth-2\fboxrule-2\fboxsep}\else + \def\cp@sumryWdth{\cp@SetSumryWidth}\fi + \begin{minipage}[b]{\cp@sumryWdth}\kern0pt + \begin{flushleft} + \setlength{\eqetmplengtha}{\cprulelength}% + \edef\eqe@cprulelength{\the\eqetmplengtha}% + \csarg\ifx{NumberOfParts}\relax + \else + \count2=0 + \medskip + \cpSumryHeader\par\parskip\bigskipamount + \def\\##1{\advance\count2by\csname ##1total\endcsname + \underbar{\makebox[0pt][l]{% + \cp@IsertNaming{##1}}\hspace*{\eqe@cprulelength}}% + / $\eqe@ptsFmt{\csname ##1total\endcsname}% + \cpSumryPts$\par}\thePartNames + \fi + \underbar{\makebox[0pt][l]{\cpSumryTotal}% + \hspace{\eqe@cprulelength}}/ + $\eqe@ptsFmt{\the\count2\relax}\cpSumryPts$ \par + \underbar{\makebox[0pt][l]{\cpSumryGrade}% + \hspace{\eqe@cprulelength}}% + \ifx\cp@Usefbox\fbox\medskip\fi + \end{flushleft}\kern0pt + \end{minipage}}\par } % \end{macrocode} % \DescribeMacro{\cpSumrybypages} @@ -2958,49 +3110,49 @@ % for each page. % \begin{macrocode} \newcommand{\cpSumrybypages}{% - \eqe@@SumryVert\cp@Usefbox{% - \ifx\cp@Usefbox\fbox - \def\cp@sumryWdth{\cp@SetSumryWidth-2\fboxrule-2\fboxsep}\else - \def\cp@sumryWdth{\cp@SetSumryWidth}\fi - \begin{minipage}[b]{\cp@sumryWdth}\kern0pt - \begin{flushleft} - \setlength{\eqetmplengtha}{\cprulelength}% - \edef\eqe@cprulelength{\the\eqetmplengtha}% - \csarg\ifx{NumberOfParts}\relax - \else\medskip\count0=0\relax\count2=0\relax - \cpSumryHeader\par\parskip\bigskipamount - \ifsolutionsAtEnd - \@ifundefined{eqExamQuesLastPage}{\def\NUMPAGES{0}} - {\edef\NUMPAGES{\@nameuse{eqExamQuesLastPage}}}% - \else - \@ifundefined{eqExamLastPage}{\def\NUMPAGES{0}} - {\edef\NUMPAGES{\@nameuse{eqExamLastPage}}}% - \fi - \@whilenum\count0<\NUMPAGES\relax\do{% - \advance\count0by1\relax - \@ifundefined{Page\the\count0total}{\count4=0\relax} - {\count4=\@nameuse{Page\the\count0total}\relax}% - \csarg\ifx{Page\the\count0spilltotal}\relax - \else\advance\count4by\csname% - Page\the\count0spilltotal\endcsname\relax\fi - \advance\count2by\count4\relax\underbar{% - \makebox[0pt][l]{\cpSumryPage~\the\count0}% - \hspace*{\eqe@cprulelength}}/ - $\eqe@ptsFmt{\the\count4\relax}% - \cpSumryPts$\csarg\ifx{Page\the\count0spilltotal}\relax - \else\ $(\@nameuse{Page\the\count0spilltotal}% - \cpSumryPts+\@nameuse{Page\the\count0total}% - \cpSumryPts)$\fi\par - }% - \fi - \underbar{\makebox[0pt][l]{\cpSumryTotal}% - \hspace{\eqe@cprulelength}}/ - $\eqe@ptsFmt{\the\count2\relax}\cpSumryPts$\par - \underbar{\makebox[0pt][l]{\cpSumryGrade}% - \hspace{\eqe@cprulelength}}% - \ifx\cp@Usefbox\fbox\medskip\fi - \end{flushleft}\kern0pt - \end{minipage}}\par + \eqe@@SumryVert\cp@Usefbox{% + \ifx\cp@Usefbox\fbox + \def\cp@sumryWdth{\cp@SetSumryWidth-2\fboxrule-2\fboxsep}\else + \def\cp@sumryWdth{\cp@SetSumryWidth}\fi + \begin{minipage}[b]{\cp@sumryWdth}\kern0pt + \begin{flushleft} + \setlength{\eqetmplengtha}{\cprulelength}% + \edef\eqe@cprulelength{\the\eqetmplengtha}% + \csarg\ifx{NumberOfParts}\relax + \else\medskip\count0=0\relax\count2=0\relax + \cpSumryHeader\par\parskip\bigskipamount + \ifsolutionsAtEnd + \@ifundefined{eqExamQuesLastPage}{\def\NUMPAGES{0}} + {\edef\NUMPAGES{\@nameuse{eqExamQuesLastPage}}}% + \else + \@ifundefined{eqExamLastPage}{\def\NUMPAGES{0}} + {\edef\NUMPAGES{\@nameuse{eqExamLastPage}}}% + \fi + \@whilenum\count0<\NUMPAGES\relax\do{% + \advance\count0by1\relax + \@ifundefined{Page\the\count0total}{\count4=0\relax} + {\count4=\@nameuse{Page\the\count0total}\relax}% + \csarg\ifx{Page\the\count0spilltotal}\relax + \else\advance\count4by\csname% + Page\the\count0spilltotal\endcsname\relax\fi + \advance\count2by\count4\relax\underbar{% + \makebox[0pt][l]{\cpSumryPage~\the\count0}% + \hspace*{\eqe@cprulelength}}/ + $\eqe@ptsFmt{\the\count4\relax}% + \cpSumryPts$\csarg\ifx{Page\the\count0spilltotal}\relax + \else\ $(\@nameuse{Page\the\count0spilltotal}% + \cpSumryPts+\@nameuse{Page\the\count0total}% + \cpSumryPts)$\fi\par + }% while + \fi + \underbar{\makebox[0pt][l]{\cpSumryTotal}% + \hspace{\eqe@cprulelength}}/ + $\eqe@ptsFmt{\the\count2\relax}\cpSumryPts$\par + \underbar{\makebox[0pt][l]{\cpSumryGrade}% + \hspace{\eqe@cprulelength}}% + \ifx\cp@Usefbox\fbox\medskip\fi + \end{flushleft}\kern0pt + \end{minipage}}\par } % \end{macrocode} % If the author takes the \texttt{coverpage} option, \cs{eqex@coverpage} is set equal @@ -3221,7 +3373,7 @@ % \begin{macrocode} \newcommand{\eqeomarginboxright}[2]{\makebox[0pt][l]{% \setlength\tabcolsep{0pt}% - \setlength{\@tempdima}{\textwidth+\marginparsep-\parindent}%-\parindent + \setlength{\@tempdima}{\textwidth+\marginparsep-\parindent}% \hspace*{\@tempdima}% \raisebox{-.5\height}[0pt][0pt]{% \marginboxdesign[\insertTotalsBoxPDF]% @@ -3313,7 +3465,8 @@ % And save to the auxiliary file for later usage. % \begin{macrocode} \xdef\lastparttotaled{\argii}% - \eqe@IWO\@auxout{\string\csarg\string\gdef{Page\thepage total}% + \eqe@IWO\@auxout{\string\csarg\string + \gdef{Page\thepage total}% {\theeqpointsthispage}}% % \end{macrocode} % Finally, place the totals box. @@ -3586,26 +3739,73 @@ % \end(quote) % \begin{macrocode} \newsavebox{\workareasb} +% \end{macrocode} +% \changes{v5.0}{2017/11/08}{Added \string\cs{workareaVadj}} +% \DescribeMacro{\workareaVadj}\hskip-\marginparsep\darg{\ameta{skip}} adjusts the vertical skip +% of the first line that appears in the \env{workarea} environment. +% \begin{macrocode} +\def\workareaVadj#1{\bgroup\def\eqe@rgi{#1}\ifx\eqe@rgi\@empty + \def\eqe@rgi{0pt}\fi\setlength{\@tempdima}{\eqe@rgi}% + \xdef\workareaV@dj{\the\@tempdima}\egroup +} % dps1 +\workareaVadj{3pt} +\def\workareaCmds#1{\def\@rgi{#1}\ifx\@rgi\@empty + \let\work@reaCmds\relax\else + \def\work@reaCmds{#1}} +\let\work@reaCmds\relax +\def\priorworkareaCmds#1{\def\@rgi{#1}\ifx\@rgi\@empty % dpsj6 + \let\priorWorkAreaCmds\relax\else + \def\priorWorkAreaCmds{#1}\fi} +\let\priorWorkAreaCmds\relax +% \end{macrocode} +% \begin{macrocode} \newenvironment{workarea}[2][\linewidth] {% \removelastparskip \edef\workareadepth{\if\currhideopt H0pt\else#2\fi}% \begin{lrbox}{\workareasb}\setlength{\eqetmplengtha}{#1}% - \begin{minipage}[b][\workareadepth][t]{\eqetmplengtha}\vspace*{3pt}% +% \end{macrocode} +% A change in support of \cs{fillTypeGrid}. When \cs{ifforceEqualCells} is true, +% we adjust the width of this \env{minipage} to conform to the shorter line +% produced by the grid. +% \changes{v5.0}{2017/11/08}{Changes in \string\env{workarea} to support +% \string\cs{fillTypeGrid}} +% \begin{macrocode} + \ifx\makeVgrid\relax\else % dps2 + \ifforceEqualCells + \ifx\fillLinesLineWidth\@empty\else + \setlength{\eqetmplengtha}{\fillLinesLineWidth}\fi + \fi + \fi + \begin{minipage}[b][\workareadepth][t]{\eqetmplengtha}% +% \end{macrocode} +% Apply vertical skip \cs{workareaV@dj} here, set by \cs{workareaVadj}. +% \begin{macrocode} + \vglue\workareaV@dj +% \end{macrocode} +% Adjust \cs{leftskip} when the problem is a lead-in. +% \changes{v5.0}{2017/11/08}{Within \string\env{workarea}, adjust \string\cs{leftskip} +% when the problem is a lead-in type} +% \begin{macrocode} + \@ifundefined{leadinIndentPrtSep}{}{\ifx\solutionparshape\@empty + \else\leftskip\leadinIndentPrtSep\fi}\work@reaCmds }{% \end{minipage}\end{lrbox}% % \end{macrocode} % \texttt{4/5/11} Changed the logic here, so the \texttt{workarea} is available % for the \texttt{vspace\-with\-solns} option. +% \changes{v5.1.3}{2018/12/13}{added \string\textsf{solutions-after} condition to +% displaying \string\texttt{workarea}} % \begin{macrocode} + \ifeq@solutionsafter\else \par\ifdisplayworkarea \ifx\eq@insertverticalspace\eqe@YES \removelastparskip - \vspace{-\baselineskip}% + \vglue-\baselineskip \if\currhideopt H\else \noindent\strut\smash{\usebox{\workareasb}}% \fi\fi - \fi + \fi\fi } % \end{macrocode} % \end{environment} @@ -3698,17 +3898,18 @@ % \begin{macrocode} } \def\endsplitsolution{% - \ifeq@solutionsafter\strut\par\fi + \ifeq@solutionsafter\solutionsafterSkip\fi % dpsj10 \ifx\solutionparshape\@empty\else \advance\linewidth-\leadinIndentPrtSep\fi %%dps \edef\eqe@workwidth{\if\ss@Argi l\noexpand\ss@Argiii \else\noexpand\linewidth\fi}% \edef\eqe@workfill{\if\ss@Argi l\else\hfill\fi}% - \begin{workarea}[\eqe@workwidth]{\eqedepth}% - \let\panelGetDimen\relax% - \eqe@workfill\input{panel\thepanel@cnt.cut}% - \end{workarea} - \strut\par + \ifeq@solutionsafter\else + \begin{workarea}[\eqe@workwidth]{\eqedepth}% + \let\panelGetDimen\relax% + \eqe@workfill\input{panel\thepanel@cnt.cut}% + \end{workarea} + \fi\ifeq@solutionsafter\else\solutionsafterSkip\fi } % \end{macrocode} % \end{environment} @@ -3853,14 +4054,11 @@ \newenvironment{@ssSolution}[1][\ss@Argii]% {% \def\eqe@argi{#1}\ifx\eqe@argi\@empty\else -% \setlength{\eq@tmpdima}{#1}% -% \let\soln@keys@nLines\@empty \edef\panelheight{\the\panelheight}% \edef\panelwidth{\the\panelwidth}% \edef\temp@exp{\noexpand \setkeys*{soln@keys}{#1}}\temp@exp -% \setkeys*{soln@keys}{#1}% \ifx\soln@keys@nLines\@empty \edef\ss@Argii{\XKV@rm}% \else @@ -3983,7 +4181,19 @@ \ifx\soln@keys@nLines\@empty \edef\passedss@Argii{\ss@Argii}\else \edef\passedss@Argii{\ss@Argii,nLines=\soln@keys@nLines}\fi - \expandafter\@sssolution\expandafter[\passedss@Argii]% +% \end{macrocode} +% For a split solution, cannot allow align left +% \begin{macrocode} + \if\ss@Argi l\fillerLinesAlignDef\fi % dpsj10 +% \end{macrocode} +% I cannot get the filler lines to work when the anserkey is in effect. The next +% few lines locally turns off filler lines for this problem. +% \begin{macrocode} + \ifanswerkey % dpsj10 + \gdef\p@ssToFLs{\let\eq@insertverticalspace\eqe@NO + \@eqlinedfillerfalse}\fi % dpsj10 + \eqe@flextendedfalse + \expandafter\@sssolution\expandafter[\passedss@Argii]% }{% \eqe@IW{\string\endminipage\eqe@rPanel\egroup}% \ifeq@solutionsafter\endminipage\eqe@rPanel\egroup\fi @@ -4164,7 +4374,7 @@ \advance\eq@pointboxtotalheight\dpPtBox\relax \advance\eq@pointboxtotalheight\pointsmarginparpush \vspace*{\eq@pointboxtotalheight}\fi} -\def\eqe@afterexamsepcode{% dps7 +\def\eqe@afterexamsepcode{% \if\eq@parttotals\eqe@YES \@actionsAtPageBreak{\global\let\@spacetobreak1}% {\global\let\@spacetobreak0}% @@ -4173,7 +4383,7 @@ \advance\@tempdima\eq@pointboxtotalheight \ifdim\@tempdima>\pagegoal\aftergroup\newpage \else\ifnum\arabic{eq@count}>0\relax - \removelastskip\vskip6pt\kern0pt %dps7 + \removelastskip\vskip6pt\kern0pt \if\@reportpoints\eqe@One\else\@checkSpacing{0}\fi \textcolor{\endexamtotal@color}% {\eqeomarginbox{\arabic{eq@count}}{0}}\fi @@ -4201,7 +4411,7 @@ % See if there is enough room at the bottom of the page to place the end of exam % totals and to start a new exam, if any. If not, forget it, and start a new page. % \begin{macrocode} - \global\let\afterexamsepcode\eqe@afterexamsepcode % dps7 + \global\let\afterexamsepcode\eqe@afterexamsepcode \fi \fi \ifeqfortextbook\global\examenvfalse\fi @@ -4244,7 +4454,7 @@ % can be used within a textbook. % \begin{macrocode} \def\eqe@hspannerPrb{\ } -\@ifundefined{ifwithsoldoc}{\newif\ifwithsoldoc\withsoldocfalse}{} +\@ifundefined{ifwithinsoldoc}{\newif\ifwithinsoldoc\withinsoldocfalse}{} \newcommand{\eqequestopsep}[1]{\def\eqeques@topsep{#1}} \providecommand{\eqequesparsep}[1]{\def\eqeques@parsep{#1}} \newcommand{\eqequesitemsep}[1]{\def\eqeques@itemsep{#1}} @@ -4258,17 +4468,17 @@ \let\eqe@next\@empty\else\let\eqe@next\item\fi\eqe@next\relax} \newenvironment{eqequestions}{% \begin{list}{}{% - \ifwithsoldoc\let\solnItemMngt\eqeSolnItemMngt\fi + \ifwithinsoldoc\let\solnItemMngt\eqeSolnItemMngt\fi \setlength{\labelwidth}{\eqemargin}% \setlength{\parsep}{\eqeques@parsep}% \setlength{\itemsep}{\eqeques@itemsep}% \setlength{\topsep}{\eqeques@topsep}% \setlength{\itemindent}{0pt}% \setlength{\listparindent}{\eqeques@listparindent}%dps% - \ifwithsoldoc\settowidth{\labelsep}{\eqe@hspannerSoln}\else + \ifwithinsoldoc\settowidth{\labelsep}{\eqe@hspannerSoln}\else \settowidth{\labelsep}{\eqe@hspannerPrb}\fi \setlength{\leftmargin}{\labelwidth}% - }\ifwithsoldoc\global\firstitemtrue\fi\item\relax}{\end{list}} + }\ifwithinsoldoc\global\firstitemtrue\fi\item\relax}{\end{list}} % \end{macrocode} % \begin{environment}{exam} % Each part of the exam is enclosed in an \texttt{exam} environment. The one @@ -4288,8 +4498,24 @@ \def\noExamTitleInSolns{\let\eqeWrtExamTitleToSolns\eqe@NO} \let\thisexamlabel\@empty \let\isInExamEnv\eqe@NO +% \end{macrocode} +% \DescribeMacro{\RecordThisExamOff} causes \pkg{eqexam} to place \cs{iffalse} and \cs{fi} +% around the solutions to this exam in the solution file. This makes the solution results +% of this exam invisible. \cs{RecordThisExamOff} sets an internal switch \cs{ifDoNotRecordThisExam} +% to \texttt{true}. This switch is set back to \texttt{false} at the end of the environment. +% \changes{v5.1d}{2018/02/02}{Added \string\cs{RecordThisExamOff}} +% \begin{macrocode} +\newif \ifDoNotRecordThisExam \DoNotRecordThisExamfalse % dpsf02 +\def\RecordThisExamOff{\DoNotRecordThisExamtrue} % dpsf02 +\def\bIFFalseWrtSolns{\writeT@SolnFile{\protect\iffalse^^J}} +\def\eIFFalseWrtSolns{\writeT@SolnFile{\protect\fi^^J}} +% \end{macrocode} +% The beginning of the \env{exam} environment. +% \begin{macrocode} \newenvironment{exam}[2][] {% + \ifDoNotRecordThisExam % dpsf02 + \expandafter\bIFFalseWrtSolns\fi \makeRoomForProb{\@fvsizeskip\textheight}{0}% \let\isInExamEnv\eqe@YES \stepcounter{eq@numparts}% @@ -4328,8 +4554,11 @@ % \begin{macrocode} \vskip\eqeques@parsep\relax\kern0pt %dps88 \endshortquiz - \aftergroup\afterexamsepcode % dps7 + \aftergroup\afterexamsepcode \par\penalty-100\vskip0pt + \ifDoNotRecordThisExam % dpsf02 + \expandafter\eIFFalseWrtSolns\fi + \global\DoNotRecordThisExamfalse } % \end{macrocode} % \end{environment} @@ -4564,13 +4793,22 @@ \string\eqe@wordNums.}} % \end{macrocode} % \end{macro} +% Added two hooks \cs{priorPNPAction} and +% \cs{postPNPAction} to \cs{makeRoomForProb} to allow some defined actions +% before and after a page break generated by \cs{makeRoomForProb}. +% \changes{v5.0}{2017/11/08}{Added hooks \string\cs{priorPNPAction} and +% \string\cs{postPNPAction} to \string\cs{makeRoomForProb}}. Examples of usage +% are found in \cs{vspaceFillerLines} and \cs{eq@linesXPgs}. % \begin{macrocode} +\let\priorPNPAction\relax % dps1 +\let\postPNPAction\relax +\def\eqe@mkRoomPgBrk{\priorPNPAction\newpage\postPNPAction} \def\makeRoomForProb#1#2{\par %\endgraf % dps 11/11/10 \bgroup\@nobreakfalse\addpenalty{-500}% \setlength{\@tempdimb}{#1}% \@tempdima \pagegoal \advance \@tempdima -\pagetotal \ifdim \@tempdima<\@tempdimb\ifnum\col@number>\@ne\columnbreak - \else\newpage\fi\fi\egroup + \else\aftergroup\eqe@mkRoomPgBrk\fi\fi\egroup \ifnum\@reportpoints>1 \ifx\eqe@prevProbZero\eqe@YES \if\eqe@isPts0\else\vskip-\halfHtPtBox\relax\fi @@ -4597,22 +4835,23 @@ {\def\eqe@emnb{\ifnum\col@number>\@ne\columnbreak \else\newpage\fi\insertContAnnot}\eq@emitMessageNearBottom} {\let\eqe@emnb\relax\eq@emitMessageNearBottom}} -\newcommand{\eq@emitMessageNearBottom}[2][\iacvspace]{% +\newcommand{\eq@emitMessageNearBottom}[2][2\wlVspace]{% \eq@@emitMessageNearBottom{#1}{#2}} \def\eq@@emitMessageNearBottom#1#2{\par \bgroup\@nobreakfalse\addpenalty{-500}% \setlength{\@tempdimb}{#1}% \@tempdima \pagegoal \advance \@tempdima -\pagetotal - \ifdim \@tempdima<\@tempdimb #2 \eqe@emnb\fi\egroup} + \ifdim \@tempdima<\@tempdimb #2 \eqe@emnb + \xdef\eq@currProbStartPage{0}\fi\egroup} % dps4 % \end{macrocode} % \end{macro} % \DescribeMacro{\getSpaceLeftOnPage}\cmd{\getSpaceLeftOnPage} calculates % the amount of space left on the current page. It saves the calculation -% in the text macro \DescribeMacro{\amtSpaceOnLeftOnPage}\cmd{\amtSpaceOnLeftOnPage}. +% in the text macro \DescribeMacro{\amtSpaceLeftOnPage}\cmd{\amtSpaceLeftOnPage}. % \begin{macrocode} \newcommand{\getSpaceLeftOnPage}{\par\bgroup \@tempdima \pagegoal \advance \@tempdima -\pagetotal - \xdef\amtSpaceOnLeftOnPage{\the\@tempdima}\egroup} + \xdef\amtSpaceLeftOnPage{\the\@tempdima}\egroup} % \end{macrocode} % \begin{macro}{\promoteNewPage} %\changes{v2.0n}{2011/05/13}{% @@ -4696,22 +4935,48 @@ \rowsepDefault{3pt}\partstabcolsep{1.5pt}% \partstabtopsep{3pt}\partstabrowsep{3pt} \renewcommand\belowexsolnskip{{}}% -% \end{macrocode} -% The \textsf{problem} environment now begins. -% \begin{macrocode} \let\isProbEnv\eqe@NO \let\topofprobhook\relax -\newenvironment{problem}[1][]{\let\isProbEnv\eqe@YES +% \end{macrocode} +% Normally, you don't leave a blank line between the beginning +% of \env{problem} and the statement of problem. If you're in the habit +% of doing that, we can absorb that blank space. See similar +% command above the definition of \env{problem*} for more information. +% \changes{v5.1a}{2018/01/21}{added \string\cs{eqe@p@gobnxtp@r}} +% \begin{macrocode} +\def\eqe@p@gobnxtp@rDef{\@ifnextchar\par{\eqe@p@gobtop@rnext}{}} +\def\eqe@p@gobtop@rnext#1\par{} +\def\applyparfixesp{\let\eqe@p@gobnxtp@r\eqe@p@gobnxtp@rDef} +%\def\cancelparfixesp{\let\eqe@p@gobnxtp@r\relax} +\def\cancelparfixesp{\let\eqe@p@gobnxtp@r\ignorespaces} +% \end{macrocode} +% The \env{problem} environment now begins. +% \changes{v5.1f}{2018/02/09}{modify problem env to analyze two optional args} +% \begin{macrocode} +\newcommand{\problem}[1][]{\lowercase{\def\@rgi{#1}}% +% \end{macrocode} +% Support for h and H argument when it is the first argument. +% \changes{v5.1e}{2018/02/09}{Support for h and H argument} +% \changes{v5.1j}{2018/04/15}{Change comparison to \string\cs{ifx}, \string\cs{if} +% give incorrect result when points are of the form 11, 22, 33, etc.} +% \begin{macrocode} + \ifx\@rgi\eqe@h + \def\hidden@ttr{[#1]}\let\numpoints\@empty\else + \let\hidden@ttr\relax\def\numpoints{#1}\fi + \problem@cont} +\newcommand{\problem@cont}[1][]{\let\isProbEnv\eqe@YES + \def\@rgi{#1}\ifx\hidden@ttr\relax % assume a number or empty + \ifx\@rgi\@empty\else\def\hidden@ttr{[#1]}\fi\fi \if\eqe@isPts0\global\let\eqe@prevProbZero\eqe@YES\else \global\let\eqe@prevProbZero\eqe@NO\fi \global\thereissolutionfalse - \def\numpointsEmpty{0}\def\numpoints{#1}% + \def\numpointsEmpty{0}% \ifx\numpoints\@empty\def\numpoints{0}\def\numpointsEmpty{1}% \gdef\eqe@isPts{0}\else\gdef\eqe@isPts{1}\fi \makeRoomForProb{\@nbaselineskip\baselineskip}{\eqe@isPts}% \gdef\probstar{x}\let\afterlabelhskip\@empty - \ifx\marginpoints\@empty\else %\def\numpoints{#1}% - \if\numpointsEmpty\eqe@One\let\marginpoints\@gobbletwo\fi + \ifx\marginpoints\@empty\else + \if\numpointsEmpty\eqe@One\let\marginpoints\@gobbletwo\fi % \end{macrocode} %\changes{v2.0n}{2011/05/13}{% % Added \texttt{*} to signal in-line display of points. @@ -4720,20 +4985,23 @@ % \texttt{[*3]}, it is a three point problem, but the value is expressed % in-line, not in the margins. % \begin{macrocode} - \@ifstar{\let\@isitstar\eqe@One\eqe@grabarg}% - {\let\@isitstar\eqe@Zero\eqe@gobbletoend}#1\end - \if\@isitstar\eqe@One\addtocounter{eqpointvalue}{\numpoints}% - \@marktotalvalue - \ifdispl@yPoints - \def\marginparafterhook{\PTs{\numpoints}\space}\else - \def\marginparafterhook{\PTs*{\numpoints}\space}\fi\else - \def\marginparpriorhook{\noindent - \probvalue{\numpoints}{0}}\fi - \fi\setcounter{eq@count}{\value{eqquestionnoi}}% + \def\@lti{\let\@isitstar\eqe@One\eqe@grabarg}% + \def\@ltii{\let\@isitstar\eqe@Zero\eqe@gobbletoend}% + \expandafter\@ifstar\expandafter\@lti + \expandafter\@ltii\numpoints\end + \if\@isitstar\eqe@One\addtocounter{eqpointvalue}{\numpoints}% + \@marktotalvalue + \ifdispl@yPoints + \def\marginparafterhook{\PTs{\numpoints}\space}\else + \def\marginparafterhook{\PTs*{\numpoints}\space}\fi\else + \def\marginparpriorhook{\noindent + \probvalue{\numpoints}{0}}\fi + \fi + \setcounter{eq@count}{\value{eqquestionnoi}}% \addtocounter{eq@count}{1}% \ifnum\value{eq@count}=1\relax - \eqe@IWO\@auxout{\string - \csarg\string\gdef{pagenofirstprob\thisexamlabel}{\thepage}}% + \eqe@IWO\@auxout{\string + \csarg\string\gdef{pagenofirstprob\thisexamlabel}{\thepage}}% \fi % \end{macrocode} % \changes{}{2015/06/01}{Added the hook \cs{topofprobstarhook}} @@ -4742,23 +5010,29 @@ % \texttt{eqequestions} environment. % \begin{macrocode} \topofprobhook + \begin{eqequestions}% % \end{macrocode} -% \changes{v3.1e}{2012/11/10}{Removed hard-wired \cs{proofingsymbol}} +% \textbf{Begin exercise env.} Insert h or H when it is the first argument through \cs{hidden@ttr}, +% then begin the \texttt{exercise} environment using the counter +% \texttt{eqquestionnoi}. +% \changes{v5.1e}{2018/02/09}{Support for h and H argument} % \begin{macrocode} -% \proofingsymbol{\ding{52}}% - \begin{eqequestions}% - \begin{exercise}[eqquestionnoi]% -}{\end{exercise}% + \edef\ctrld@exp@exercise{\noexpand + \begin{exercise}[eqquestionnoi]\hidden@ttr}% + \ctrld@exp@exercise\ignorespaces\eqe@p@gobnxtp@r} +% \end{macrocode} +% \textbf{end problem env.} The code for the end of the problem environment. +% \begin{macrocode} +\def\endproblem{\end{exercise}% \end{eqequestions}% - \ifeqlocalversion\ifeqglobalversion - \xdef\eqe@tmp{\noexpand\forVersion{\eq@selectedVersion}}% - \aftergroup\eqe@tmp - \fi\fi - \global\eqlocalversionfalse - \ifdispl@yPoints\global\l@stDispl@yPointstrue - \else\global\l@stDispl@yPointsfalse\fi - \global\let\eqe@fpmrk\@empty -} + \ifeqlocalversion\ifeqglobalversion + \xdef\eqe@tmp{\noexpand\forVersion{\eq@selectedVersion}}% + \aftergroup\eqe@tmp + \fi\fi + \global\eqlocalversionfalse + \ifdispl@yPoints\global\l@stDispl@yPointstrue + \else\global\l@stDispl@yPointsfalse\fi + \global\let\eqe@fpmrk\@empty} % \end{macrocode} % \end{environment} % \begin{macro}{\PTs} @@ -4873,11 +5147,37 @@ {Using the star (*) in front of the points\MessageBreak designator is not allowed when there is a \MessageBreak\string\tableadin}} +\let\isProbStarEnv\eqe@NO +\let\topofprobstarhook\relax +% \end{macrocode} +% Added \cs{eqe@gobnxtpar} to hopefully, eliminate the need to leave +% no pars (blank lines) between |\begin{parblem*}| and either \cs{leadinitem} +% or \cs{tableadin}. The default is to not affect the old behavior. You have +% to declare \DescribeMacro{\applyparfixes}\cs{applyparfixes} to apply the +% fix; revert back to the old behavior with \DescribeMacro{\cancelparfixes}\cs{cancelparfixes} +% \changes{v5.1a}{2018/01/21}{added \string\cs{eqe@gobnxtpar}} +% \begin{macrocode} +\def\eqe@ps@gobtop@r#1\par{\eqe@isle@dinnext} +\def\eqe@isle@dinnext{\@ifnextchar\leadinitem{}{\vskip-\baselineskip}} +\def\restorele@dinpfixDef{\@ifnextchar\par{\eqe@ps@gobtop@r}{}} +\let\eqe@ps@gobnxtpar\restorele@dinfixDef +\def\applyleadinfix{\let\eqe@gobnxtpar\restorele@dinpfixDef} +\def\cancelleadinfix{\let\eqe@gobnxtpar\relax} +\def\applyparfixes{\PackageInfo{eqexam} + {Applying paragraph fixes to problem\MessageBreak + and problem* environments}\applyparfixesp\applyleadinfix} +\def\cancelparfixes{\PackageInfo{eqexam} + {Cancelling paragraph fixes to problem\MessageBreak + and problem* environments}\cancelparfixesp + \cancelleadinfix} +% \end{macrocode} +% The default behavior is to do nothing about blank lines. +% \begin{macrocode} +\cancelparfixesp\cancelleadinfix +\let\neutralizeparfixes\cancelparfixes % \end{macrocode} % We now begin the code for the \texttt{problem*} environment. % \begin{macrocode} -\let\isProbStarEnv\eqe@NO -\let\topofprobstarhook\relax \csarg\def{problem*}{\let\isProbEnv\eqe@YES \let\isProbStarEnv\eqe@YES \global\thereissolutionfalse @@ -4962,9 +5262,10 @@ % \begin{macrocode} \topofprobstarhook \ifeqfortextbook - \writeToSolnFile{\protect\global\protect\frstProbNumShownfalse}\fi + \writeT@SolnFile{\protect\global + \protect\frstProbNumShownfalse}\fi \begin{eqequestions}% - \begin{exercise}[eqquestionnoi]*}% + \begin{exercise}[eqquestionnoi]*\eqe@gobnxtpar}% % \end{macrocode} % \begin{macrocode} \def\ftb@endprobstarCks{% @@ -4978,13 +5279,13 @@ %\DescribeMacro{\endproblem*} begins here. % \begin{macrocode} \csarg\def{endproblem*}{% - \eqe@IWO\@auxout{\string - \csarg\string\gdef{nPartsThisProb\thisexamlabel.\theeqquestionnoi}% - {\arabic{partno}}}% + \eqe@IWO\@auxout{\string\csarg\string + \gdef{nPartsThisProb\thisexamlabel.\theeqquestionnoi}% + {\arabic{partno}}}% \ifx\probpointseach\@empty\else \ifx\probpointseach\auto - \eqe@IWO\@auxout{\string - \csarg\string\gdef{prob\thisexamlabel.\theeqquestionnoi}% + \eqe@IWO\@auxout{\string\csarg\string + \gdef{prob\thisexamlabel.\theeqquestionnoi}% {\theeq@count}}% \else \setcounter{eq@count}{\value{partno}}% @@ -5010,9 +5311,8 @@ \egroup \fi \multiply\value{eq@count}\argi - \eqe@IWO\@auxout{\string - \csarg\string\gdef{prob\thisexamlabel.\theeqquestionnoi}% - {\theeq@count}}% + \eqe@IWO\@auxout{\string\csarg\string + \gdef{prob\thisexamlabel.\theeqquestionnoi}{\theeq@count}}% \fi\fi \end{exercise}% \end{eqequestions}% @@ -5092,7 +5392,7 @@ % we toss an exception. % \begin{macrocode} \def\eqe@next{\eqe@@leadinitem}% - \ifeqfortextbook\writeToSolnFile{\protect\bpartsmrk}\fi + \ifeqfortextbook\writeT@SolnFile{\protect\bpartsmrk}\fi \else \def\eqe@next{\PackageError{eqexam} {The \string\leadinitem\space command may @@ -5114,8 +5414,8 @@ % We signal a \cs{leadinitem} by writing a special command to the AUX file, % this is used to disallow the use of the \texttt{*} option of points. % \begin{macrocode} - \eqe@writetoAux{\string - \csarg\string\gdef{leadinitem\thisexamlabel-\theeqquestionnoi}{}}% + \eqe@writetoAux{\string\csarg\string + \gdef{leadinitem\thisexamlabel-\theeqquestionnoi}{}}% \settowidth{\eq@tmpdima}{\normalfont\parts@indent\eqe@prtsepPrb}% \xdef\leadinIndentPrtSep{\the\eq@tmpdima}% \setlength{\eq@tmpdima}{\eqemargin+\eq@tmpdima}% @@ -5168,10 +5468,12 @@ % \end{macrocode} % The final step. If the solution is hidden, we do not write the header. % \changes{v3.3a}{2013/05/03}{Changed name of \cs{eq@writeexheader} to \cs{eqExerSolnHeader}} +% \changes{v4.9a}{2017/04/05}{Added a test for solutions after within lead-in item} % \begin{macrocode} \def\eq@leadin@item{\eq@ckglobalhide\ifeq@hidesolution\else \global\let\eqExerSolnHeader\eq@@writeexheaderlist\fi \ifeq@nosolutions\eq@nolinktrue\fi + \ifeq@solutionsafter\eq@nolinktrue\fi \unskip\noindent\makebox[\partsleadinIndent]{\eqexlisttabheader}% \eqe@prtsepPrb\ignorespaces } @@ -5182,7 +5484,7 @@ % \textsf{exerquiz}. % \begin{macrocode} \def\eqe@tableadin{\@tableadinitemtrue\eqe@writetoAux{\protect - \csarg\protect\gdef{tableadin\thisexamlabel-\theeqquestionnoi}{}}% + \csarg\protect\gdef{tableadin\thisexamlabel-\theeqquestionnoi}{}}% } % \end{macrocode} % \begin{macro}{\pushProblem} @@ -5486,27 +5788,27 @@ % page is different than the starting page, \cs{eq@currProbStartPage}, we % insert \cs{annotContStr}. % \begin{macrocode} -%\newcommand{\priorAnnotInsert}[1]{\def\eq@priorAnnotInsert{#1}} -%\let\eq@priorAnnotInsert\relax +\def\@nnotContStrSkip{\vskip3pt} \newcommand{\eqe@insertContAnnot}[1][\iacvspace]{\promoteNewPage[#1]% - \ifnum\arabic{page}>\eq@currProbStartPage - \xdef\eq@currProbStartPage{\arabic{page}}% - {\settowidth{\eq@tmplength}{\parts@indent\eqe@prtsepPrb}% - \xdef\eqe@partsIndent{\the\eq@tmplength}}% - \ifwithinparts + \ifnum\arabic{page}>\eq@currProbStartPage + \xdef\eq@currProbStartPage{\arabic{page}}% + {\settowidth{\eq@tmplength}{\parts@indent\eqe@prtsepPrb}% + \xdef\eqe@partsIndent{\the\eq@tmplength}}% + \ifwithinparts % \end{macrocode} % \cs{eq@item} is the \texttt{list} definition of \cs{item} which has been % \cs{let} to \cs{eq@item} within the \texttt{parts} environment. % \begin{macrocode} - \@ifundefined{eq@item@latex}{\item[]\hspace*{-\eqemargin}% - \ifx\solutionparshape\@empty\else\hspace*{-\eqe@partsIndent}\fi} - {\eq@item@latex[]\hspace*{-\eqemargin}% - \hspace{-\eqe@partsIndent}}\else + \@ifundefined{eq@item@latex}{\item[]\hspace*{-\eqemargin}% + \ifx\solutionparshape\@empty\else\hspace*{-\eqe@partsIndent}\fi} + {\eq@item@latex[]\hspace*{-\eqemargin}% + \hspace{-\eqe@partsIndent}}\else % \end{macrocode} % If placed between problem sets, we indent as appropriate. % \begin{macrocode} - \hspace*{-\eqemargin}\fi\annotContStr - \fi + \hspace*{-\eqemargin}\fi + \annotContStr\@nnotContStrSkip % dpsj20 + \fi } \edef\eq@currProbStartPage{\arabic{page}} % \end{macrocode} @@ -5516,9 +5818,11 @@ % \begin{macro}{\turnContAnnotOn} % Turn off and on this feature. The default is off. % \begin{macrocode} +\newif\ifcont@nnot \cont@nnotfalse %\newcommand{\@gobbloptone}[1][]{} -\newcommand{\turnContAnnotOff}{\global\let\eq@insertContAnnot\relax} -\newcommand{\turnContAnnotOn}{% +\newcommand{\turnContAnnotOff}{\global\cont@nnotfalse + \global\let\eq@insertContAnnot\relax} +\newcommand{\turnContAnnotOn}{\global\cont@nnottrue \global\let\eq@insertContAnnot\eqe@insertContAnnot} \turnContAnnotOff % \end{macrocode} @@ -5594,13 +5898,81 @@ % \end{macrocode} % \end{macro} % -%\subsection{Vertical Space Filling Options} +%\section{Vertical Space Filling Options} % -% When the \texttt{nosolutions} or the \texttt{vspacewithsolns} is used, a -% vertical space is generated by the \texttt{solution} environment. +% When the \opt{nosolutions} or the \opt{vspacewithsolns} is used, a +% vertical space is generated by the \env{solution} environment. % Previously, this has just been a vertical white space, now, we provide % the ability to fill the space with horizontal rules of different types. % Below is the implementation of this. +% +% \subsection{General filler lines commands and controls} +% \begin{macro}{\useFillerLines} +% When used, the vertical space is written with lines (rules, dashes, dots, grids ). +%\changes{v2.0e}{2011/03/07} +%{% +% Added the feature of filling the vertical space with ruled lines of +% different types. This feature is available for paper options and for +% \texttt{nosolutions} and \texttt{vspacewithsolution} options. +%} +% \begin{macrocode} +\newcommand{\useFillerLines}{\ifx\vspaceFiller % dpsj8 + \vspaceFillerLines\else\@eqlinedfillertrue + \let\vspaceFiller\vspaceFillerLines\fillTypeDefault +\fi} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\useFillerDefault} +% Resets the vertical space to the original white space. +% \begin{macrocode} +\newcommand{\useFillerDefault}{\@eqlinedfillerfalse + \let\vspaceFiller\vspaceFillerDefault + \let\eqWriteLine\hfill} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\fillTypeHRule} +% Writes the line as a solid line (\cs{hrulefill}). +% \begin{macrocode} +\newcommand{\fillTypeHRule}{\let\eqWriteLine\eqWriteLineFill + \let\makeVgrid\relax} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\fillTypeDots} +% Writes the line as a dotted line (\cs{dotfill}). +% \begin{macrocode} +\newcommand{\fillTypeDots}{\let\eqWriteLine\eqWriteLineDots + \let\makeVgrid\relax} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\fillTypeDashLine} +% Writes the line as a dotted line (\cs{eqdashrulefill}). +% \begin{macrocode} +\newcommand{\fillTypeDashLine}{\let\eqWriteLine\eqWriteLineDashFill + \let\makeVgrid\relax} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\fillTypeBlankLine} +% Fills the line +% \begin{macrocode} +\newcommand{\fillTypeBlankLine}{\let\eqWriteLine\eqWriteLineBlankFill + \let\makeVgrid\relax} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\fillTypeDefault} +% Resets fill type back to the default, \cs{hrulefill}. +% \begin{macrocode} +\newcommand{\fillTypeDefault}{\let\eqWriteLine\eqWriteLineFill + \let\makeVgrid\relax} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\fillTypeGrid} +% Fills the space with a grid, horizontal and vertical lines. +% \changes{v4.9c}{2017/11/03}{Added \string\cs{fillTypeGrid}} +% \begin{macrocode} +\newcommand{\fillTypeGrid}{\ifx\vspaceFiller\vspaceFillerLines + \let\eqWriteLine\eqWriteLineFill\let\makeVgrid\eqe@makeVgrid\fi} +% \end{macrocode} +% \end{macro} % \begin{macro}{\eqWriteLineColor} % The color of the rule to use. % \begin{macrocode} @@ -5613,7 +5985,7 @@ % \begin{macrocode} \newlength\wlVspace \newcommand{\eqWLSpacing}[1]{\setlength\wlVspace{#1}} -\eqWLSpacing{14pt} +\eqWLSpacing{14.0pt} % \end{macrocode} % \end{macro} % \paragraph*{Fill Types.} We have three types of line fill: @@ -5623,151 +5995,1080 @@ % \cs{let} to \cs{eqWriteLine}, which is used in \cs{vspaceFillerLines}. % \begin{macrocode} \newcommand{\eqWriteLineFill}{% - \textcolor{\eq@WriteLineColor}{\hrulefill}} -%\newcommand{\eqWriteLineDots}{% -% \textcolor{\eq@WriteLineColor}{\dotfill}} -\def\eqdotrulefile{\leavevmode - \cleaders\hb@xt@ .44em{\hbox to0pt{\hss.\hss}\hss}\hfill\kern\z@} + \textcolor{\eq@WriteLineColor}{\leaders + \hrule height \flfboxrule\hfill}} +% \end{macrocode} +% The first box is used in \cs{eqdotrulefill}, whereas the second two are +% used to split off content using \cs{vsplit}. These are active when +% the options flextended and answerkey are in force, and when +% \cs{useFillerLines} and \cs{turnflanskeyOn} have been expanded. +% \begin{macrocode} +\newbox\eqe@tempbox +\newbox\eqe@nskeyflsplit +\newbox\eqe@nskeyfltop +\def\eqdotrulefill{\leavevmode + \cleaders\hb@xt@ .44em{\copy\eqe@tempbox\hss}\hfill} % dps16 +% \cleaders\hb@xt@ .44em{\unhcopy\eqe@tempbox\hss}\hfill} % dps8 \newcommand{\eqWriteLineDots}{% - \textcolor{\eq@WriteLineColor}{\eqdotrulefile}} -%\def\eqdashrulefill{\leavevmode -% \cleaders\hb@xt@ .44em{\hss\rule{.22em}{.4pt}\hss}\hfill\kern\z@} -\def\eqdashrulefill{\leavevmode%\kern-.11em - \cleaders\hb@xt@ .44em{\rule{.22em}{.4pt}\hss}\hfill\kern\z@} + \textcolor{\eq@WriteLineColor}{\eqdotrulefill}} +\def\eqdashrulefill{\leavevmode + \cleaders\hb@xt@ .44em{\rule{.22em}{\flfboxrule}\hss}\hfill\kern\z@} \newcommand{\eqWriteLineDashFill}{% - \textcolor{\eq@WriteLineColor}{\eqdashrulefill}} -\newcommand{\eqWriteLineBlankFill}{\hfill} -% \end{macrocode} -% Use \DescribeMacro{\fillerLinesAlignDef}\cs{fillerLinesAlignDef} and -% \DescribeMacro{\fillerLinesOnLeftMargin}\cs{fillerLinesOnLeftMargin} to adjust -% the alignment of the rule lines for this feature. The first is the default, -% the second one aligns rule lines to the left margin. + \textcolor{\eq@WriteLineColor}{\eqdashrulefill}} +%\newcommand{\eqWriteLineBlankFill}{\hfill} +\newcommand{\eqWriteLineBlankFill}{\vphantom{\hrulefill}} +% \end{macrocode} +% Vertical counterparts to those above, excepting blank fill. +% \changes{v5.0}{2017/11/08}{Added vertical rules} +% \begin{macrocode} +\newcommand{\eqWriteLineVFill}{\leaders\vrule width\flfboxrule\vfill} +\def\eqdotruleVfill{\cleaders\vbox to .44em{\vss + \hbox to0pt{\hss.\hss}}\vfill} +\newcommand{\eqWriteLineVDots}{\eqdotruleVfill} +\def\eqdashruleVfill{\cleaders\vbox to .44em{\vss + \hbox to0pt{\hss\rule{\flfboxrule}{.22em}\hss}}\vfill} +\newcommand{\eqWriteLineDashVFill}{\eqdashruleVfill} +% \end{macrocode} +% When the \env{solution} environment contains both an \texttt{nLines} and a dimension, +% by default, the dimension is used; however, if \DescribeMacro{\usenLineDimen}\cs{usenLineDimen} +% is specified, we force the use of the \texttt{nLines} specification. Switch back to the default +% using \DescribeMacro{\useVspaceDimen}\cs{useVspaceDimen}. % \begin{macrocode} \newif\if@equsedim \@equsedimtrue \newcommand{\useVspaceDimen}{\@equsedimtrue} \newcommand{\usenLineDimen}{\@equsedimfalse} \newif\if@eqalignfilllinestoleft\@eqalignfilllinestoleftfalse +% \end{macrocode} +% Use \DescribeMacro{\fillerLinesAlignDef}\cs{fillerLinesAlignDef} and +% \cs{fillerLinesOnLeftMargin} to adjust +% the alignment of the rule lines for this feature.\DescribeMacro{\fillerLinesOnLeftMargin} +% The first is the default, the second one aligns rule lines to the left margin. +% \begin{macrocode} \newcommand{\fillerLinesOnLeftMargin}{\@eqalignfilllinestolefttrue} \newcommand{\fillerLinesAlignDef}{\@eqalignfilllinestoleftfalse} \newcommand\priorPageBreakMsg[1]{\def\priorP@geBre@kMsg{#1}} \let\priorP@geBre@kMsg\@empty -\newcommand{\flPageBreakMsg}[1]{%\acvspace{2\wlVspace}% - \priorPageBreakMsg{\emitMessageNearBottom[2\wlVspace] +\newcommand{\flPageBreakMsg}[1]{% + \priorPageBreakMsg{\emitMessageNearBottom[\iacvspace] {\eqfititin{{\Large\strut}#1}}}% } -\newcommand{\vspaceFillerLines}[1]{\begingroup\offinterlineskip - \parindent0pt\relax\parskip0pt - \@tempdima\wlVspace\eqetmplengtha0pt - \def\eqe@fillwidth{\linewidth+\eqetmplengtha}% - \settowidth{\eqetmplengthb}{\eqe@decPointPrb}% - \@whiledim\@tempdima<#1\relax\do{\priorP@geBre@kMsg - \eq@insertContAnnot\vskip\wlVspace\eqe@wrtLineKernal - \makebox[0pt][l]{\makebox[\eqe@fillwidth]{\eqWriteLine}}% - \addtolength{\@tempdima}{.4pt+\wlVspace}\par - }\endgroup -} -\def\eq@linesXPgs{\begingroup\offinterlineskip - \parindent0pt\relax\parskip0pt - \@tempcnta=0 \eqetmplengtha0pt - \settowidth{\eqetmplengthb}{\eqe@decPointPrb}% - \def\eqe@fillwidth{\linewidth+\eqetmplengtha}% - \@whilenum\@tempcnta<\soln@keys@nLines\relax\do{\priorP@geBre@kMsg - \eq@insertContAnnot\vskip\wlVspace\eqe@wrtLineKernal - \makebox[0pt][l]{\makebox[\eqe@fillwidth]{\eqWriteLine}}% - \advance\@tempcnta1\relax}\par\endgroup -} -\def\eqe@wrtLineKernal{% - \ifx\solutionparshape\@empty - \if@eqalignfilllinestoleft - \setlength{\eqetmplengtha}{\labelwidth+\eqemargin}% - \setlength{\eqetmplengtha} - {\eqetmplengtha+\eqetmplengthb}% - \ifwithinparts - \setlength{\eqetmplengtha}{\labelwidth}% - \setlength{\eqetmplengtha} - {\eqetmplengtha+\eqetmplengthb}% - \ifx\eq@item\item@part@tabular - \hspace*{-\eqemargin}\eqetmplengtha\eqemargin\else - \hspace*{-\eqetmplengtha}\fi - \else - \hspace*{-\eqemargin}\eqetmplengtha\eqemargin - \fi +% \end{macrocode} +% The command \cs{makeVgrid} is an internal macro that is let to either +% \cs{relax}, as below, or to \cs{eqe@makeVgrid}. The latter creates a grid of fill lines. +% \begin{macrocode} +\let\makeVgrid\relax %dps1 +% \end{macrocode} +% \paragraph*{Key-values for fill lines} +% We define the \texttt{eqefillLines} \pkg{xkeyval} family, the keys are set through the +% command \cs{setFillLinesFmt}. We define nine keys +% \texttt{numbers}, \texttt{numbersep}, \texttt{color}, \texttt{topline}, \texttt{gridtype}, +% \texttt{fltype}, \texttt{align}, \texttt{outlineonly}, \texttt{bgonly}, and \texttt{bgcolor}. The first two are used +% to number the fill lines, the \texttt{color} is to color the fill lines, the last two +% concerning the grid type filler lines. +% \changes{v5.0}{2017/11/08}{Added support for \string\cs{fillTypeGrid}, added keys +% numbers, numbersep, and color as well}\medskip +% +% \noindent\IndexKey{numbers}\hskip-\marginparsep\texttt{=\ameta{\upshape{none\string|left\string|right}}} +% This is a +% \texttt{numbers} is a choice key with possible values of \texttt{none}, \texttt{left} +% and \texttt{right}. It places a line numbering to the left or right of the line, or no line number is used +% if \texttt{none} is selected. +% \begin{macrocode} +\define@choicekey+{eqefillLines}{numbers}[\val\nr]% + {none,left,right}[none]{\ifcase\nr\relax + \let\eqe@numLinesL\relax\let\eqe@numLinesR\relax\or + \let\eqe@numLinesL\eqe@@numLinesL\let\eqe@numLinesR\relax\or + \let\eqe@numLinesL\relax\let\eqe@numLinesR\eqe@@numLinesR + \fi +}{\PackageWarning{aeb}{Bad choice for numbers, permissible values + are none, left, and right. Try again}} +\let\eqe@numLinesL\relax\let\eqe@numLinesR\relax +% \end{macrocode} +% \noindent\IndexKey{numbersep}\hskip-\marginparsep\texttt{=\ameta{dimen}} +% When \texttt{numbers} is either \texttt{left} or \texttt{right}, the separation between +% the line and the number is \texttt{numbersep}. The default value is +% 2pt. +% \begin{macrocode} +\define@key{eqefillLines}{numbersep}[2pt]{% + \setlength{\eqetmplengtha}{#1}% + \edef\eqe@numbersep{\the\eqetmplengtha}} +\def\eqe@numbersep{2pt} +% \end{macrocode} +% \noindent\IndexKey{color}\hskip-\marginparsep\texttt{=\ameta{color-spec}} +% The \texttt{color} key paints the lines the specified color, for example, +% \texttt{color=red!20}. It simply defines \cs{eq@WriteLineColor} to be this color. +% \begin{macrocode} +\define@key{eqefillLines}{color}[]{\def\eq@WriteLineColor{#1}} +% \end{macrocode} +% \noindent\IndexKey{topline}\hskip-\marginparsep\texttt{=\ameta{\upshape{true\string|false}}} +% When \cs{fillTypeGrid} is in effect, \texttt{topline=true} writes +% an additional line above the top most line, this line is not numbered. +% \begin{macrocode} +\define@boolkey{eqefillLines}{topline}[true]{} +\KV@eqefillLines@toplinefalse +% \end{macrocode} +% \noindent \IndexKey{gridtype}\hskip-\marginparsep\texttt{=\ameta{\upshape{line\string|dash\string|dots}}} +% The \texttt{gridtype} key determines the line style for the grid, +% choices are \texttt{line} (the default), \texttt{dash}, and \texttt{dots}. This key also +% sets the line style when the \texttt{outlineonly} key is specified. +% \begin{macrocode} +\let\eqe@usedeffboxrule\eqe@NO % dps20 +\let\gridtypeselected\@empty % dps26 +\define@choicekey+{eqefillLines}{gridtype}[\val\nr]% + {line,dash,dots}[line]{\edef\gridtypeselected{\val}% dps26 + \ifcase\nr\relax + \let\gridHLineFill\eqWriteLineFill + \let\gridVLineFill\eqWriteLineVFill + \or + \let\gridHLineFill\eqWriteLineDashFill + \let\gridVLineFill\eqWriteLineDashVFill + \or + \let\gridHLineFill\eqWriteLineDots + \let\gridVLineFill\eqWriteLineVDots + \let\eqe@usedeffboxrule\eqe@YES %dps20 + \fi +}{\PackageWarning{aeb}{Bad choice for numbers, permissible values + are line, dash, and dots. Try again}} +\let\gridHLineFill\eqWriteLineFill +\let\gridVLineFill\eqWriteLineVFill +% \end{macrocode} +% \noindent\IndexKey{fltype}\hskip-\marginparsep\texttt{=\ameta{\upshape{line\string|dash\string|dots\string|blank}}} +% The \texttt{fltype} key determines the type of line style for the horizontal rendering. This key simply +% executes the various command versions. +% \begin{macrocode} +\define@choicekey+{eqefillLines}{fltype}[\val\nr]% + {line,dash,dots,blank,grid}[line]{\ifcase\nr\relax + \fillTypeHRule\or + \fillTypeDashLine\or + \fillTypeDots + \let\eqe@usedeffboxrule\eqe@YES\or % dps20 + \fillTypeBlankLine\or + \fillTypeGrid\fi +}{\PackageWarning{aeb}{Bad choice for numbers, permissible values + are line, dash, dots, blank, and grid. Try again}} +% \end{macrocode} +% \noindent\IndexKey{align}\hskip-\marginparsep\texttt{=\ameta{\upshape{left\string|default}}} +% Another convenience key, \texttt{align} simply executes the command versions. +% \begin{macrocode} +\define@choicekey+{eqefillLines}{align}[\val\nr]% + {default,left}[default]{\ifcase\nr\relax + \fillerLinesAlignDef\or + \fillerLinesOnLeftMargin\fi +}{\PackageWarning{aeb}{Bad choice for numbers, permissible values + are line, dash, dots, blank, and grid. Try again}} +\define@choicekey*{eqefillLines}{equalcells}[\val\nr]% + {true,false}[true]{\ifcase\nr\relax + \equalCellSizesOn\or + \equalCellSizesOff\fi +} +% \end{macrocode} +% \noindent\IndexKey{outlineonly*}\hskip-\marginparsep\texttt{=\ameta{\upshape{true\string|false}}} +% outlines the work area only, does not create horizontal or vertical lines, other than the lines +% to outline the region. Obeys the \texttt{gridtype} key. +% \changes{v5.0c}{2017/11/18}{Added the outlineonly, bgonly, and bgcolor keys to the +% eqefileLines family.} +% \begin{macrocode} +\define@boolkey{eqefillLines}{outlineonly}[true]{} +\KV@eqefillLines@outlineonlyfalse +\define@choicekey{eqefillLines}{outlineonly*}{true,false}[true]{% dps26 + \@nameuse{KV@eqefillLines@outlineonly#1}% + \def\eqefillLines@outlineonlystar{#1}}% +\let\eqefillLines@outlineonlystar\@empty +% \end{macrocode} +% \noindent\IndexKey{bgonly*}\hskip-\marginparsep\texttt{=\ameta{\upshape{true\string|false}}} +% colors the work area with a color of your choice, see \texttt{bgcolor} below. +% \begin{macrocode} +\define@boolkey{eqefillLines}{bgonly}[true]{} % dps11 +\KV@eqefillLines@bgonlyfalse +\define@choicekey{eqefillLines}{bgonly*}{true,false}[true]{% dps26 + \@nameuse{KV@eqefillLines@bgonly#1}% + \def\eqefillLines@bgonlystar{#1}} +\let\eqefillLines@bgonlystar\@empty +% \end{macrocode} +% \noindent\IndexKey{bgcolor}\hskip-\marginparsep\texttt{=\ameta{color-spec}} +% The color to be used when \texttt{bgcolor} is in force. +% If no color has been assigned, the color will be white. +% \begin{macrocode} +\define@key{eqefillLines}{bgcolor}[]{\def\eqe@BGColor{#1}} % dps11 +\let\eqe@BGColor\@empty +% \end{macrocode} +% \DescribeMacro{\fillLinesNumFmt}\hskip-\marginparsep\darg{\ameta{cmds}} +% is used to specify the format for line numbers. Within the \ameta{cmds} argument, +% use \texttt{\#1} to indicate the placement of the number. For example, the code +% |\fillLinesNumFmt{\textbf{#1}}| puts the line numbers in bold font. +% \begin{macrocode} +\def\fillLinesNumFmt#1{\def\eqe@fillLinesNumFmt##1{\def\flnum{##1}#1}} +\fillLinesNumFmt{\flnum} % set to default values +\define@key{eqefillLines}{numfmt}[]{\fillLinesNumFmt{#1}} % dps21 +\define@key{eqefillLines}{linegap}[14pt]{\def\fl@wlspacing{#1}} % dps21 +\def\fl@wlspacing{14pt} +% \end{macrocode} +% \DescribeMacro{\setFillLinesFmt}\hskip-\marginparsep\darg{\ameta{KV-pairs}} +% Set the format of the fill lines, use the keys from the \texttt{eqefillLines} +% defined and described above. Changes outside a group are global. +% An example of the usage is given here: |\setFillLinesFmt{numbers=left,color=red}|. +% \changes{v5.0}{2017/11/08}{Added \string\cs{setFillLinesFmt}} +% +% Other important notes: To produce horizontal lines only, use \texttt{fltype=line\string|\penalty0dash\string|\penalty0dots}, +% to produce blank space, use \texttt{fltype=blank} and to produce a grid \texttt{fltype=grid}. +% \begin{macrocode} +\newcommand{\setFillLinesFmt}[1]{\def\@rgi{#1}% + \let\eqe@usedeffboxrule\eqe@NO %dps20 + \let\gridtypeselected\@empty + \ifx\@rgi\@empty + \setkeys{eqefillLines}{numbers,numbersep,color, + gridtype,fltype,align}% + \else + \let\is@outlineonly\eqe@NO\let\is@bgonly\eqe@NO + \ifKV@eqefillLines@outlineonly\let\is@outlineonly\eqe@YES\fi + \ifKV@eqefillLines@bgonly\let\is@bgonly\eqe@YES\fi + \setkeys{eqefillLines}{#1}% + \eqWLSpacing{\fl@wlspacing}% + \ifx\makeVgrid\relax + \KV@eqefillLines@toplinefalse +% \forceEqualCellsfalse % dps21 + \equalCellSizesOff % dpsj15 + \ifx\is@bgonly\eqe@YES % carryover from prev prob + \ifKV@eqefillLines@bgonly + \KV@eqefillLines@bgonlyfalse \else - \ifwithinparts - \setlength{\eqetmplengtha}{\labelwidth}% - \setlength{\eqetmplengtha} - {\eqetmplengtha-\eqetmplengthb}% - \setlength{\eqetmplengtha}{\labelwidth}% - \setlength{\eqetmplengtha} - {\eqetmplengtha+\eqetmplengthb}% - \ifx\eq@item\item@part@tabular - \hspace*{\eqetmplengtha}% - \settowidth{\eqetmplengthb}{\eqe@prtsepPrb}% - \setlength{\eqetmplengtha} - {-\labelwidth-\eqetmplengthb}\else - \eqetmplengtha0pt\fi - \else - \eqetmplengtha0pt - \fi + \PackageWarning{eqexam}{You must specify fltype=grid for + bgonly to work.\MessageBreak + Ignoring this key for now}% + \KV@eqefillLines@bgonlyfalse + \let\is@bgonly\eqe@NO + \fi + \else % not continuation + \ifKV@eqefillLines@bgonly + \PackageWarning{eqexam}{You must specify fltype=grid for + bgonly to work.\MessageBreak + Ignoring this key for now}% + \KV@eqefillLines@bgonlyfalse + \let\is@bgonly\eqe@NO + \fi + \fi +% same for outline + \ifx\is@outlineonly\eqe@YES % carryover from prev prob + \ifKV@eqefillLines@outlineonly + \KV@eqefillLines@outlineonlyfalse + \else % dps18 + \PackageWarning{eqexam}{You must specify fltype=grid for + outlineonly to work.\MessageBreak + Ignoring this key for now}% + \KV@eqefillLines@outlineonlyfalse + \let\is@outlineonly\eqe@NO + \fi + \else % not continuation + \ifKV@eqefillLines@outlineonly + \PackageWarning{eqexam}{You must specify fltype=grid for + outlineonly to work.\MessageBreak + Ignoring this key for now}% + \KV@eqefillLines@outlineonlyfalse + \let\is@outlineonly\eqe@NO \fi + \fi + \let\gridHLineFill\eqWriteLine + \let\gridVLineFill\eqWriteLine \else - \if@eqalignfilllinestoleft - \setlength{\eqetmplengtha} - {\eqemargin+\leadinIndentPrtSep}% - \hspace*{-\eqetmplengtha}\else\hspace*{0pt}\fi + \ifx\gridtypeselected\@empty % dps26 + \let\gridHLineFill\eqWriteLineFill + \let\gridVLineFill\eqWriteLineVFill + \fi \fi + \fi +} +% \end{macrocode} +% The next two definitions place line numbers on the left and right, respectively. +% \begin{macrocode} +\def\eqe@@numLinesL{\ifKV@eqefillLines@topline\ifnum\@tempcntb>0 % dps5 + \smash{\llap{\tiny + \eqe@fillLinesNumFmt{\the\@tempcntb}\hglue\eqe@numbersep\relax}}\fi + \else\smash{\llap{\tiny + \eqe@fillLinesNumFmt{\the\@tempcntb}\hglue\eqe@numbersep\relax}}\fi} +\def\eqe@@numLinesR{\smash{\rlap{\tiny + \hglue\eqe@numbersep\relax\eqe@fillLinesNumFmt{\the\@tempcntb}}}} +% \end{macrocode} +% The \cs{fillLinesLineWidth} is a special command used for adjusting the length of +% the horizontal lines, and is used only when \cs{fillTypeGrid} is in effect and when +% \cs{forceEqualCells} is true. +% \begin{macrocode} +\let\fillLinesLineWidth\@empty +% \end{macrocode} +% A switch to signal that a grid has broken across pages. This is only set to true +% when the \texttt{topline=true} is specified through \cs{setFillLinesFmt}. +% \changes{v5.0}{2017/11/08}{Added switch \cs{ifgridpgbrk}} +% \begin{macrocode} +\newif\ifgridpgbrk\gridpgbrkfalse % dps7 +% \end{macrocode} +% \begin{macro}{\vspaceFillerLines}\hskip-\marginparsep\,\darg{\ameta{dimen}} +% This is an internal command, though we declare is publicly. It writes the +% horizontal lines (lines, dots, dashes) when the \env{solution} environment +% uses a \ameta{dimen} to specify space (as opposed to using the \texttt{nLines} key). +% \begin{macrocode} +\newif\ifwriteVertic@lFLines \writeVertic@lFLinestrue % dps16 +\def\fl@set@nnotContStrSkip{\def\@nnotContStrSkip{\vskip6pt}} % dpsj23 +\let\p@ssToFLs\relax +\newif\iffl@firstpass % dps27 +\newcommand{\vspaceFillerLines}[1]{\begingroup\offinterlineskip %dps1 + \global\fl@firstpasstrue % dps27 + \fl@set@nnotContStrSkip % dpsj20 + \p@ssToFLs\if@eqlinedfiller + \def\eqe@next{\vspaceFillerLines@i{#1}}\else + \expandafter\def\expandafter\eqe@next + \expandafter{\expandafter\endgroup\p@ssToFLs}\fi + \global\let\p@ssToFLs\relax\eqe@next} +\def\vspaceFillerLines@i#1{\advance\wlVspace-\flfboxrule % dps25 + \ifx\eqe@usedeffboxrule\eqe@YES\flfboxrule=.4pt\fi % dps20 + \ifKV@eqefillLines@outlineonly\KV@eqefillLines@toplinetrue %dps10 + \KV@eqefillLines@bgonlyfalse % dps11 +% \forceEqualCellsfalse % dpsj15 + \equalCellSizesOff\let\makeVgrid\eqe@makeVgrid\fi %dps10 + \ifKV@eqefillLines@bgonly\KV@eqefillLines@toplinetrue + \KV@eqefillLines@outlineonlyfalse\flfboxrule=.4pt % dps20 +% \forceEqualCellsfalse % dpsj15 + \equalCellSizesOff\let\makeVgrid\eqe@makeVgrid\fi %dps11 + \parindent0pt\relax\parskip0pt + \@tempdima\wlVspace\eqetmplengtha0pt + \@tempcnta=0 \@tempcntb=1 +% \end{macrocode} +% \cs{eqe@fillwidth} is the width of the line, it is \cs{linewidth} plus a fudge factor, which +% is determined dynamically by \cs{eqe@wrtLineKernal}. +% \begin{macrocode} + \def\eqe@fillwidth{\linewidth+\eqetmplengtha}% +% \end{macrocode} +% If we are creating a grid (\cs{fillTypeGrid}), and \cs{forceEqualCells} is true, we modify +% the length of the line to make equal cell sizes. \cs{forceEq@lCells} determines +% the value of \cs{fillLinesLineWidth}. +% \begin{macrocode} + \eqe@wrtLineKernal + \setbox\eqe@tempbox\hbox{\hb@xt@0pt{\hss.\hss}}\ht\eqe@tempbox.33pt + \dp\eqe@tempbox0pt % dps16 + \ifx\makeVgrid\relax +% \forceEqualCellsfalse % dpsj15 + \equalCellSizesOff + \else % dps2 + \let\eqWriteLine\gridHLineFill + \forceEqu@lCells % dps2 + \ifx\flEqu@lLineWidth\@empty\else + \linewidth=\flEqu@lLineWidth\relax\fi + \ifKV@eqefillLines@bgonly\else + \ifKV@eqefillLines@topline\bgroup\@tempcntb=0% dps5 + \makebox[0pt][l]{\eqe@x + \makebox[\eqe@fillwidth]{\eqWriteLine}}\egroup + \fi\fi % dps5 + \fi + \settowidth{\eqetmplengthb}{\eqe@decPointPrb}\def\vfGo@l{#1}% + \ifx\makeVgrid\relax\else + \def\priorPNPAction{\xdef\fl@nRows{\the\@tempcnta}% dps27 + \if@eqalignfilllinestoleft\eqe@x\fi % dpsj12 + \makeVgrid\priorP@geBre@kMsg\global\fl@firstpassfalse}% dps4 + \def\postPNPAction{\global\gridpgbrktrue % dps27 + \setlength{\@tempdima} + {(\vfGo@l+\wlVspace)-\depthtodate}% dps25 + \edef\vfGo@l{\the\@tempdima}\@tempdima=\wlVspace\relax + \@tempcnta=0\relax}% dps18 + \fi + \@whiledim\@tempdima<\vfGo@l\relax\do + {\edef\depthtodate{\the\@tempdima}% + \ifx\eqe@insert@more@content\relax\ifx\makeVgrid\relax + \priorP@geBre@kMsg\fi\fi %dps15 + \eq@insertContAnnot\vskip\wlVspace\eqe@x +% \end{macrocode} +% Draw the horizontal line: a rule, dotted line, dashed line +% \begin{macrocode} + \ifKV@eqefillLines@bgonly\vglue\flfboxrule\else % dpsj11 dpsj21 + \ifKV@eqefillLines@outlineonly\vglue\flfboxrule\else %dps10 + \makebox[0pt][l]{\eqe@numLinesL + \makebox[\eqe@fillwidth]{\eqWriteLine}\eqe@numLinesR}\fi + \fi + \advance\@tempcnta1\relax\advance\@tempcntb1\relax + \edef\depthtodate{\the\@tempdima}% + \addtolength{\@tempdima}{\wlVspace}%\par dps25 +% \end{macrocode} +% At the conclusion of the \cs{do} loop, we insert \cs{makeVgrid}, which +% is either \cs{relax} or is \cs{eqe@makeVgrid}, the latter is a complicated +% command to draw vertical lines across the horizontal ones, and to perform +% other tasks. +% \begin{macrocode} + }\xdef\fl@nRows{\the\@tempcnta}\makeVgrid % dps27 + \ifx\makeVgrid\relax\else %dps15 +% \end{macrocode} +% When there is insufficient space to accommodate the content, we +% place a small blank box in the lower left corner, put a information +% message in the log, and reset the color. +% \changes{v5.1b}{2018/01/24}{Added \string\reset@color} +% \begin{macrocode} + \ifvoid\eqe@nskeyflsplit\else\PackageWarning{eqexam} + {Some material from a solution environment does not\MessageBreak + appear. Increase space allotted}{\normalcolor + \llap{\smash{\rule{5pt}{5pt}}}}\aftergroup + \reset@color\fi % dpsj24 + \fi +% \end{macrocode} +% We conclude by adding some vertical space to better align +% the \env{workarea} environment. When a fill type is used, +% the space created by not be exactly \ameta{dimen} the dimension +% specified. +% \begin{macrocode} + \setlength{\@tempdima}{\vfGo@l-\depthtodate}\vskip\@tempdima +% \vskip\flfboxrule\vskip3pt + \dimen0=\sameVspace\relax + \dimen2=\fboxrule\advance\dimen0by\dimen2 + \xdef\sameVspace{\the\dimen0 }\endgroup + \global\flfrstsplittrue +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\eq@linesXPgs} +% Does the same as \cs{vspaceFillerLines} but is used instead of that command when the optional +% argument for \env{solution} specified a value for \texttt{nLines}. Code comments are the same +% as those just given for \cs{vspaceFillerLines}. +% \begin{macrocode} +\def\eq@linesXPgs{\@tempdimb\wlVspace % dpsj20 + \advance\@tempdimb-\flfboxrule + \@tempdimb=\soln@keys@nLines\@tempdimb + \advance\@tempdimb\flfboxrule + \expandafter\vspaceFillerLines\expandafter{\the\@tempdimb}} +% \end{macrocode} +% \end{macro} +% \cs{eqe@wrtLineKernal}, based on a case analysis, sets the register +% \cs{eqetmplengha} and makes some horizontal glue adjustments as well. +% \begin{macrocode} +%\def\eq@linesXPgs{\@tempdimb\wlVspace +% \@tempdimb=\soln@keys@nLines\@tempdimb +% \expandafter\vspaceFillerLines\expandafter{\the\@tempdimb}} +\def\eqe@wrtLineKernal{\let\eqe@x\relax\let\eqe@y\relax % dpsj9 + \ifx\solutionparshape\@empty % not lead-in + \if@eqalignfilllinestoleft % align on left + \setlength{\eqetmplengtha}{\labelwidth+\eqemargin}% + \setlength{\eqetmplengtha} + {\eqetmplengtha+\eqetmplengthb}% + \ifwithinparts + \ifx\istabularexer\eq@YES % tabular mode + \setlength{\eqetmplengtha}{\prtsIndntSep}% dps27 + \eq@tmplengthA\eqetmplengtha + \def\eqe@x{\hglue-\prtsIndntSep}% dps27 + \ifKV@eqefillLines@outlineonly\let\eqe@y\eqe@x\fi + \else + \settowidth{\eqetmplengtha}{\eqe@prtsepPrb}% + \setlength{\eqetmplengtha}{\eqetmplengtha+\widthOfParts}% dps9 + \setlength{\eq@tmplengthA}{\eqetmplengtha}% dps9 + \def\eqe@x{\hspace*{-\eqetmplengtha}\hglue-\flfboxrule}% dps27 + \fi + \else % not parts, still align left + \def\eqe@x{\hspace*{-\eqemargin}}% + \eqetmplengtha\eqemargin + \eq@tmplengthA\eqemargin + \fi + \else % not lead-in, not align on left + \ifwithinparts + \setlength{\eqetmplengtha}{\labelwidth}% + \setlength{\eqetmplengtha} + {\eqetmplengtha+\eqetmplengthb}% + \ifx\istabularexer\eq@YES % tabular mode + \eqetmplengtha0pt + \eq@tmplengthA\eqetmplengtha % dps27 + \else %dps2 + \def\eqe@x{\hglue-\flfboxrule}% dps4 + \eqetmplengtha0pt + \eq@tmplengthA\eqetmplengtha + \fi + \else % not parts, not align left + \eqetmplengtha0pt + \eq@tmplengthA\eqetmplengtha + \fi + \fi + \else % lead-in + \if@eqalignfilllinestoleft + \setlength{\eqetmplengtha}{\leadinIndentPrtSep}% dps27 + \eq@tmplengthA\eqetmplengtha + \else + \eqetmplengtha0pt + \eq@tmplengthA\eqetmplengtha + \fi + \fi +} +% \end{macrocode} +% \DescribeMacro{\equalCellSizesOn} set the switch \cs{ifforceEqualCells} to true, while +% \DescribeMacro{\equalCellSizesOff}\cs{equalCellSizesOff} sets the same switch to false. +% Additionally, the latter command resets \cs{fillLines\-Line\-Width} to its default value +% of \cs{@empty}. It is therefore important not to use the switch directly, but to use +% these two convenience commands. +% \begin{macrocode} +\newif\ifforceEqualCells +\def\equalCellSizesOn{\global\let\flEqu@lLineWidth\@empty + \global\forceEqualCellstrue} +\def\equalCellSizesOff{\global\let\flEqu@lLineWidth\@empty + \global\forceEqualCellsfalse} +\equalCellSizesOff +% \end{macrocode} +% \cs{forceEqu@lCells} determines the value of \cs{fillLinesLineWidth}. It successively +% adds \cs{wlVspace} until it exceeds \cs{linewidth}, it then subtracts off one \cs{wlVspace} +% to get the value for \cs{fillLinesLineWidth}. +% \begin{macrocode} +\def\forceEqu@lCells{\bgroup + \ifforceEqualCells + \dimen6\wlVspace % reduced from \vspaceFillerLines + \advance\dimen6\flfboxrule + \dimen2=\z@ + \dimen4\linewidth + \advance\dimen4by-\flfboxrule + \if@eqalignfilllinestoleft % dps8 + \advance\dimen4\eq@tmplengthA + \fi + \@tempcnta0 + \@whiledim \dimen2 < \dimen4 \do{% + \advance\@tempcnta1 + \advance\dimen2by\dimen6 + }% + \advance\@tempcnta-1 + \advance\dimen2-\dimen6 + \advance\dimen2\flfboxrule + \advance\dimen2by-\eq@tmplengthA + \xdef\flEqu@lLineWidth{\the\dimen2}% + \fi +\egroup} +\let\eqe@insert@more@content\relax +\def\gobtodot#1.#2\@nil{\def\intPrt{#1}\def\fracPrt{#2}} +% \end{macrocode} +% \DescribeMacro{\eqe@makeVgrid} A command that is executed when the document author expands \cs{fillTypeGrid}. +% The command itself draws vertical rule lines, which intersect with horizontal +% rule lines to form a grid. +% When \cs{fillTypeGrid} is active, \cs{makeVgrid} is \cs{let} +% to \cs{eqe@makeVgrid}. \cs{makeVgrid} appears twice in each of the macros +% \cs{vspaceFillerLines} and \cs{eq@linesXPgs}. The first instance of \cs{makeVgrid} +% draws the vertical line, assuming there is no page break. If there is a page break, +% the second instance of \cs{makeVgrid} continues to draw vertical lines with the correct +% height and number. To make the grid break across a page, the low level command +% \cs{makeRoomForProb} was modified; now prior and post actions (\cs{priorPNPAction} and \cs{priorPNPAction}) +% can be defined. \medskip +% +% \noindent The \cs{dbMrk} is used to debug this portion of the code, view the debugging marks +% by setting \cs{ifeqedb} to true. +% \changes{v5.0a}{2017/11/14}{Placed \cs{eqe@makeVgrid} in a group, \string\cs{count0} +% was leaking out.} +% \begin{macrocode} +\def\dbMrk#1{\textsf{\footnotesize#1}} +\@ifundefined{ifeqedb}{\newif\ifeqedb \eqedbfalse}{} +% \end{macrocode} +% \noindent\DescribeMacro{\fillerCustomBg}\hskip-\marginparsep\darg{\ameta{alt-bg}} +% Add a custom background feature, only available when the key \texttt{bgonly} is active. +% The argument \ameta{alt-bg} uses \texttt{\#1} and \texttt{\#2} to refer to the width +% and height of the work area. Use \DescribeMacro{\resetFillerCustomBg}\cmd{\resetFillerCustomBg} +% to reset the method of coloring the background to its default method. +% \changes{v5.0d}{2017/11/19}{Added a custom background feature} +% \begin{macrocode} +\def\fillerCustomBg#1{\def\fillerBgIm@ge##1##2{#1}} +\def\resetFillerCustomBg{\let\fillerBgIm@ge\@empty} +\resetFillerCustomBg +% \end{macrocode} +% \DescribeMacro{\gridIndentAdj}\hskip-\marginparsep\darg{\ameta{dimen}} is an adjustment +% in the horizontal positioning of the vertical lines of the grid. Under normal +% conditions, \cs{gridIndentAdj} is not needed. If the \env{exam} environment +% is embedded in environments that change some basic parameters, the alignment +% of the grid may not be right, in which case you can use +% \cs{gridIndentAdj} to shift the grid horizontially. +% \begin{macrocode} +\def\gridIndentAdj#1{\def\@rgi{#1}\ifx\@rgi\@empty + \let\gridIndent@dj\relax\else % dps4 + \setlength{\@tempdima}{#1}\edef\gridIndent@dj{\the\@tempdima}\fi} +\let\gridIndent@dj\relax +\def\eqe@makeVgrid{\begingroup + \@tempcnta=\fl@nRows\relax + \advance\wlVspace\flfboxrule % dps25 + \setlength{\@tempdima}{\eqe@fillwidth}% + \setlength{\@tempdimb}{\wlVspace}% + \edef\eqe@tmp{\strip@pt\@tempdimb}% + \expandafter\gobtodot\eqe@tmp.\@nil + \divide\@tempdima by\intPrt\relax + \dimen2=\@tempdima + \dimen4=1pt + \advance\dimen2 by 0.5\dimen4 + \divide\dimen2 by \dimen4 + \multiply\dimen2 by \dimen4 + \edef\eqe@tmp{\strip@pt\dimen2}% + \expandafter\gobtodot\eqe@tmp.\@nil + \advance\@tempcnta-1\relax % dps21 + \multiply\@tempdimb\@tempcnta + \edef\eqe@HOfVrule{\the\@tempdimb}% dps7 + \ifKV@eqefillLines@topline % dps21 + \advance\@tempdimb\wlVspace + \advance\@tempdimb\flfboxrule + \edef\eqe@HOfVruleFrstRow{\the\@tempdimb}% + \def\eqe@setVRule{\vbox + to\eqe@HOfVruleFrstRow\relax{\gridVLineFill}}% dps8 + \else + \def\eqe@setVRule{\vbox + to\eqe@HOfVrule\relax{\gridVLineFill}}% dps8 + \fi + \eqe@tempcnta=0 + \dimen2=\wlVspace + \count4=\intPrt\relax + \setlength{\dimen4}{\eqe@fillwidth}% + \multiply\dimen2by\count4 + \@whiledim \dimen2 > \dimen4 \do{% + \advance\count4by-1\relax + \edef\intPrt{\the\count4 }% + \dimen2\wlVspace + \multiply\dimen2by\count4 + }% + \dimen2\wlVspace + \if@eqalignfilllinestoleft % dps27 + \let\fl@oSmash\smash\let\fl@iSmash\relax + \else + \let\fl@iSmash\smash\let\fl@oSmash\relax + \fi + \fl@oSmash{% + \makebox[0pt][l]{\makebox[\eqe@fillwidth][l]{\fl@iSmash{% dps27 + \ifx\gridIndent@dj\relax\else + \hglue\gridIndent@dj\relax\fi + \eqe@y\ifeqedb\rlap{\dbMrk{D}}\fi % dpsj9 \eqe@y (fudge) + \rlap{\ifeqedb\rlap{\dbMrk{B}}\fi + \ifwriteVertic@lFLines % dps16 + \setlength{\@tempdima}{\eqe@fillwidth}% + \ifKV@eqefillLines@bgonly % dps11 + \ifx\fillerBgIm@ge\@empty + \ifx\eqe@BGColor\@empty\else + \rlap{\textcolor{\eqe@BGColor} + {\rule{\eqe@fillwidth}{\eqe@HOfVruleFrstRow}}}\fi + \else + \rlap{\fillerBgIm@ge{\eqe@fillwidth}{\eqe@HOfVruleFrstRow}}\fi + \else + \dimen2=\wlVspace + \dimen0=0pt + \@whilenum\eqe@tempcnta<\count4\do{\rlap{\hglue\dimen0 + \ifKV@eqefillLines@outlineonly %dps10 + \ifnum\eqe@tempcnta=0 \else\let\gridVLineFill\vfill\fi\fi + \textcolor{\eq@WriteLineColor}{\eqe@setVRule % dps27 + \ifeqedb\rlap{\advance\eqe@tempcnta by1\relax\scriptsize + \raisebox{1pt}{\kern1pt\the\eqe@tempcnta}}\fi}}% + \advance\dimen0by\dimen2 + \advance\eqe@tempcnta by1 + }% dps27 + \fi % dps11 + \advance\dimen2by\flfboxrule + \ifKV@eqefillLines@bgonly\else % dps11 + \rlap{\hglue\@tempdima + \textcolor{\eq@WriteLineColor}{\eqe@setVRule + \ifeqedb\rlap{\thinspace\dbMrk{R}}\fi}}% + \ifKV@eqefillLines@outlineonly %dps10 + \makebox[0pt][l]{\makebox[\eqe@fillwidth]{\eqWriteLine}}%dps10 + \fi + \ifKV@eqefillLines@topline% dps7 + \ifgridpgbrk\@tempdima\eqe@HOfVruleFrstRow\relax % dps21 + \raise\@tempdima\hbox{\makebox[0pt][l]{% + \makebox[\eqe@fillwidth]{\eqWriteLine}}}% + \global\gridpgbrkfalse + \fi + \fi + \fi + \ifx\eqefillLines@outlineonlystar\@empty\else % dps26 + \global\let\eqefillLines@outlineonlystar\@empty + \global\KV@eqefillLines@outlineonlyfalse + \fi + \ifx\eqefillLines@bgonlystar\@empty\else % dps26 + \global\let\eqefillLines@bgonlystar\@empty + \global\KV@eqefillLines@bgonlyfalse + \fi + \fi % ifwriteVertic@lFLines + \eqe@insert@more@content + }% rlap + }% smash (fl@iSmash) +}}}% makeboxes and \fl@oSmash + \endgroup +}% \eqe@makeVgrid +% \end{macrocode} +% In preparation for the \opt{flextended} option, we define several commands and one environment +% that emit a package warning if the \opt{flextended} option is not taken. +% \begin{macrocode} +\def\turnfl@nskeyMsg{\PackageWarning{eqexam} + {You must first take the flextended\MessageBreak + option for this command to have any\MessageBreak effect}} +\def\turnflanskeyOn{\turnfl@nskeyMsg} +\def\priorw@Msg{\PackageWarningNoLine{eqexam} + {The priorworkarea environment does nothing\MessageBreak + without the flextended option. All such content\MessageBreak in these + environments are absorbed}\global\let\priorw@Msg\@empty} +\newenvironment{priorworkarea}{\priorw@Msg + \setbox\eqe@nskeyflsplit\vbox\bgroup} + {\egroup\setbox\eqe@nskeyflsplit\box\voidb@x} +\let\turnflanskeyOff\turnflanskeyOn +\newif\ifflfrstsplit \flfrstsplittrue +\newif\ifeqe@flnosolns \eqe@flnosolnsfalse +\def\turnflnosolnsOn{\eqe@flnosolnstrue\turnflanskeyOn} +\def\turnflnosolnsOff{\eqe@flnosolnsfalse\turnflanskeyOn} +%\let\turnflnosolnsOn\turnflanskeyOn +%\let\turnflnosolnOff\turnflanskeyOn +\newdimen\flfboxrule \flfboxrule=.4pt +\def\tweakBreakPoint#1{\def\@rgi{#1}\ifx\@rgi\@empty + \gdef\twe@kBre@kPoint{0pt}\else + {\setlength{\@tempdima}{#1}% + \xdef\twe@kBre@kPoint{\the\@tempdima}}\fi} +\def\twe@kBre@kPoint{0pt} +% \end{macrocode} +% When \opt{flextended} option is not loaded, we make a minimal definition +% of \cs{eq@b@ddCodeSpecial}. This redefinition is needed when \texttt{bgonly} +% is in effect. +% \begin{macrocode} +\def\eq@b@ddCodeSpecial#1{\if@eqlinedfiller + \ifKV@eqefillLines@bgonly\leavevmode + \vskip-\baselineskip\kern\lineskip\fi\fi#1} +% \end{macrocode} +% For debug, or whatever reason, \DescribeMacro\flSeparateCutNames +% \cs{flSeparateCutNames} gives each flx cut file a distinct +% name. +% \begin{macrocode} +\def\flSeparateCutNames{\def\fl@CutName{flx\fl@Cnt-\jobname.cut}} +% +%<*flextended> +% \end{macrocode} +% \subsection{Utility commands used with the \texttt{flextended} option} +% \begin{macrocode} +\def\fls@vebaselinelineskip{% dps22 + \xdef\flbaselineskip{\the\baselineskip}} +\def\fl@Cnt{0} +\def\fl@CutName{flx-\jobname.cut} +\def\flwriteexsol@fter{% dpsj23 + \ifx\exsolafter\@empty + \immediate\write\verbatim@out{\string\ignorespaces}% dpsj23 + \else + \immediate\write\verbatim@out{\string\exsolafter + \string\space\string\ignorespaces}% + \fi +} +\def\fl@getcontent#1{\begingroup + {\count0=\fl@Cnt\relax + \advance\count0by1\relax + \xdef\fl@Cnt{\the\count0 }}% +% \let\save@wlog\wlog\let\wlog\@gobble +% \let\save@message\message\let\message\@gobble + \global\let\verbatim@out\CommentStream + \immediate\openout\verbatim@out=#1 + \ifwithinparts + \ifx\istabularexer\eq@YES + \immediate\write\verbatim@out{\string\hfuzz\string\hsize}% + \immediate\write\verbatim@out{\string\minipage[t]{\string\hsize}}% + \ifanswerkey + \immediate\write\verbatim@out{\string\expandafter + \string\noindent\string\eqSolnExCmds}% dps23 + \flwriteexsol@fter + \else + \immediate\write\verbatim@out{\string\expandafter + \string\noindent\string\priorWorkAreaCmds + \string\ignorespaces}% dps23 + \fi + \else + \ifanswerkey\flwriteexsol@fter\fi + \fi + \else + \ifanswerkey\flwriteexsol@fter\fi + \fi + \verbatimwrite +} +\def\fl@vsplitandplace#1{% + \iffl@firstpass + \global\setbox\eqe@nskeyflsplit\color@vbox + \normalbaselines + \predisplaypenalty=-50 + \postdisplaypenalty=-50 + \setlength{\hsize}{\eqe@fillwidth}% + \expandafter\noindent % dpsj23 + \ifanswerkey\expandafter\eqSolnExCmds\else + \expandafter\priorWorkAreaCmds\fi + \ignorespaces\input{#1}\fls@vebaselinelineskip + \color@endbox\global\fl@firstpassfalse\fi + \@tempdima\eqe@HOfVrule\relax +% \end{macrocode} +% I'm getting a black box when there is one line left on the second page +% and there is less than one line of text. The following three lines attempt to get +% that last line to appear when there is enough room for it. +% \changes{v5.1c}{2018/01/31}{Added additional lines to get a better break point} +% \begin{macrocode} + \advance\@tempdima\flfboxrule + \advance\@tempdima\lineskip + \ifflfrstsplit\else\advance\@tempdima\wlVspace\fi + \advance\@tempdima\maxdepth + \advance\@tempdima by\twe@kBre@kPoint\relax + \eq@tmplengthB\@tempdima % target height + \splittopskip\wlVspace + \splitmaxdepth\maxdepth + \advance\splitmaxdepth by\twe@kBre@kPoint\relax + \setbox\eq@pointbox=\copy\eqe@nskeyflsplit + \setbox\eqe@nskeyfltop=\vsplit\eq@pointbox to \@tempdima + \setbox\eqe@nskeyfltop=\vbox{\unvbox\eqe@nskeyfltop}% + \ifvoid\eq@pointbox\else + \setlength{\@tempdimb} + {\eq@tmplengthB-\dp\eqe@nskeyfltop}% + \ifdim\@tempdimb<0pt + \@tempdimb=-\@tempdimb + \ifdim\@tempdimb>\maxdepth + \advance\@tempdima-\flbaselineskip\relax + \else + \fi + \else + \setbox\eq@pointbox=\copy\eqe@nskeyflsplit + \advance\@tempdima by\flbaselineskip\relax + \setbox\eqe@nskeyfltop=\vsplit\eq@pointbox to \@tempdima + \setbox\eqe@nskeyfltop=\vtop{\unvbox\eqe@nskeyfltop}% + \setlength{\@tempdimb}{\eq@tmplengthB-\dp\eqe@nskeyfltop}% + \ifdim\@tempdimb<0pt % too much + \advance\@tempdima-\flbaselineskip\relax + \else + \fi + \fi + \fi + \splittopskip\wlVspace + \lineskip1pt + \setbox\eq@pointbox=\copy\eqe@nskeyflsplit + \global\setbox\eqe@nskeyfltop=\vsplit\eqe@nskeyflsplit to \@tempdima + \global\setbox\eqe@nskeyfltop\vtop{\unvbox\eqe@nskeyfltop\vskip0pt}% + \ifvoid\eqe@nskeyflsplit + \ifeqedb\llap{Bot}\fi + \ifeqedb\raise\eqe@HOfVrule\llap{Top}\fi + \ifeqedb\llap{V\qquad}\fi + \ifflfrstsplit\global\flfrstsplitfalse + \ifeqedb\llap{FP\hskip.5in}\fi + \rlap{\raisebox{\eqe@HOfVrule+\flfboxrule+\lineskip} + {\vtop{\vsize=\eqe@HOfVrule\relax + \unvbox\eqe@nskeyfltop\vfil}}}\else + \ifeqedb\llap{SP\hskip.5in}\fi + \rlap{\raisebox{\eqe@HOfVrule+\flfboxrule+\wlVspace+\lineskip} + {\vtop{\vsize=\eqe@HOfVrule\relax + \unvbox\eq@pointbox\vfil}}}% + \global\setbox\eqe@nskeyflsplit\box\voidb@x + \fi + \else + \ifeqedb\llap{Bot}\fi + \ifeqedb\raise\eqe@HOfVrule\llap{Top}\fi + \ifeqedb\llap{nV\qquad}\fi + \ifflfrstsplit\global\flfrstsplitfalse + \ifeqedb\llap{FP\hskip.5in}\fi + \rlap{\raisebox{\eqe@HOfVrule+\flfboxrule+\lineskip} + {\vtop{\vsize=\eqe@HOfVrule\relax + \unvbox\eqe@nskeyfltop\vfil}}}\else + \ifeqedb\llap{SP\hskip.5in}\fi + \rlap{\raisebox{\eqe@HOfVrule+\flfboxrule+\wlVspace+\lineskip} + {\vtop{\vsize=\eqe@HOfVrule\relax +% \end{macrocode} +% To have the filler lines/grid with prior and solution content to space +% more than one page, we unbox \cs{eqe@anskeyfltop} but do not void it. +% \begin{macrocode} + \unvbox\eqe@nskeyfltop\vfil}}}% +% \unvbox\eq@pointbox\vfil}}}% +% \global\setbox\eqe@nskeyflsplit\box\voidb@x + \fi + \fi + \setbox\eq@pointbox\box\voidb@x +% \gdef\twe@kBre@kPoint{0pt}% dpsj21 } % \end{macrocode} -% \begin{macro}{\useFillerLines} -% When used, the vertical space is written with lines (rules, dashes, dots). -%\changes{v2.0e}{2011/03/07} -%{% -% Added the feature of filling the vertical space with ruled lines of -% different types. This feature is available for paper options and for -% \texttt{nosolutions} and \texttt{vspacewithsolution} options. -%} -% \begin{macrocode} -\newcommand{\useFillerLines}{\let\vspaceFiller\vspaceFillerLines - \fillTypeDefault\@eqlinedfillertrue} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\useFillerDefault} -% Resets the vertical space to the original white space. -% \begin{macrocode} -\newcommand{\useFillerDefault}{\let\vspaceFiller\vspaceFillerDefault - \let\eqWriteLine\hfill\@eqlinedfillerfalse} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\fillTypeHRule} -% Writes the line as a solid line (\cs{hrulefill}). -% \begin{macrocode} -\newcommand{\fillTypeHRule}{\let\eqWriteLine\eqWriteLineFill} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\fillTypeDots} -% Writes the line as a dotted line (\cs{dotfill}). -% \begin{macrocode} -\newcommand{\fillTypeDots}{\let\eqWriteLine\eqWriteLineDots} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\fillTypeDashLine} -% Writes the line as a dotted line (\cs{eqdashrulefill}). -% \begin{macrocode} -\newcommand{\fillTypeDashLine}{\let\eqWriteLine\eqWriteLineDashFill} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\fillTypeBlankLine} -% Fills the line -% \begin{macrocode} -\newcommand{\fillTypeBlankLine}{\let\eqWriteLine\eqWriteLineBlankFill} +% +% \subsection{Filler lines with \texttt{answerkey} option} +% +% When using the \opt{flextended} option and the +% \cs{turnflanskeyOn} command, we always use the grid filler type. +% In the case of the basic filler types of line, dash, dots, and blank, +% the code threads passes to \cs{makeVgrid}, but in the case of the +% \opt{answerkey} option, \cs{makeVgrid} writes no vertical lines. Hopefully, +% the spacing between the statement of the question and the solution are then +% consistent. +% \begin{macrocode} +\let\turnfl@nskeyOnOff\relax +% \end{macrocode} +% The \DescribeMacro{\turnflanskeyOn}\cs{turnflanskeyOn} command turns \emph{on} the +% feature of superimposing the solution over the filler lines. Does nothing unless +% the \opt{answerkey} option is in force. +% \begin{macrocode} +\def\turnflnosolnsOn{\eqe@flnosolnstrue} +\def\turnflnosolnsOff{\eqe@flnosolnsfalse} +\def\turnflanskeyOn{% + \def\turnfl@nskeyOnOff{% + \ifanswerkey + \ifx\makeVgrid\relax % already in grid mode, do nothing + \ifwriteVertic@lFLines\KV@eqefillLines@toplinefalse\fi % dps16 + \writeVertic@lFLinesfalse + \let\makeVgrid\eqe@makeVgrid % dpsj5 + \fi % dps17 + \let\eqe@insert@more@content\eqe@insertSolns % dpsj5 + \eqe@flextendedtrue % dps16 + \fillTypeGrid % dps16 + \global\let\eq@insertverticalspace\eq@YES + \global\vspacewithsolnstrue + \fi + }% +} +% \end{macrocode} +% The \DescribeMacro{\turnflanskeyOff}\cs{turnflanskeyOff} command turns \emph{off} the +% feature of superimposing the solution over the filler lines. Does nothing unless +% the \opt{answerkey} option is in force. +% \begin{macrocode} +\def\turnflanskeyOff{% + \def\turnfl@nskeyOnOff{% + \ifanswerkey + \writeVertic@lFLinestrue + \eqe@flextendedfalse + \let\eq@insertverticalspace\eq@NO + \@eqlinedfillerfalse + \global\let\eqe@insert@more@content\relax + \global\let\eq@insertverticalspace\eq@YES + \ifvspacewithsolns\else + \global\vspacewithsolnsfalse\fi + \global\displayworkareafalse + \fi + }% +} +\turnflanskeyOff +% \end{macrocode} +% \begin{macrocode} +\let\p@ssToSolns\relax % dps30 +\def\eqe@insertSolns{\clubpenalty=50 + \widowpenalty=50 \vbadness=10000 + \fl@vsplitandplace{s\fl@CutName}} +\def\eq@b@ddCodeSpecial#1{\global\gridpgbrkfalse % dpsj15 + \global\let\eq@e@ddCodeSpecial\relax + \gdef\eqe@flnexti{#1}% dpsj5 + \if@eqlinedfiller + \ifKV@eqefillLines@bgonly\leavevmode + \vskip-\baselineskip\kern\lineskip\fi % dpsj11 + \ifKV@eqefillLines@outlineonly\leavevmode + \vskip-\baselineskip\kern\lineskip\fi + \ifanswerkey %\turnfl@nskeyOnOff % dps16 + \ifeqe@flextended + \ifcont@nnot + \ifx\makeVgrid\relax + \gdef\p@ssToFLs{\turnfl@nskeyOnOff + \let\eqe@insert@more@content\eqe@insertSolns + \writeVertic@lFLinesfalse + \KV@eqefillLines@toplinefalse + \let\makeVgrid\eqe@makeVgrid + }% + \else + \gdef\p@ssToFLs{\turnfl@nskeyOnOff + \let\eqe@insert@more@content\eqe@insertSolns + \writeVertic@lFLinestrue}% + \fi + \gdef\eqe@flnexti{\turnfl@nskeyOnOff + \global\fl@firstpasstrue % dpsj5 + \p@ssToSolns + \global\gridpgbrkfalse + \eqe@setStartSolns +% \end{macrocode} +% We are with a good two deep, but we need to pass \cs{vspacewithkeyOff}, +% so we save its current state and declare a global call to +% \cs{vspacewithkeyOff}. The state is restored by \cs{eq@e@ddCodeSpecial}. +% \begin{macrocode} + \xdef\kdvsp@SAVE{\ifkeepdeclaredvspacing + true\else false\fi}% + \gdef\kdvsp@Restore{\@nameuse + {keepdeclaredvspacing\kdvsp@SAVE}% + \gdef\twe@kBre@kPoint{0pt}\global + \let\kdvsp@Restore\relax}% dpsj21 + \expandafter\global\vspacewithkeyOff + \vbadness=10000 + \fl@getcontent{s\fl@CutName}}% + \gdef\eq@e@ddCodeSpecial{\endverbatimwrite\endgroup +% \kdvsp@Restore % dpsj20 + \ifwithinparts\ifx\istabularexer\eq@YES + \immediate\write\verbatim@out{\string\endminipage}\fi\fi + \immediate\closeout\verbatim@out + \global\let\eq@e@ddCodeSpecial\relax + }% + \else + \PackageWarningNoLine{eqexam}{For solutions to appear + using filler lines\MessageBreak + (with flextexded and answerkey options),\MessageBreak + you must first expand \string\turnContAnnotOn\MessageBreak + prior to line \the\inputlineno.\MessageBreak + Switching to \string\useFillerDefault}% + \useFillerDefault + \let\eq@insertverticalspace\eq@NO + \fi + \fi + \fi + \fi + \eqe@flnexti +}% dpsj4 +% \end{macrocode} +% \begin{macrocode} +% \end{macrocode} +% \subsection{Filler lines with \texttt{nosolutions} option} +% Just as we can supply filler lines for the \texttt{answerkey} option, we can do the +% same for the \texttt{nosolutions} option and superimpose content on the filler lines. +% \changes{v5.0g}{2017/12/05}{Added filler lines with \string\texttt{nosolutions} option} +% \begin{environment}{priorworkarea} +% \changes{v5.0g}{2017/12/05}{Added the \string\texttt{priorworkarea} environment} +% Place the \env{priorworkarea} environment \emph{prior to} the solution environment. It has not +% arguments, but gets dimensions from the \env{solution} environment that follows. +% \begin{macrocode} +\def\eqe@priorw@content{% + \clubpenalty=50 % dps15 + \widowpenalty=50 + \vbadness=10000 + \fl@vsplitandplace{p\fl@CutName}% +}% +\renewenvironment{priorworkarea}{\par + \ifx\solutionparshape\@empty\else % dps28 + \pushEnvir + \everypar{}\if@eqalignfilllinestoleft\else + \parshape=1 \leadinIndent \linewidth\fi + \popEnvir + \fi + \global\let\p@ssToFLs\relax + \global\let\p@ssToSolns\relax + \vspacewithkeyOff + \ifeq@nosolutions\else\sloppy\fi + \def\eqe@flnexti{\eqSavedComment}% + \ifeqe@flnosolns\ifdisplayworkarea + \def\eqe@flnexti{\fl@getcontent{p\fl@CutName}}\fi\fi % dpsj21 + \gdef\eqe@flnextii{\eqSavedEndCommet}% + \ifeqe@flnosolns\ifdisplayworkarea + \gdef\eqe@flnextii{\endverbatimwrite\endgroup + \ifwithinparts\ifx\istabularexer\eq@YES + \immediate\write\verbatim@out{\string\endminipage}\fi\fi + \immediate\closeout\verbatim@out}\fi\fi + \eqe@flnexti +}{% + \eqe@flnextii + \ifcont@nnot + \ifeqe@flnosolns + \ifdisplayworkarea + \ifx\eq@insertverticalspace\eqe@YES + \ifx\makeVgrid\relax + \gdef\p@ssToFLs{% + \let\eqe@insert@more@content\eqe@priorw@content + \writeVertic@lFLinesfalse + \KV@eqefillLines@toplinefalse + \let\makeVgrid\eqe@makeVgrid}% + \else + \gdef\p@ssToFLs{% + \let\eqe@insert@more@content\eqe@priorw@content + \writeVertic@lFLinestrue}% + \fi + \gdef\kdvsp@Restore{\gdef\twe@kBre@kPoint{0pt}\global + \let\kdvsp@Restore\relax}% dpsj21 + \fi + \fi + \else + \global\setbox\eqe@nskeyflsplit\box\voidb@x + \global\setbox\eqe@nskeyfltop\box\voidb@x + \fi + \else + \PackageWarningNoLine{eqexam}{For priorworkarea to appear + using filler lines\MessageBreak + (with flextexded and nosolutions options),\MessageBreak + you must first expand \string\turnContAnnotOn\MessageBreak + prior to line \the\inputlineno.\MessageBreak + Switching to \string\useFillerDefault}% + \gdef\p@ssToSolns{\useFillerDefault}% + \fi +} % \end{macrocode} -% \end{macro} -% \begin{macro}{\fillTypeDefault} -% Resets fill type back to the default, \cs{hrulefill}. +% \end{environment} % \begin{macrocode} -\newcommand{\fillTypeDefault}{\let\eqWriteLine\eqWriteLineFill} +% end of segment +% +%<*package> % \end{macrocode} -% \end{macro} % Set the \textsf{eqexam} page style, if not otherwise indicated. % \begin{macrocode} \ifeqfortextbook\else @@ -6346,7 +7647,7 @@ % \begin{macrocode} \renewcommand{\setSolnMargins}[1]{% \ifdim\solnGutter=0pt \setlength\eqemargin{#1}\else - \setlength\eqemargin{\solnGutter}\fi} + \setlength\eqemargin{\solnGutter}\fi\ignorespaces} %\newcommand{\defaultSolnIndent}{\gdef\solnGutter{0pt}} \newcommand{\defaultSolnIndent}{\global\solnGutter=0pt} \defaultSolnIndent @@ -6428,9 +7729,9 @@ % \begin{macrocode} \def\prior@parts@hook{% \ifisleadin\else - \writeToSolnFile{^^J\protect\bpartsmrk}\fi}% + \writeT@SolnFile{^^J\protect\bpartsmrk}\fi}% \def\post@parts@hook{% - \writeToSolnFile{\protect\epartsmrk^^J}}% + \writeT@SolnFile{\protect\epartsmrk^^J}}% \def\bpartsmrk{\global\firstitemtrue\begin{eqepartsquestions}}% \def\epartsmrk{\end{eqepartsquestions}\global\firstitemfalse}% % \end{macrocode} @@ -7144,6 +8445,7 @@ % \end{environment} % \end{macro} % \begin{macrocode} +% End of textbook segment % %<*package> % \end{macrocode} @@ -7169,17 +8471,17 @@ \eqequeslistparindent{0pt} \renewenvironment{eqequestions}{% \begin{list}{}{% - \ifwithsoldoc\let\solnItemMngt\eqeSolnItemMngt\fi + \ifwithinsoldoc\let\solnItemMngt\eqeSolnItemMngt\fi \setlength{\labelwidth}{\eqemargin}% \setlength{\parsep}{\eqeques@parsep}% \setlength{\itemsep}{\eqeques@itemsep} \setlength{\topsep}{\eqeques@topsep}% \setlength{\itemindent}{0pt}% - \setlength{\listparindent}{\eqeques@listparindent}%dps% - \ifwithsoldoc\settowidth{\labelsep}{\eqe@hspannerSoln}\else + \setlength{\listparindent}{\eqeques@listparindent}% + \ifwithinsoldoc\settowidth{\labelsep}{\eqe@hspannerSoln}\else \settowidth{\labelsep}{\eqe@hspannerPrb}\fi \setlength{\leftmargin}{\labelwidth}% - }\ifwithsoldoc\global\firstitemtrue\fi\item\relax}{\end{list}} + }\ifwithinsoldoc\global\firstitemtrue\fi\item\relax}{\end{list}} % \end{macrocode} % \begin{environment}{eqepartsquestions} % This environment is used in the SOL file with problems with parts to hang indent @@ -7219,14 +8521,14 @@ \let\fillInFormatDefault\@empty \def\exerSolnsHeadnToc{} \renewcommand{\exerSolnInput}{% - \let\webnewpage\relax + \global\let\webnewpage\relax \ifsolutionsonly\else\immediate\closeout\ex@solns\fi \ifeq@nosolutions\else\newpage % 2012-03-14 \iftherearesolutions\eq@solutionshook\eqsolutionshook \ifsolutionsonly\else\newpage\eq@solutionshook \eqsolutionshook\fi \ifx\webnewpage\relax - \def\webnewpage{\let\webnewpage\newpage}% + \gdef\webnewpage{\global\let\webnewpage\newpage}% \fi \priorexsectitle\exerSolnsHeadnToc\priorexslinput \InputIfFileExists{\jobname.sol}{}{\PackageWarning{exerquiz} @@ -7247,7 +8549,7 @@ % but it not working yet. % \begin{macrocode} \newif\iffrstProbNumShown\frstProbNumShownfalse -\def\tb@insertDecPoint{\ifwithsoldoc\eqedecPointSoln\else +\def\tb@insertDecPoint{\ifwithinsoldoc\eqedecPointSoln\else \eqe@decPointMrg\fi} \newcommand{\eqedsplyOnlyFrst}[2]{\def\thisPart{#2}% \ifx\thisPart\firstPartLtr\global\frstProbNumShowntrue @@ -7331,7 +8633,7 @@ %\end{verbatim} % \begin{macrocode} \newcommand{\wrtChapSolnHead}[1]{% - \writeToSolnFile{% + \writeT@SolnFile{% \protect\preChapSolnHead \protect\chapHeadSolnFmt{\protect\ftbFmtChapter{\thechapter}#1}% \protect\postChapSolnHead @@ -7568,6 +8870,7 @@ % \end{macrocode} % \end{macro} % \begin{macrocode} +% End of textbook segment % %<*ftbsty> % \end{macrocode} @@ -7602,6 +8905,7 @@ % when compiling). I've also defined a special option \texttt{nocustomdesign} which % cancels out the \texttt{usecustomdesign} option. % \begin{macrocode} +% End of ftbsty segment % %<*package> % \end{macrocode} @@ -7708,6 +9012,18 @@ are tiny, scriptsize, footnotesize, small, normalsize, large, Large, LARGE, huge and Huge. Try again}} \def\eq@eqFillin@boxsize{\text{\normalsize\strut}} +% \end{macrocode} +% \changes{v5.1g}{2018/02/14}{Added \string\texttt{fontsize} and \string\texttt{fboxsep} keys} +% \begin{macrocode} +\define@key{eqFillin}{fboxsep}[3pt]{\def\eq@fillin@fboxsep{#1}} +\def\eq@fillin@fboxsep{3pt} +\define@choicekey+{eqFillin}{fontsize}{tiny,scriptsize,footnotesize,% + small,normalsize,large,Large,LARGE,huge,Huge}[normalsize]{% + \def\eq@eqFillin@fontsize{\csname#1\endcsname}% +}{\PackageWarning{eqexam}{Bad choice for boxsize, permissible values + are tiny, scriptsize, footnotesize, small, normalsize, + large, Large, LARGE, huge and Huge. Try again}} +\def\eq@eqFillin@fontsize{\ifmmode\else\normalsize\fi} \define@key{eqFillin}{color}[\eq@fillinColor]{\edef\eq@fillin@color{#1}} % \end{macrocode} % \changes{v3.0x}{2012/04/03}{Added \cs{eqe@align@hfill} to \texttt{align} property. @@ -7877,8 +9193,49 @@ \def\eqe@setfillinDefaults{#1}\fi} \let\eqe@setfillinDefaults\@empty % \end{macrocode} -% \begin{macrocode} -\renewcommand{\fillin}[3][]{\begingroup% +% The \DescribeMacro\fillineol\cs{fillineol} command is used to extend the \cs{fillin} box or line +% to the end of the line. +%\begin{flushleft}\ttfamily +%\quad\string\fillineol*\darg{\ameta{phrase}}[\ameta{opts}]\darg{\ameta{ans}} +% \end{flushleft} +% Normally, \cs{fillineol} is placed at the beginning of a line. The command measures the length +% of \texttt{\darg{\ameta{phrase}}}, subtracts this from \cs{linewidth} and uses this value +% as the width of the underlying \cs{fillin}. When the star-form is used, the \textsf{collectbox} package +% is required; in the star-form, \ameta{phrase} can contain verbatim text. +% \changes{v5.1h}{2018/02/18}{Added \string\cs{mtoeol}} +% \changes{v5.1i}{2018/02/19}{Changed name to \string\cs{fillineol} and changed order of arguments} +% \begin{macrocode} +\AtBeginDocument{\@ifpackageloaded{collectbox} + {\let\eqe@cb\eqe@YES}{\let\eqe@cb\eqe@NO}} +\def\fillineolTooLongMsg{\PackageWarning{eqexam}{% + The 'phrase' you are measuring is longer than\MessageBreak + \string\linewidth. Changing length to 0pt in hopes you\MessageBreak + can fix things}} +\def\fillineolNoCBMsg{\PackageWarning{eqexam}{% + For the \string\fillineol*\space form, the + collectbox package\MessageBreak + is required, but not loaded at this time.\MessageBreak + Switching to \string\fillineol\space in hopes you + load collectbox\MessageBreak + next time or you remove the star-option if not\MessageBreak + really needed}} +\newcommand\fillineol{\@ifstar{\ifx\eqe@cb\eqe@YES + \let\eqe@next\cbfillineol\else + \def\eqe@next{\fillineolNoCBMsg\fillineol@i}\fi + \eqe@next}{\fillineol@i}} +\newcommand{\fillineol@i}[1]{\bgroup\setbox\z@\hbox{#1}\fillineol@ii} +\newcommand\fillineol@ii[2][]{\setlength\eqetmplengthb{\linewidth-\wd\z@}% + \ifdim\eqetmplengthb<0pt\eqetmplengthb0pt\fillineolTooLongMsg\fi + \unhbox\z@\fillin[#1]{\eqetmplengthb}{#2}\egroup} +\newcommand\cbfillineol{\bgroup\collectboxto{\@tempboxa} + {\setlength{\eqetmplengthb}{\linewidth-\wd\@tempboxa}% + \ifdim\eqetmplengthb<0pt\eqetmplengthb0pt\fillineolTooLongMsg\fi + \unhbox\@tempboxa\cbfillineol@i}} +\newcommand\cbfillineol@i[2][]{\fillin[#1]{\eqetmplengthb}{#2}\egroup} +% \end{macrocode} +% We finally begin the \DescribeMacro\fillin\cs{fillin} command. +% \begin{macrocode} +\renewcommand{\fillin}[3][]{\begingroup % \end{macrocode} % \cs{ifsp@expand} is defined in \textsf{spdef} package. This is a version % if \cs{ifsp} that expands correctly in an \cs{edef}. @@ -7897,6 +9254,7 @@ \fi \protected@edef\eq@temp@exp{\noexpand\setkeys{eqFillin}{#1}}% \eq@temp@exp + \fboxsep\eq@fillin@fboxsep\relax % \end{macrocode} % If boxed, we turn underlining off % \begin{macrocode} @@ -7909,8 +9267,10 @@ \ifKV@eqFillin@autolift\def\eq@fillin@lift{-2sp}\fi % \end{macrocode} % Get the second parameter. +% \changes{v5.1h}{2018/02/18}{Added test, 0pt same as empty width} % \begin{macrocode} - \edef\eqe@argii{#2}% + \edef\eqe@argii{#2}\ifx\eqe@argii\@empty\else + \ifdim\eqe@argii=0pt\let\eqe@argii\@empty\fi\fi % \end{macrocode} % We reset \cs{fboxrule} and \cs{fboxsep} as needed. % \begin{macrocode} @@ -7988,8 +9348,9 @@ % If no \texttt{parbox} option and if the second argument is empty, % we set width based on the natural width of \texttt{\#3} % \begin{macrocode} - \settowidth{\eqetmplengthb}{\@eqmath{\eq@fillin@format - \ifKV@eqFillin@boxed\eq@fillintext\fi\eqe@argiii}}% + \settowidth{\eqetmplengthb}{\@eqmath{\eq@eqFillin@fontsize + \eq@fillin@format\ifKV@eqFillin@boxed\eq@fillintext\fi + \eqe@argiii}}% \ifKV@eqFillin@boxed \setlength{\eqetmplengthb}{% \eqetmplengthb+2\fboxsep+2\fboxrule}% @@ -8077,7 +9438,7 @@ \setbox\z@\hbox{\@eqmath{\eq@fillin@boxcmd{% % \eq@fillin@format\ensuremath{\eq@fillin@boxcmd{% \eq@eqFillin@boxsize - \@fillinFmt{% + \@fillinFmt{\eq@eqFillin@fontsize % dpsf0214 \ifKV@eqFillin@boxed \edef\eqe@bw{\eqe@fbox@corr{\eqe@bw}}% \fi @@ -8102,7 +9463,7 @@ % The content is not to be boxed. % \begin{macrocode} \ifmmode\let\@eqmath\ensuremath\else\let\@eqmath\relax\fi - \setbox\z@\hbox{% + \setbox\z@\hbox{\eq@eqFillin@fontsize % dpsf0214 % \end{macrocode} % A value of \texttt{-1sp} signals that \texttt{lift} has not been specified, % nor has \texttt{autofill} been specified. So we use the usual code for underlining. @@ -8144,10 +9505,13 @@ \ifKV@eqFillin@boxed % \mbox{\eq@fillin@format\ensuremath{\boxed{% % \eq@fillin@format\ensuremath{\eq@fillin@boxcmd{% - \setbox\z@\hbox{\@eqmath{\eq@fillin@format + \setbox\z@\hbox{\eq@eqFillin@fontsize % dpsf0214 + \@eqmath{\eq@fillin@format \eq@fillin@boxcmd{\eq@eqFillin@boxsize\ifeq@nosolutions - \rlap{\@eqmath{\eq@fillintext}}\fi - \ifvspacewithsolns\rlap{\@eqmath{\eq@fillintext}}\fi + \rlap{\@eqmath{\eq@eqFillin@fontsize % dpsf0214 + \eq@fillintext}}\fi + \ifvspacewithsolns % dpsf0214 \eq@eqFillin@fontsize + \rlap{\@eqmath{\eq@eqFillin@fontsize\eq@fillintext}}\fi \@fillinFmt{% % \end{macrocode} % We do a similar thing if proofing is not active (\texttt{nosolutions} is taken). @@ -8168,7 +9532,7 @@ % \end{macrocode} % This is the case where the field is \emph{not} boxed. % \begin{macrocode} - \setbox\z@\hbox{% + \setbox\z@\hbox{\eq@eqFillin@fontsize % dpsf0214 \ifdim\eq@fillin@lift=-1sp\relax \@fillinFmt{\makebox[\eqe@bw]{% % \phantom{\@eqmath{\eqe@argiii}} @@ -8235,7 +9599,11 @@ \fi \fi }% - \fi\endgroup\space\ignorespaces} +% \end{macrocode} +% \changes{v5.1d}{2018/02/02}{removed \string\cs{space}\string\cs{ignorespaces} from \string\cs{fillin}} +% Removed |\space\ignorespaces| +% \begin{macrocode} + \fi\endgroup} % \end{macrocode} % \end{macro} % \begin{macro}{\TF} @@ -8256,3 +9624,65 @@ % % \end{macrocode} \endinput + + + +\renewenvironment{solnexer@woparts}[1][]{\gdef\sameVspace{#1}% + \def\eqe@next{\expandafter\solutionFLSAVE\expandafter[#1]}% + \global\gridpgbrkfalse + \if@eqlinedfiller + \ifKV@eqefillLines@bgonly\leavevmode\fi + \ifanswerkey\turnfl@nskeyOnOff % dps16 + \ifeqe@flextended + \def\eqe@next{\vspacewithkeyOff + \vbadness=10000 +% \end{macrocode} +% When conditions are right (\opt{answerkey} is in force and \cs{ifeqe@flextended} is true), +% we take the contents of the \env{solution} environment and place it in the +% box \cs{eqe@anskeyflsplit}. +% \begin{macrocode} + \fl@getcontent + \ifx\exsolafter\@empty\else + \noindent\exsolafter\space\ignorespaces\fi + }% + \fi + \fi + \fi + \eqe@next +}{% + \let\eqe@next\endsolutionFLSAVE + \if@eqlinedfiller + \ifanswerkey + \ifeqe@flextended + \ifcont@nnot + \def\eqe@next{\fls@vebaselinelineskip % dps22 + \egroup % end of \setbox\eqe@nskeyflsplit + \let\exsolafter\@empty + \def\solnsafterSkipAmt{-\baselineskip}% + \expandafter\solutionFLSAVE + \expandafter[\sameVspace]\endsolutionFLSAVE + }% + \else + \PackageWarning{eqexam}{For solutions to appear, + you must first\MessageBreak + expand \string\turnContAnnotOn}% + \fi + \fi + \fi + \fi + \eqe@next +} + + \ifcont@nnot + \def\eqe@next{\fls@vebaselinelineskip % dps22 + \egroup % end of \setbox\eqe@nskeyflsplit + \let\exsolafter\@empty + \def\solnsafterSkipAmt{-\baselineskip}% + \expandafter\solutionFLSAVE + \expandafter[\sameVspace]\endsolutionFLSAVE + }% + \else + \PackageWarning{eqexam}{For solutions to appear, + you must first\MessageBreak + expand \string\turnContAnnotOn}% + \fi diff --git a/texmf-dist/source/latex/eqexam/eqexam.ins b/texmf-dist/source/latex/eqexam/eqexam.ins index 531d24ca..a5fd9e53 100644 --- a/texmf-dist/source/latex/eqexam/eqexam.ins +++ b/texmf-dist/source/latex/eqexam/eqexam.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright 1999-2006 D. P. Story +%% Copyright 2005--2018 D. P. Story %% %% This file is part of the `AcroTeX eDucation Bundle'. %% ------------------------------------------- @@ -17,7 +17,7 @@ %% %% --------------- start of docstrip commands ------------------ %% -\def\filedate{2001/01/22} +\def\filedate{2018/02/19} \def\batchfile{eqexam.ins} \input docstrip @@ -48,6 +48,7 @@ \file{eqalone.def}{\from{eqexam.dtx}{copyright,standalone}} \file{eqtextb.def}{\from{eqexam.dtx}{copyright,textbook}} \file{fortextbook.sty}{\from{eqexam.dtx}{copyright,ftbsty}} + \file{flextended.def}{\from{eqexam.dtx}{copyright,flextended}} \file{eqexam.drv}{\from{eqexam.dtx}{copyright,driver}} } \Msg{***************************************************************} diff --git a/texmf-dist/source/latex/eqexam/script/eqAttach.asp b/texmf-dist/source/latex/eqexam/script/eqAttach.asp deleted file mode 100644 index f87f8b47..00000000 --- a/texmf-dist/source/latex/eqexam/script/eqAttach.asp +++ /dev/null @@ -1,202 +0,0 @@ -<%@ LANGUAGE = VBScript%> -<% -' Copyright 2005 D. P. Story -' All Rights Reserved -' See eqexamman.pdf for some documentation - -' NOTICE: 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. - -' This script is offered "as is", no guarantees are extended. -' eqRecord should be extensively tested on your own system -' until you are satisfied with its functionality and -' reliability. -' -' Note: You need to edit one line below. Search this file for the line that -' contains the string "mySMTP". Replace this string with your SMTP server. - -Response.buffer = True - -Dim DebugTxt, DebugFDF -Dim ErcStatus : ErcStatus = "Problems Reported: " -DebugTxt = False -DebugFDF = False - -' Send FDF file -If DebugTxt Then - Response.ContentType = "text/html" - Response.Write "Debug Info" & "
" -Else - Response.ContentType = "application/vnd.fdf" -End If - -On error Resume Next - -Dim silentMode : silentMode = False -Dim stripPath : stripPath = False - -If Request.QueryString("silent").Count > 0 Then silentMode = True -If Request.QueryString("nopath").Count > 0 Then stripPath = True - -Rem Create an FDF object -Set FdfAcx = Server.CreateObject("FdfApp.FdfApp") -Set FDFout = FdfAcx.FDFCreate - -Rem Parse Incoming Data -Set FDFin = FdfAcx.FDFOpenFromBuf (Request.BinaryRead(Request.TotalBytes)) - -Dim cPDFPath, pos - -If stripPath Then - If DebugTxt Then Response.Write "stripPath is true " & "
" - cPDFPath = FDFin.FDFGetFile - pos = InStrRev( cPDFPath, "/") - If pos <> 0 Then - If DebugTxt Then Response.Write "pos = " & pos & "
" - cPDFPath = Mid(cPDFPath, pos + 1, Len(cPDFPath) - pos ) - If DebugTxt Then Response.Write "cPDFPath = " & cPDFPath & "
" - FDFin.FDFSetFile cPDFPath - End If -End If - -Rem Declare some variables -Dim cBuf -Dim cTime : cTime = Now -Dim eqMail, cMailTo, cMailFrom, cMailSubject -Dim cCourseName, cExam, cStudent, cSID, strMessage, cRetnMsg, eqTab, eqCR -eqTab = chr(9) -eqCR = chr(10) - -' Get Required Info ------------------- -' The only thing we really need is the email address to send this data to -cMailTo = FDFin.FDFGetValue("IdInfo.mailTo") -' cMailFrom = cMailTo - -' Get Optional Info ------ - -On error Resume Next -cCourseName = "" : cCourseName = Trim(FDFin.FDFGetValue("IdInfo.courseName")) - -On error Resume Next -cExam = "" : cExam = Trim(FDFin.FDFGetValue("IdInfo.examName")) - -On error Resume Next -cStudent = "" : cStudent = Trim(FDFin.FDFGetValue("IdInfo.Name")) - -On error Resume Next -cSID = "" : cSID = Trim(FDFin.FDFGetValue("IdInfo.SID")) - -On error Resume Next -cMailFrom = "" : cMailFrom = Trim(FDFin.FDFGetValue("IdInfo.email")) -If Trim(cMailFrom) = "" Then cMailFrom = cMailTo - -On error Resume Next -cMailSubject = "" : cMailSubject = FDFin.FDFGetValue("IdInfo.subject") -If Trim(cMailSubject) = "" Then cMailSubject = "Exam Results: " & cExam & " of " & cCourseName - -On error Resume Next -cRetnMsg = "" : cRetnMsg = Trim(FDFin.FDFGetValue("IdInfo.retnmsg")) - -strMessage = "Summary Information:" -If cCourseName <> "" Then strMessage = strMessage & eqCR & eqTab & "Subject: " & cCourseName -If cExam <> "" Then strMessage = strMessage & eqCR & eqTab & "Title: " & cExam -If cStudent <> "" Then strMessage = strMessage & eqCR & eqTab & "Name: " & cStudent -strMessage = strMessage & eqCR & eqTab & "TimeOfQuiz: " & cTime - -If Trim(cRetnMsg) = "" Then - cBuf = "Exam results successfully sent to your instructor!" -Else - cBuf = cRetnMsg -End If - -If DebugFDF Then cBuf = cBuf & " " & ErcStatus - -If Not silentMode Then FDFout.FDFSetStatus cBuf - -' Construct and send e-mail - -'CDONTS -' Set eqMail = CreateObject("CDONTS.NewMail") 'cdots - -' CDOSYS -Set eqMail = Server.CreateObject("CDO.Message") -eqMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 -eqMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mySMTP" -eqMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 -eqMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 -' eqMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 0 -eqMail.Configuration.Fields.Update - -eqMail.To = cMailTo -' See if there is a comma in the cMailFrom string, if yes, then we have multiple addresses -' that we are sending to. We extract the first e-mail address as the one we will put in -' the eqMail.From address. -position = InStr(1,cMailFrom,",",0) -If position <> 0 Then cMailFrom = Trim(Mid(cMailFrom,1,position-1)) -eqMail.From = cMailFrom -eqMail.Subject = cMailSubject - -' CDOSSYS or CDONTS -eqMail.TextBody = strMessage -' eqMail.Body = strMessage 'cdots - -Dim strTempFile -Dim strTempFolder -Dim strTemp -Dim fso - -Set fso = CreateObject("Scripting.FileSystemObject") -Set strTempfolder = fso.GetSpecialFolder(2) -strTempFile = fso.GetTempName() -strTempFile = left(strTempFile, len(strTempFile)-4) -strTemp = strTempFolder & "\" & strTempFile & ".fdf" -FDFin.FDFSaveToFile strTemp - -If DebugTxt Then Response.Write "strTemp = " & strTemp & "
" - -' CDOSSYS or CDONTS -eqMail.AddAttachment strTemp -' eqMail.AttachFile strTemp 'cdots - -eqMail.Send -Set eqMail = Nothing -' Send back to the browser -Response.BinaryWrite FDFout.FDFSaveToBuf - -' Delete temporary file -fso.DeleteFile strTemp -Set fso = nothing - -FDFin.FDFClose -FDFout.FDFClose -Set FdfAcx = Nothing -Set FDFin = Nothing -Set FDFout = Nothing - -If DebugTxt Then - Response.Write strMessage -End If - -Sub RecordError(field) - If Err.Number <> 0 And DebugFDF Then - ErcStatus = ErcStatus & " "&field&": " & Err.Description - End If - If Err.Number <> 0 And DebugTxt Then - Response.Write "Set Error: "&field&": " & Err.Description & "
" - End If - Err.Clear -End Sub - -Sub ReportError(ByRef localErr) - DebugMsg "Err.Description: ", localErr.Description - DebugMsg "Err.Number: ", localErr.Number - localErr.Clear -End Sub - -Sub DebugMsg(myText, myEval) - If DebugTxt Then Response.Write myText & myEval &"
" -End Sub -%> -- cgit v1.2.3