diff options
author | Karl Berry <karl@freefriends.org> | 2015-05-08 22:18:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-05-08 22:18:17 +0000 |
commit | 1026bf8cf7773dad92367f2ad81598536dd6d3da (patch) | |
tree | bd82d3c14cfd25e7eef91dfc65afb851e93b1bcc /Master/texmf-dist/doc/latex/exam | |
parent | b01c284cd5b49463dc30f117b5b24020a1f8cc7d (diff) |
exam (8may15)
git-svn-id: svn://tug.org/texlive/trunk@37279 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/exam')
-rw-r--r-- | Master/texmf-dist/doc/latex/exam/README | 7 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/exam/exam-2.4.md5 | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/exam/exam.md5 | 3 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/exam/examdoc.pdf | bin | 759577 -> 463915 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/exam/examdoc.tex | 1031 |
5 files changed, 812 insertions, 233 deletions
diff --git a/Master/texmf-dist/doc/latex/exam/README b/Master/texmf-dist/doc/latex/exam/README index 22953c7e7c3..96ea4c3a73a 100644 --- a/Master/texmf-dist/doc/latex/exam/README +++ b/Master/texmf-dist/doc/latex/exam/README @@ -1,4 +1,4 @@ -This is version 2.4 of the exam document class, dated May 22, 2011. +This is version 2.5 of the exam document class, dated May 7, 2015. The exam document class, together with its user's guide examdoc.tex, attempts to make it easy for even a LaTeX novice to prepare exams. @@ -31,7 +31,10 @@ of the page devoted to headers and/or footers to allow for this. ignored (or replaced automatically by space in which the students can write their answers) depending on a single command. -7. Change the words that are inserted by the document class (for, +7. Leave blank space, or space in a box, or lined space, or dotted +lined space, or space filled with a grid. + +8. Change the words that are inserted by the document class (for, e.g., point values, or table headings), so that they can be adapted to personal taste and/or languages other than English. diff --git a/Master/texmf-dist/doc/latex/exam/exam-2.4.md5 b/Master/texmf-dist/doc/latex/exam/exam-2.4.md5 deleted file mode 100644 index a3e4bdda5f8..00000000000 --- a/Master/texmf-dist/doc/latex/exam/exam-2.4.md5 +++ /dev/null @@ -1,4 +0,0 @@ -0d2d621fd3743403fb55f0daa6f98250 exam.cls -b18003beedbf286c01ecff0f0c2211e0 examdoc.tex -54b7a2bb3981c2fe92cbfed8fa930caa examdoc.dvi -b265059c9408d86fdd411e858432c317 examdoc.pdf diff --git a/Master/texmf-dist/doc/latex/exam/exam.md5 b/Master/texmf-dist/doc/latex/exam/exam.md5 new file mode 100644 index 00000000000..e766cadd796 --- /dev/null +++ b/Master/texmf-dist/doc/latex/exam/exam.md5 @@ -0,0 +1,3 @@ +3d7b2787a32cf31f94fce30dbebe6a6d exam.cls +0b79dabd1e74952a1f70abe1909330c2 examdoc.tex +6c10f29d36dd8e009e854721b391fb50 examdoc.pdf diff --git a/Master/texmf-dist/doc/latex/exam/examdoc.pdf b/Master/texmf-dist/doc/latex/exam/examdoc.pdf Binary files differindex d10a923aa10..2193f665a85 100644 --- a/Master/texmf-dist/doc/latex/exam/examdoc.pdf +++ b/Master/texmf-dist/doc/latex/exam/examdoc.pdf diff --git a/Master/texmf-dist/doc/latex/exam/examdoc.tex b/Master/texmf-dist/doc/latex/exam/examdoc.tex index 5cdb3e2d7b1..ac7f927d21c 100644 --- a/Master/texmf-dist/doc/latex/exam/examdoc.tex +++ b/Master/texmf-dist/doc/latex/exam/examdoc.tex @@ -8,7 +8,7 @@ % The exam documentclass itself is in the file exam.cls. -%%% Copyright (c) 1997, 2000, 2004, 2008, 2011 Philip S. Hirschhorn +%%% Copyright (c) 1997, 2000, 2004, 2008, 2011, 2015 Philip S. Hirschhorn % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -49,10 +49,17 @@ % without generating pdf warnings: \newcommand{\bs}{\texorpdfstring{\char`\\}{}} -\newcommand{\docversion}{2.4} -\newcommand{\docdate}{May 22, 2011} +\newcommand{\docversion}{2.5} +\newcommand{\docdate}{May 7, 2015} %\newcommand{\docdate}{\today} +%-------------------------------------------------------------------- +% +% Changes since version 2.4 are described in the comments +% near the beginning of the file exam.cls. +% +%-------------------------------------------------------------------- + \makeindex \newcommand{\indc}[1]{\index{#1@\texttt{\char`\\#1}}} @@ -65,12 +72,6 @@ \newcommand{\indtstart}[1]{\index{#1@\texttt{#1}|(}} \newcommand{\indtstop}[1]{\index{#1@\texttt{#1}|)}} -%-------------------------------------------------------------------- -% -% Changes since version 2.3 are described in the comments -% near the beginning of the file exam.cls. -% -%-------------------------------------------------------------------- %--------------------------------------------------------------------- \newenvironment{example}% {\bigskip\filbreak @@ -127,7 +128,8 @@ Wellesley College\\ Wellesley, MA 02481\\ psh@math.mit.edu\\[\bigskipamount] - Copyright \copyright~1994, 1997, 2000, 2004, 2008, 2011 Philip Hirschhorn\\ + Copyright \copyright~1994, 1997, 2000, 2004, 2008, 2011, 2015 Philip + Hirschhorn\\ All rights reserved} \date{\docdate} @@ -2144,9 +2146,9 @@ section~\ref{sec:BonusTables} for a discussion of the \item If you give the command \verb"\pointsinmargin"\indc{pointsinmargin}, then the points are printed right justified in the left margin, with the right edge a - distance of \verb"\marginpointsep"\indc{marginpointsep} from the + distance of \verb"\marginpointssep"\indc{marginpointssep} from the left edge of the text area. The default value of - \verb"\marginpointsep" is the result of the command + \verb"\marginpointssep" is the result of the command \begin{center} \verb"\setlength{\marginpointssep}{5pt}" \end{center} @@ -2948,7 +2950,7 @@ command\index{indentation!remove}\indc{leftmargin}\indc{labelsep} %-------------------------------------------------------------------- %-------------------------------------------------------------------- -\section{Multiple choice questions} +\section{Multiple choice and fill in the blank questions} \label{sec:MulChc} \index{multiple choice} @@ -3321,7 +3323,175 @@ environment in that example, then you'll get\indc{printanswers} \noprintanswers %-------------------------------------------------------------------- -\subsection{Customizations} +\subsection{Fill in the blank questions} +\label{sec:Fillin} + +\indcstart{fillin} +\index{fill in the blank|(} + +There is a \verb"\fillin" command that prints underlined empty space +for creating ``fill in the blank'' questions. The \verb"\fillin" +command can take two optional arguments: +\begin{itemize} +\item the first optional argument is the answer to the question, which + will be printed above the line when answers are being printed, and +\item the second optional argument is the length of line to be + printed, if you want some length other than the default. +\end{itemize} +If answers are being printed and you supply the answer as the first +(and possibly only) optional argument, then the answer is printed +subject to the declarations in the argument of the most recent +\verb"\CorrectChoiceEmphasis" command. It is centered on the line +unless it is too long, in which case it extends to the right of the +line. The default length of the line and the distance down from the +baseline of the text to the empty line can both be customized (see +section~\ref{sec:CustFillin}). + +For example, if you type +\begin{verbatim} +\begin{questions} + \question \fillin is the color of my true love's hair. +\end{questions} +\end{verbatim} +then you'll get +\begin{questions} + \question \fillin is the color of my true love's hair. +\end{questions} +If, instead, you type +\begin{verbatim} +\begin{questions} + \question \fillin[Black] is the color of my true love's hair. +\end{questions} +\end{verbatim} +then if answers are not being printed you'll get +\begin{questions} + \question \fillin[Black] is the color of my true love's hair. +\end{questions} +and if answers are being printed you'll get +\printanswers +\begin{questions} + \question \fillin[Black] is the color of my true love's hair. +\end{questions} +\noprintanswers + +For another example, if answers are being printed and you type +\begin{verbatim} +\begin{questions} + \question The magic word is \fillin[prestidigitator]. +\end{questions} +\end{verbatim} +then you'll get +\printanswers +\begin{questions} + \question The magic word is \fillin[prestidigitator]. +\end{questions} +\noprintanswers +which shows what happens when the answer is too long for the fillin +line. If, however, you type +\begin{verbatim} +\begin{questions} + \question The magic word is \fillin[prestidigitator][2in]. +\end{questions} +\end{verbatim} +then you'll get +\printanswers +\begin{questions} + \question The magic word is \fillin[prestidigitator][2in]. +\end{questions} +\noprintanswers + +\verb"\fillin" eats (and ignores) space characters appearing before +the first optional argument. It also eats (and ignores) space +characters appearing after the first optional argument and before the +second optional argument. However, if exactly one optional argument +appears, and if there are one or more space characters following that +one optional argument, then those spaces are replaced by a single +space character, but not eaten. +%-------------------------------------------------------------------- +\subsubsection{True/False questions} +\label{sec:truefalse} + +\index{true/false questions|(} +The \verb"\fillin" command can also be used to create True/False +questions. If you give the command +\begin{verbatim} +\newcommand{\tf}[1][{}]{% + \fillin[#1][0.25in]% +} +\end{verbatim} +then you can type +\begin{verbatim} +\begin{questions} + \question \tf[T] The world is all that is the case. + \question \tf[F] My favorite color is blue. +\end{questions} +\end{verbatim} +\newcommand{\tf}[1][{}]{% + \fillin[#1][0.25in]% +} +and if answers are not being printed you'll get +\begin{questions} + \question \tf[T] The world is all that is the case. + \question \tf[F] My favorite color is blue. +\end{questions} +but if answers are being printed then you'll get +\printanswers +\begin{questions} + \question \tf[T] The world is all that is the case. + \question \tf[F] My favorite color is blue. +\end{questions} +\noprintanswers + +\index{true/false questions|)} + +%-------------------------------------------------------------------- +\subsubsection{Customizing the \texttt{\bs fillin} command} +\label{sec:CustFillin} +\index{customization!\texttt{\char`\\fillin}|(} + +You can customize the \verb"\fillin" command by changing +\begin{itemize} +\item the default length of the underlined space, +\item the distance below the text baseline that the line is printed, and +\item the emphasis applied to the answer (when answers are being + printed). +\end{itemize} +The default length of the underlined space is called +\verb"\fillinlinelength"\indc{fillinlinelength}, and its value was set +by the command +\begin{center} + \verb"\setlength\fillinlinelength{1in}" +\end{center} +You can change this by giving a new \verb"\setlength" command. + +The line is printed a distance of +\verb"\answerclearance"\indc{answerclearance} below the baseline, and +its value was set by the command +\begin{center} + \verb"\setlength\answerclearance{0.2ex}" +\end{center} +You can change this by giving a new \verb"\setlength" command. Note: +\verb"\answerclearance" is also used by the \verb"\answerline" command +(see section~\ref{sec:ShortAns}). + +When answers are being printed and you include the optional argument +containing the answer, then the answer is printed subject to the +declarations in the argument of the most recent +\verb"\CorrectChoiceEmphasis"\indc{CorrectChoiceEmphasis} command. +The default situation was created by the command +\begin{center} + \verb"\CorrectChoiceEmphasis{\bfseries}" +\end{center} +and you can change this by giving a new \verb"\CorrectChoiceEmphasis" +command (see section~\ref{sec:MulChceCust}). + +\index{customization!\texttt{\char`\\fillin}|)} +\index{fill in the blank|)} +\indcstop{fillin} + + +%-------------------------------------------------------------------- +\subsection{Customizing the multiple choice environments} \label{sec:MulChceCust} \index{customization!multiple choice questions|(} @@ -3831,23 +4001,25 @@ numbering of the parts or sections. \index{space!for answers|(} \index{answer space|(} -There are four different kinds of space that you can create: +There are five different kinds of space that you can create: \begin{itemize} \item Blank space (see section~\ref{sec:BlankSpace}), \item an empty box (see section~\ref{sec:EmptyBox}), -\item space filled with lines (see section~\ref{sec:FillLines}), and +\item space filled with lines (see section~\ref{sec:FillLines}), \item space filled with dotted lines (see - section~\ref{sec:FillDotLines}). + section~\ref{sec:FillDotLines}), and +\item space filled with a grid (see section~\ref{sec:FillGrid}). \end{itemize} You can also create answer lines for short answer questions (see section~\ref{sec:ShortAns}). -In section~\ref{sec:solutions} we describe four environments for +In section~\ref{sec:solutions} we describe five environments for typing solutions to questions: \begin{itemize} \item \texttt{solution}, \item \texttt{solutionorbox}, -\item \texttt{solutionorlines}, and -\item \texttt{solutionordottedlines}. +\item \texttt{solutionorlines}, +\item \texttt{solutionordottedlines}, and +\item \texttt{solutionorgrid}. \end{itemize} Each of those environments can take an optional argument specifying an amount of space to be created when solutions are not being printed; @@ -4205,6 +4377,191 @@ section~\ref{sec:SolSpace}. \index{dotted lined space|)} \index{space!dotted lined|)} +%-------------------------------------------------------------------- +\subsection{Printing space filled with a grid} +\label{sec:FillGrid} +\index{space!grid|(} +\index{grid space|(} +\indcstart{fillwithgrid} + + +You can fill space with a grid with the command +\begin{center} + \verb"\fillwithgrid{length}" +\end{center} +which fills vertical space of height \texttt{length} with a grid that +runs the length of the current line. That is, it extends from the +current left margin (which depends on whether we're in a question, +part, subpart, or subsubpart) to the right margin. +The default grid size and grid line thickness were set by the +commands +\begin{center} + \begin{tabular}{l} + \verb"\setlength{\gridsize}{5mm}"\\ + \verb"\setlength{\gridlinewidth}{0.1pt}" + \end{tabular} +\end{center} +\index{customization!\texttt{\char`\\fillwithgrid}} You can change +either or both of those by giving new \verb"\setlength" commands. The +period of the grid is \verb"\gridsize" (both horizontally and +vertically). That is, the horizontal distance from the left edge of +one vertical line to the left edge of the next vertical line is +\verb"\gridsize", as is the vertical distance from the top edge of one +horizontal line to the top edge of the next horizontal line. Thus, +each square has outer side length equal to +\verb"\gridsize+\gridlinewidth". + +By default, the created grids are in black. However, if you give the +commands\indc{colorgrids} +\begin{center} + \begin{tabular}{l} + \verb"\usepackage{color}"\\ + \verb"\colorgrids" + \end{tabular} +\end{center} +then the grids will be in color, by default a light gray. That +default color was defined by the +command\indc{definecolor}\indt{GridColor} +\begin{center} + \verb"\definecolor{GridColor}{gray}{0.8}" +\end{center} +\index{customization!\texttt{\char`\\fillwithgrid}} You can change the +color by giving a new \verb"\definecolor" command to redefine the +color \texttt{GridColor}. + + +For example, if you type +\begin{verbatim} +\begin{questions} + \question + In no more than one paragraph, explain why the earth is round. + + \smallskip\fillwithgrid{1in} + + \question + \begin{parts} + \part + What changes to the van Allen radiation belt are needed to make + the earth into a regular icosahedron? + + \smallskip\fillwithgrid{1in} + + \part + Where should the field generator be constructed if you want one of + the vertices to be located at the Royal Observatory at Greenwich? + + \smallskip\fillwithgrid{1in} + + \end{parts} +\end{questions} +\end{verbatim} +then you'll get +\begin{questions} + \question + In no more than one paragraph, explain why the earth is round. + + \smallskip\fillwithgrid{1in} + + \question + \begin{parts} + \part + What changes to the van Allen radiation belt are needed to make + the earth into a regular icosahedron? + + \smallskip\fillwithgrid{1in} + + \part + Where should the field generator be constructed if you want one of + the vertices to be located at the Royal Observatory at Greenwich? + + \smallskip\fillwithgrid{1in} + + \end{parts} +\end{questions} + +If you want to fill the remaining space on the page with a grid, you +should give the commands\indc{stretch} +\begin{center} + \begin{tabular}{l} + \verb"\fillwithgrid{\stretch{1}}"\\ + \verb"\newpage" + \end{tabular} +\end{center} +If you want to equally distribute the space for the answers among +several questions on the page, then just put +\verb"\fillwithgrid{\stretch{1}}"\index{space!allocating} after each +question on the page and use \verb"\newpage" to end the page. You can +also distribute the available space in some other ratio. For example, +to give one of the questions on the page twice as much space as any of +the others, put \verb"\fillwithgrid{\stretch{2}}" after that question, +\verb"\fillwithgrid{\stretch{1}}" after each of the others, and use +\verb"\newpage" to end the page. + +You can also insert a grid only when solutions are not being +printed by including an optional argument with the +\verb"solutionorgrid" environment; see +section~\ref{sec:SolSpace}. + +%-------------------------------------------------------------------- +\subsubsection{Covering every page with a grid} +\label{sec:CoverWGrid} +\index{grid!covering every page} + +If you'd like \emph{every} page to be completely covered by a grid, +with the exam printed right on top of that grid, you can do that by +using a \verb"\fillwithgrid" command in the footer. For this, make +sure you're using either \verb"\pagestyle{headandfoot}" (the default) +or \verb"\pagestyle{foot}" (see section~\ref{sec:pagestyle}), and put +the following into your preamble (i.e., after the +\verb"\documentclass" command and before the \verb"\begin{document}" + command): +\begin{verbatim} +\usepackage{color} +\colorgrids +\newlength{\scratchlength} +\newcommand{\gridfromfoot}{% + \setlength{\scratchlength}{\textheight}% + \addtolength{\scratchlength}{\baselineskip}% + \leavevmode\rlap{\vbox to 0pt{% + \vss + \fillwithgrid{\scratchlength}% + \vspace*{\footskip}% + }% vbox + }% rlap +}% gridfromfoot + +\footer{\gridfromfoot Math 115} + {} + {Page \thepage\ of \numpages} +\end{verbatim} + + +%-------------------------------------------------------------------- +\subsubsection{Printing graph paper} +\label{sec:GraphPaper} + +You can also use the \verb"\fillwithgrid" command to print graph +paper:\index{graph paper} +\begin{verbatim} +\documentclass{exam} +\pagestyle{empty} +\begin{document} + +\fillwithgrid{\stretch{1}} + +\newpage + +\fillwithgrid{\stretch{1}} + +\end{document} +\end{verbatim} + + + +\indcstop{fillwithgrid} +\index{grid space|)} +\index{space!grid|)} + %-------------------------------------------------------------------- \subsection{Short answer questions} @@ -4379,26 +4736,23 @@ while if \verb"\printanswers" is in effect, you'll get \printanswers \subsection{Solution environments} \label{sec:SolEnv} \index{solutions|(} -\index{solution environments|(} +\index{solution environment|(} \index{answers|(} \index{environment!solution|(} \index{environment!solutionorbox|(} \index{environment!solutionorlines|(} \index{environment!solutionordottedlines|(} +\index{environment!solutionorgrid|(} \index{solution environment|(} \index{solutionorbox environment|(} \index{solutionorlines environment|(} \index{solutionordottedlines environment|(} - -There are four environments for typing solutions to the problems. +There are six environments for typing solutions to the problems. These environments all allow you to either print the solutions or omit -them depending on a single command, and they differ only in the type -of space they can leave for students to write their answers when -solutions are not being printed. - -Whether or not solutions are printed is controlled by the two +them with a single command. Whether or not solutions are +printed is controlled by the two commands\indc{printanswers}\indc{noprintanswers} \begin{center} \begin{tabular}{l} @@ -4418,44 +4772,65 @@ that is equivalent to giving the command \verb"\printanswers"\indc{printanswers} at the beginning of the document (see section~\ref{sec:answers}). -There are four environments for printing solutions to the -problems:\indt{solution}\indt{solutionorbox}% -\indt{solutionorlines}\indt{solutionordottedlines} -\begin{center} - \begin{tabular}{rll} - The& \verb"solution"& environment,\\ - the& \verb"solutionorbox"& environment,\\ - the& \verb"solutionorlines"& environment, and\\ - the& \verb"solutionordottedlines"& environment. - \end{tabular} -\end{center} -Each of these can take one optional argument, which is an amount of -space to be left for the students to write their answers when -solutions are not being printed (see section~\ref{sec:SolSpace}). If -you use these environments without any optional arguments, then they -are identical: They print either the solution or nothing at all. The -only differences between these environments are that if this optional -argument is used and solutions are not being printed, -% -then\index{solution environments!optional argument} +The six environments for solutions are divided into two types. \begin{itemize} -\item the \verb"solution" enviroment inserts that amount of blank - space, as if you had given a \verb"\vspace*"\indc{vspace*} command - (see section~\ref{sec:BlankSpace}), -\item the \verb"solutionorbox" environment inserts an empty box of - that height, as if you had given a - \verb"\makeemptybox"\indc{makeemptybox} command (see - section~\ref{sec:EmptyBox}), -\item the \verb"solutionorlines" environment inserts that amount of - space with ruled lines, as if you had given a - \verb"\fillwithlines"\indc{fillwithlines} command (see - section~\ref{sec:FillLines}), and -\item the \verb"solutionordottedlines" environment inserts that amount - of space with dotted lines, as if you had given a - \verb"\fillwithdottedlines"\indc{fillwithdottedlines} command (see - section~\ref{sec:FillDotLines}). +\item The \texttt{solutionorbox} environment (see + section~\ref{sec:solutionbox}) always prints a box, of whatever size + you choose, and if solutions are being printed it prints the + solution inside of the box. +\item Each of the remaining five (see section~\ref{sec:SolSpace}), + \begin{center} + \begin{tabular}{rll} + the& \verb"solution"& environment,\\ + the& \verb"solutionorbox"& environment,\\ + the& \verb"solutionorlines"& environment,\\ + the& \verb"solutionordottedlines"& environment, and\\ + the& \verb"solutionorgrid"& environment, + \end{tabular} + \end{center} + by default prints either the solution or nothing at all. However, + they all can take one optional argument, which is an amount of space + to be left when solutions are not being printed. If you use these + environments without any optional arguments, then they are + identical: They print either the solution or nothing at all. They + differ only in the type of space they leave when you do include the + optional argument and solutions are not being printed. + + + The differences between these five environments are that if the + optional argument is used and solutions are not being printed, + then\index{solution environment!optional argument} + \begin{itemize} + \item the \verb"solution" enviroment inserts that amount of blank + space, as if you had given a \verb"\vspace*"\indc{vspace*} command + (see section~\ref{sec:BlankSpace}), + \item the \verb"solutionorbox" environment inserts an empty box of + that height, as if you had given a + \verb"\makeemptybox"\indc{makeemptybox} command (see + section~\ref{sec:EmptyBox}), + \item the \verb"solutionorlines" environment inserts that amount of + space with ruled lines, as if you had given a + \verb"\fillwithlines"\indc{fillwithlines} command (see + section~\ref{sec:FillLines}), + \item the \verb"solutionordottedlines" environment inserts that + amount of space with dotted lines, as if you had given a + \verb"\fillwithdottedlines"\indc{fillwithdottedlines} command (see + section~\ref{sec:FillDotLines}), and + \item the \verb"solutionorgrid" environment inserts that amount of + space filled with a grid, as if you had given a + \verb"\fillwithgrid"\indc{fillwithgrid} command (see + section~\ref{sec:FillGrid}). + \end{itemize} \end{itemize} +You can use a parts, subparts, or subsubparts environment inside any +of the solution environments without having their points (if any) +counted as actual points on the exam. If there are points assigned to +any of these commands inside any of the solution environments, those +points are not added to the points of the question or the points on +the page, and do not affect any gradetables or pointtables. + + \index{solution environment|)} \index{solutionorbox environment|)} \index{solutionorlines environment|)} @@ -4464,13 +4839,24 @@ then\index{solution environments!optional argument} \index{environment!solutionorbox|)} \index{environment!solutionorlines|)} \index{environment!solutionordottedlines|)} +\index{environment!solutionorgrid|)} %-------------------------------------------------------------------- \subsection{The appearance of the solution} \label{sec:SolAppear} \index{solution!appearance|(} -Solutions can be printed either +The solutions printed by the +\begin{center} + \begin{tabular}{l} + \verb"solution",\\ + \verb"solutionorbox",\\ + \verb"solutionorlines",\\ + \verb"solutionordottedlines", and\\ + \verb"solutionorgrid" + \end{tabular} +\end{center} +environments can be printed either \begin{itemize} \item in a box (i.e., an \verb"\fbox") (see section~\ref{sec:SolBox}; this is the default), @@ -4531,19 +4917,19 @@ section~\ref{sec:answers}), then you'll get \bigskip \end{questions} The result would be exactly the same if that \texttt{solution} environment were replaced by a \texttt{solutionorbox}, -\texttt{solutionorlines} or \texttt{solutionordottedlines} -environment. +\texttt{solutionorlines}, \texttt{solutionordottedlines}, or +\texttt{solutionorgrid} environment. By default, the solution is printed in a box whose width equals that of the text of the current question (or part, or subpart, or subsubpart). That is, the indentation at the left of the solution equals the current level of indentation. You can change this by enclosing the \texttt{solution}, \texttt{solutionorbox}, -\texttt{solutionorlines}, or \texttt{solutionordottedlines} -environment in the argument of a \verb"\fullwidth"\indc{fullwidth} or -\verb"\uplevel"\indc{uplevel} command, or inside of a -\texttt{EnvFullwidth}\indt{EnvFullwidth}% -\index{EnvFullwidth environment}\index{environment!EnvFullwidth} or +\texttt{solutionorlines}, \texttt{solutionordottedlines}, or +\texttt{solutionorgrid} environment in the argument of a +\verb"\fullwidth"\indc{fullwidth} or \verb"\uplevel"\indc{uplevel} +command, or inside of a \texttt{EnvFullwidth}\indt{EnvFullwidth}% +\index{EnvFullwidth environment}\index{environment!EnvFullwidth} or % \texttt{EnvUplevel}\indt{EnvUplevel}\index{EnvUplevel environment}% \index{environment!EnvUplevel}% @@ -4776,11 +5162,11 @@ solution is printed. For the default definition of the \label{sec:SolSpace} \index{space!for answers|(} \index{answer space|(} -\index{solution environments!optional argument|(} +\index{solution environment!optional argument|(} -Each of the \verb"solution", \verb"solutionorbox", -\verb"solutionorlines", and \verb"solutionordottedlines" environments -takes an optional argument: +Each of the \texttt{solution}, \texttt{solutionorbox}, +\texttt{solutionorlines}, \texttt{solutionordottedlines}, and +\texttt{solutionorgrid} environments takes an optional argument: \begin{itemize} \item In a % @@ -4804,13 +5190,19 @@ takes an optional argument: environment this is an amount of lined space to be left (just as if you had used a \verb"\fillwithlines"\indc{fillwithlines} command; see section~\ref{sec:FillLines}) when solutions are not being - printed, and + printed, \item in a\indtsub{solutionordottedlines}{optional argument} \verb"solutionordottedlines" environment this is an amount of dotted lined space to be left (just as if you had used a \verb"\fillwithdottedlines"\indc{fillwithdottedlines} command; see section~\ref{sec:FillDotLines}) when solutions are not being printed. +\item in a\indtsub{solutionorgrid}{optional argument} + \verb"solutionorgrid" environment this is an amount of space to be + filled with a grid (just as if you had used a + \verb"\fillwithgrid"\indc{fillwithgrid} command; see + section~\ref{sec:FillGrid}) when solutions are not being + printed. \end{itemize} For example, if you type \begin{verbatim} @@ -4837,7 +5229,7 @@ you type nothing more.'' \end{solutionorbox} \end{verbatim} -then there will be an emtpy box 2 inches tall inserted (as if you had +then there will be an empty box 2 inches tall inserted (as if you had given the command \verb"\makeemptybox{2in}"; see section~\ref{sec:EmptyBox}) when solutions are not being printed, if you type @@ -4853,8 +5245,8 @@ you type \end{verbatim} then there will be 2 inches of lined space inserted (as if you had given the command \verb"\fillwithlines{2in}"; see -section~\ref{sec:FillLines}) when solutions are not being printed, and -if you type +section~\ref{sec:FillLines}) when solutions are not being printed, if +you type \begin{verbatim} \begin{solutionordottedlines}[2in] Once upon a midnight dreary, while I pondered, weak and weary, Over @@ -4868,6 +5260,20 @@ if you type then there will be 2 inches of dotted lined space inserted (as if you had given the command \verb"\fillwithdottedlines{2in}"; see section~\ref{sec:FillDotLines}) when solutions are not being printed. +and if you type +\begin{verbatim} +\begin{solutionorgrid}[2in] + Once upon a midnight dreary, while I pondered, weak and weary, Over + many a quaint and curious volume of forgotten lore--- While I + nodded, nearly napping, suddenly there came a tapping, As of some + one gently rapping, rapping at my chamber door. ``\,'Tis some + visitor,'' I muttered, ``tapping at my chamber door--- Only this and + nothing more.'' +\end{solutionordottedlines} +\end{verbatim} +then there will be 2 inches of grid inserted (as if you had given the +command \verb"\fillwithgrid{2in}"; see section~\ref{sec:FillGrid}) +when solutions are not being printed. %-------------------------------------------------------------------- @@ -4877,9 +5283,9 @@ section~\ref{sec:FillDotLines}) when solutions are not being printed. \indcstart{nocancelspace} If you've typed any of the environments \texttt{solution}, -\texttt{solutionorbox}, \texttt{solutionorlines}, or -\texttt{solutionordottedlines} (see section~\ref{sec:SolEnv}), and -you've +\texttt{solutionorbox}, \texttt{solutionorlines}, +\texttt{solutionordottedlines}, or \texttt{solutionorgrid} (see +section~\ref{sec:SolEnv}), and you've \begin{itemize} \item included an optional argument to leave space for answers when solutions are not being printed, but @@ -4907,17 +5313,74 @@ solutions are being printed. \emph{Note:} The document class option \texttt{cancelspace} and the command \verb"\cancelspace" only affect the optional arguments of of -the four solution environments; they do \emph{not} affect any +the five solution environments; they do \emph{not} affect any \verb"\vspace" commands that you put into the file. \indcstop{nocancelspace} \indcstop{cancelspace} -\index{solution environments!optional argument|)} +\index{solution environment!optional argument|)} + +%-------------------------------------------------------------------- +\subsection{The solutionbox environment} +\label{sec:solutionbox} +\indt{solutionbox} +\index{solution!in a box} + +The solutionbox environment is different from the other solution +environments (\texttt{solution}, \texttt{solutionorbox}, +\texttt{solutionorlines}, \texttt{solutionordottedlines}, and +\texttt{solutionorgrid}), in that +\begin{enumerate} +\item The box is always printed, whether answers are being printed or + not. +\item The argument giving the size of the box is a required argument, + not an optional argument, and so it should be enclosed in braces, + not in brackets. It can be either a length or + \verb"\stretch{number}". Note: \emph{It is the user's + responsibility to be sure that the box is large enough to hold the + solution!} If the solution takes up too much vertical space, then + it will spill out of the bottom of the box, overwriting whatever + follows the box. +\item The \texttt{solutionbox} environment makes no use of the + \texttt{TheSolution} environment; the \texttt{solutionbox} + environment is completely freestanding. +\end{enumerate} +If answers are not being printed then only the box is printed, with +nothing in it. If answers are being printed, then the solution is +printed inside of the box. + +For example, if you type +\begin{verbatim} +\begin{solutionbox}{2in} + Once upon a midnight dreary, while I pondered, weak and weary, Over + many a quaint and curious volume of forgotten lore--- While I + nodded, nearly napping, suddenly there came a tapping, As of some + one gently rapping, rapping at my chamber door. ``\,'Tis some + visitor,'' I muttered, ``tapping at my chamber door--- Only this and + nothing more.'' +\end{solutionbox} +\end{verbatim} +(note that the amount of space is required, and is typed as +``\verb"{2in}"'', rather than ``\verb"[2in]"'') and solutions are not +being printed, then you'll get +\begin{solutionbox}{2in} + Once upon a midnight dreary, while I pondered, weak and weary, Over + many a quaint and curious volume of forgotten lore--- While I + nodded, nearly napping, suddenly there came a tapping, As of some + one gently rapping, rapping at my chamber door. ``\,'Tis some + visitor,'' I muttered, ``tapping at my chamber door--- Only this and + nothing more.'' +\end{solutionbox} +If solutions \emph{are} being printed, then the exact same box would +be printed, but it would have the solution printed inside of it. + + \index{answer space|)} \index{space!for answers|)} + %-------------------------------------------------------------------- \subsection{Changes depending on whether or not solutions are being printed} @@ -4969,10 +5432,48 @@ something only when answers are not being printed, you'd type {Stuff to appear only when answers are not being printed.} \end{verbatim} + +%-------------------------------------------------------------------- +\subsubsection{Printing only selected solutions} +\label{sec:selectedsolutions} +\index{selected solution} +\index{solution!selected} + +The \verb"\ifprintanswers" command can be used to print only certain +of the solutions in an exam. To do that, you'd put the lines +\begin{verbatim} +\newif\ifprintselected +\printselectedtrue +%\printselectedfalse + +\newenvironment{select} +{\ifprintselected + \printanswers + \fi +} +{} +\end{verbatim} +into your preamble (i.e., after the \verb"\documentclass" command and +before the \verb"\begin{document}" command). That defines a + \texttt{select} environment, in which you can wrap any of the + solution environments, as in +\begin{verbatim} +\begin{select} + \begin{solutionorlines}[1in] + Only when the number is two. + \end{solutionorlines} +\end{select} +\end{verbatim} +As long as you leave the command \verb"\printselectedtrue" +uncommented, then everything wrapped in a \texttt{select} environment +will be printed. If you comment out \verb"\printselectedtrue" and +uncomment \verb"\printselectedfalse", then the \texttt{select} +environment will have no effect. + \indcstop{ifprintanswers} \index{answers|)} -\index{solution environments|)} +\index{solution environment|)} \index{solutions|)} @@ -5215,12 +5716,17 @@ then you'll get \emph{Warning:} If you have a large number of questions on the exam, then these tables can easily become too large to fit on the -page. If this becomes a problem, then you can use the -\verb"\pointsofquestion" command (see section~\ref{sec:pointsofq}) or -the \verb"\pointsonpage" command (see section~\ref{sec:pointsonp}) to -create a custom \verb"tabular" environment that has more rows (or -columns) than the tables produced by the \verb"gradingtable" command. - +page. If this becomes a problem, then you can either +\begin{itemize} +\item create grading ranges (see section~\ref{sec:PartialTable}) and + print several partial grading tables, making each one small enough + to fit on the page, or +\item use the \verb"\pointsofquestion" command (see + section~\ref{sec:pointsofq}) or the \verb"\pointsonpage" command + (see section~\ref{sec:pointsonp}) to create a custom \verb"tabular" + environment that has more rows (or columns) than the tables produced + by the \verb"gradingtable" command. +\end{itemize} \index{grading table!by question number or page number|)} %-------------------------------------------------------------------- @@ -5382,12 +5888,17 @@ then you'll get \emph{Warning:} If you have a large number of questions on the exam, then these tables can easily become too large to fit on the -page. If this becomes a problem, then you can use the -\verb"\pointsofquestion" command (see section~\ref{sec:pointsofq}) or -the \verb"\pointsonpage" command (see section~\ref{sec:pointsonp}) to -create a custom \verb"tabular" environment that has more rows (or -columns) than the tables produced by the \verb"pointtable" command. - +page. If this becomes a problem, then you can either +\begin{itemize} +\item create grading ranges (see section~\ref{sec:PartialTable}) and + print several partial point tables, making each one small enough + to fit on the page, or +\item use the \verb"\pointsofquestion" command (see + section~\ref{sec:pointsofq}) or the \verb"\pointsonpage" command + (see section~\ref{sec:pointsonp}) to create a custom \verb"tabular" + environment that has more rows (or columns) than the tables produced + by the \verb"pointtable" command. +\end{itemize} \index{point table!by question number or page number|)} %-------------------------------------------------------------------- @@ -5423,9 +5934,10 @@ will be clickable links that take you to the corresponding question. %-------------------------------------------------------------------- \subsection{Grading ranges, partial grading tables, and partial point tables} \label{sec:PartialTable} -\index{grading range} +\index{grading range|(} \indcstart{begingradingrange} \indcstart{endgradingrange} +\index{range!grading|(} It is possible to define one or more ``grading ranges'', and then to count the points in a range and create grading tables and point tables @@ -5437,10 +5949,18 @@ command \begin{itemize} \item[] \verb"\begingradingrange{myrange}" at the start of the range and the command -\item[] \verb"\endgradingrange{myrange}" at the end of the range. You - can then use the command -\item[] \verb"\pointsinrange{myrange}", which will expand to the - number of points in the range. +\item[] \verb"\endgradingrange{myrange}" at the end of the range. +\end{itemize} +You can then use the commands +\begin{itemize} +\item \verb"\pointsinrange{myrange}"\indc{pointsinrange}, which will + expand to the number of points in the range, +\item \verb"\firstqinrange{myrange}"\indc{firstqinrange}, which will + expand to the number of the first question in the range, +\item \verb"\lastqinrange{myrange}"\indc{lastqinrange}, which will + expand to the number of the last question in the range, and +\item \verb"\numqinrange{myrange}"\indc{numqinrange}, which will + expand to the number of questions in the range. \end{itemize} You can define as many grading ranges as you like, wherever you like. That is, grading ranges do \emph{not} need to be nested; you can begin @@ -5481,8 +6001,10 @@ section~\ref{sec:BonusTables}) and tabulated by the \verb"\partialcombinedponttable" commands (see section~\ref{sec:BonusTables} and section~\ref{sec:CombinedTables}). +\index{range!grading|)} \indcstop{endgradingrange} \indcstop{begingradingrange} +\index{grading range|)} %-------------------------------------------------------------------- \subsection{\texttt{\bs pointsofquestion}} @@ -6720,8 +7242,11 @@ section~\ref{sec:numpages}.) The \verb"exam" document class defines the command \verb"\numpages"\indc{numpages} so that it will expand to the number -of pages in the exam. Thus, to have the footer \samplefoot{}{}{Page - \thepage\ of \numpages}{} you should either give the command +of pages in the exam. Thus, to have the footer +% +\samplefoot{}{}{Page \thepage\ of \numpages}{} +% +you should either give the command \begin{verbatim} \footer{}{Page \thepage\ of \numpages}{} \end{verbatim} @@ -6736,8 +7261,8 @@ section~\ref{sec:runningfooter}; for a description of the commands \verb"\lfoot", \verb"\cfoot", and \verb"\rfoot", see section~\ref{sec:lfoot}. -Note that if your document has a \texttt{coverpages} environment, then -those pages will not be counted in +Note that if your document has a \texttt{coverpages} environment (see +section~\ref{sec:coverpages}), then those pages will not be counted in % \verb"\numpages"\indcsub{numpages}{doesn't count cover pages}; the \texttt{exam} document class defines the command @@ -6808,11 +7333,12 @@ run the file through \LaTeX{} \emph{twice} to be sure that If you'd like odd and even numbered pages to be treated differently (perhaps because you'll be printing onto both sides of the paper), you -should use the \verb"\oddeven"\indc{oddeven} command. - -The \verb"\oddeven" command takes two arguments. If the current page -number is odd it expands to the first argument; otherwise, it expands -to the second argument. +should use the \verb"\oddeven"\indc{oddeven} command. The command +\begin{center} + \verb"\oddeven{Text 1}{Text 2}" +\end{center} +expands to `Text~1' on odd numbered pages and to `Text~2' on even +numbered pages. For example, to have the page number printed in the right head on odd numbered pages and in the left head on even numbered pages, you should @@ -6854,11 +7380,11 @@ or the commands The \verb"\oddeven"\indcsub{oddeven}{only in headers and footers} command can be used reliably only in headers and footers. This is because \LaTeX{} generally processes more text than can fit on the -current page before it outputs a page. When the \verb"\oddeven" -command is encountered it will act as though it will appear on the -current page whether it will actually be printed on that page or on -the following page; in headers and footers this never creates a -problem. +current page before chooses a page break it outputs a page. When the +\verb"\oddeven" command is encountered it will act as though it will +appear on the current page whether it will actually be printed on that +page or on the following page; in headers and footers this never +creates a problem. \index{odd pages!different from even pages|)} \index{even pages!different from odd pages|)} @@ -6874,98 +7400,41 @@ The exam document class provides the commands \verb"\ContinuedQuestion"\indc{ContinuedQuestion} to enable headers and footers that announce whether the current page is continuing a question begun on an earlier page and, if so, the number of that - question (see section~\ref{sec:ifcontin}). - - There is also a command - \verb"\nomorequestions"\indc{nomorequestions} to mark the point at - which the last question ends, which can be useful if you want to - include supplementary material (e.g., tables or figures) at the end - of the exam but you don't want that material to be described as - continuing the last question (see section~\ref{sec:ifcontin}). -\end{itemize} -The exam class also provides the commands -\begin{itemize} + question (see section~\ref{sec:ifcontin}), and \item \verb"\ifincomplete"\indc{ifincomplete} and \verb"\IncompleteQuestion"\indc{IncompleteQuestion} to enable headers and footers that announce whether the question at the bottom of the current page continues onto the next page and, if so, the number of that question (see section~\ref{sec:ifincomp}). - - The \verb"\ifincomplete"\indc{ifincomplete} command works by looking - for a part, subpart, subsubpart, choice, or CorrectChoice that - starts on a later page. For the rare case when one of those objects - spills onto the following page but none of them start on a following - page, there is also a command - \verb"\addquestionobject"\indc{addquestionobject} that you can - insert at the end of the last object of a question to inform the - \verb"\ifincomplete" command that some object of the question - appears on that following page (see section~\ref{sec:ifincomp}). \end{itemize} -\emph{These commands are only guaranteed to work in headers and - footers.}% +\emph{These commands are only guaranteed to work reliably in headers + and footers.}% \indcsub{ifcontinuation}{reliable only in headers and footers}% -\indc{ContinuedQuestion}{reliable only in headers and footers}% +\indcsub{ContinuedQuestion}{reliable only in headers and footers}% \indcsub{ifincomplete}{reliable only in headers and footers}% -\indcsub{IncompleteQuestion}{reliable only in headers and footers} If you -use any of them elsewhere, they may be fooled by \LaTeX's practice of -typesetting a bit too much material to fit on a page before it chooses -the page break and ships out the page. They also assume that there is -only one \verb"questions" environment in the entire exam. +\indcsub{IncompleteQuestion}{reliable only in headers and footers} If +you use any of them elsewhere, they may be fooled by \LaTeX's practice +of typesetting a bit too much material to fit on a page before it +chooses a page break and ships out the page. They also assume that +there is only one \verb"questions" environment in the entire exam. %-------------------------------------------------------------------- \subsubsection{Questions continuing from the previous page} \label{sec:ifcontin} Headers and footers can announce whether the current page continues a -question begun on an earlier page. - -In more detail: -\begin{itemize} -\item \verb"\ifcontinuation{Text 1}{Text 2}"\\ - \indc{ifcontinuation}Expands to `Text 2' if the first question, - part, subpart, subsubpart, choice, or CorrectChoice that begins on - this page is a question, and to `Text 1' if it's a part, subpart, - subsubpart, choice, or CorrectChoice. It also expands to `Text 1' - if no question, part, subpart, subsubpart, choice, or CorrectChoice - begins on this page and we're not beyond a page with the command - \verb"\nomorequestions" or before the page with question number 1; - otherwise, it expands to `Text2'. - - That is, it expands to `Text 2' if - \begin{itemize} - \item this page precedes the page containing question number 1, - \item this page is later than a page with the - \verb"\nomorequestions" command, or - \item a question begins on this page before any part, subpart, - subsubpart, choice, or CorrectChoice begins, - \end{itemize} - and otherwise it expands to `Text 1'. - -\item \verb"\ContinuedQuestion"\\ - \indc{ContinuedQuestion}If a question begun on an earlier page - continues on the current page, then the command - \verb"\ContinuedQuestion" expands to the number of that question. - - That is, \verb"\ContinuedQuestion" expands to the number of the last - question begun before the current page if either - \begin{itemize} - \item the first question, part, subpart, subsubpart, choice, or - CorrectChoice that begins on the current page is a part, subpart, - subsubpart, choice, or CorrectChoice, or - \item the current page doesn't contain the beginning of any - question, part, subpart, subsubpart, choice, or CorrectChoice. - \end{itemize} - -\item \verb"\nomorequestions"\\ - \indc{nomorequestions}No page following the page on which this - command was given will be considered to continue a question from an - earlier page. Thus, if you give this command after the last - question is complete, then you can include extra material (e.g., - tables for use on the exam) without having those pages labelled as - continuing the last question on the exam. -\end{itemize} - -\medskip +question begun on an earlier page. The command\indc{ifcontinuation} +\begin{center} + \verb"\ifcontinuation{Text 1}{Text 2}" +\end{center} +expands to `Text 1' if the current page begins with a continuation of +a question begun on an earlier page, and to `Text 2' otherwise. If +the current page does continue a question begun on an earlier page, +then the command\indc{ContinuedQuestion} +\begin{center} + \verb"\ContinuedQuestion" +\end{center} +expands to the number of that question. For example, to have the header \samplehead{}{First Exam}{Page 4}{} @@ -6983,41 +7452,78 @@ would give the commands\indc{ContinuedQuestion}\indc{ifcontinuation} (See section~\ref{sec:lhead} for an explanation of \verb"\lhead", \verb"\chead" and \verb"\rhead".) -%-------------------------------------------------------------------- -\subsubsection{Questions that continue onto the next page} -\label{sec:ifincomp} -Headers and footers can announce whether a question continues onto the -next page. -\begin{itemize} -\item \verb"\ifincomplete{Text 1}{Text 2}"\\ - \indc{ifincomplete}Expands to \verb"Text 1" if we have not yet - encountered a \verb"\nomorequestions" command and if the last - question begun on or before the current page has a part, subpart, - subsubpart, choice, or CorrectChoice that begins on a later page. - Otherwise, it expands to \verb"Text 2". - -\item \verb"\IncompleteQuestion"\\ - \indc{IncompleteQuestion}If the last question begun on or before the - current page has a part, subpart, subsubpart, choice, or - CorrectChoice that begins on a later page, then this expands to the - number of that question. + + +The \verb"\ifcontinuation" command figures out which text to use by +checking whether there is a \verb"\question" command appearing on the +page before any of the commands \verb"\part", \verb"\subpart", +\verb"\subsubpart", \verb"\choice", or \verb"\CorrectChoice", and this +works well for most pages. However, the \verb"\ifcontinuation" +command can make mistakes on pages on which none of those commands +appear. The default is to assume that a page with none of those +commands continues a question begun on an earlier page, but there are +two commands you can use to tell the \verb"\ifcontinuation" command +that it should \emph{not} assume that: +\begin{itemize} +\item the \verb"\nomorequestions"\indc{nomorequestions} command can be + used to mark the point at which the last question ends. This can be + useful if you want to include supplementary material (e.g., tables + or figures) at the end of the exam but you don't want that material + to be described as continuing the last question. The + \verb"\nomorequestions" command also tells the \verb"\ifincomplete" + command (see section~\ref{sec:ifincomp}) that all questions are now + complete. +\item The \verb"\noquestionsonthispage" command tells the + \verb"\ifcontinuation" command (and the \verb"\ifincomplete" + command; see section~\ref{sec:ifincomp}) that this page does not + continue a question begun on an earlier page. This is similar to + the job done by the \verb"\nomorequestions" command for the pages + that follow the end of all of the questions. Note that if you're + tempted to use this command on a page that follows the end of all of + the questions, then you should probably use the command + \verb"\nomorequestions" instead. \end{itemize} -For the rare case when a question, part, subpart, subsubpart, choice, -or CorrectChoice spills onto the following page but none of them start -on a following page (and so the \verb"\ifincomplete" command will -mistakenly think that the current question is complete), you can give -the command\indc{addquestionobject} +Thus, in more detail, the command +\verb"\ifcontinuation{Text 1}{Text 2}" +\begin{itemize} +\item expands to `Text 2' if + \begin{itemize} + \item a \verb"\question" appears on this page before any + \verb"\part", \verb"\subpart", \verb"\subsubpart", \verb"\choice", + or \verb"\CorrectChoice", or + \item the command \verb"\noquestionsonthispage" has been given on + this page, or + \item the current page is before the page containing question number + 1, or + \item the current page is later than a page with the + \verb"\nomorequestions" command, + \end{itemize} +\item and otherwise it expands to `Text 1'. +\end{itemize} + + +%-------------------------------------------------------------------- +\subsubsection{Questions that continue onto a later page} +\label{sec:ifincomp} +\indcstart{ifincomplete} + +Headers and footers can announce whether a question on the current +page continues onto a later page. The command\indc{ifincomplete} \begin{center} - \verb"\addquestionobject" + \verb"\ifincomplete{Text 1}{Text 2}" \end{center} -at the end of the last object of a question to inform the -\verb"\ifincomplete" command that some of the question appears on that -following page. - -\medskip +expands to `Text 1' if the last question begun on or before the +current page continues onto a page after this one, and to `Text~2' +otherwise. If the last question begun on or before the current page +does continue onto a later page, then the +command\indc{IncompleteQuestion} +\begin{center} + \verb"\IncompleteQuestion" +\end{center} +expands to the number of that question. For example, to have the footer \samplefoot{\hrule}{}{Question 3 continues\ldots}{} @@ -7034,10 +7540,9 @@ commands\indc{ifincomplete}\indc{IncompleteQuestion}\indc{iflastpage} \begin{verbatim} \footrule \lfoot{} -\newcommand{\continues}{\ifincomplete{\incompletemessage} - {Exam continues\ldots}} -\newcommand{\incompletemessage} - {Question \IncompleteQuestion\ continues\ldots} +\newcommand{\continues}{\ifincomplete + {Question \IncompleteQuestion\ continues\ldots} + {Exam continues\ldots}} \cfoot{\iflastpage{End of Exam}{\continues}} \rfoot{} \end{verbatim} @@ -7045,6 +7550,78 @@ commands\indc{ifincomplete}\indc{IncompleteQuestion}\indc{iflastpage} \verb"\cfoot" and \verb"\rfoot", and section~\ref{sec:lastpage} for an explanation of \verb"\iflastpage"). +There are two situations in which you may have to give an additional +command for the \verb"\ifincomplete" command to correctly decide if +the current question is incomplete: +\begin{enumerate} +\item The \verb"\ifincomplete" command expands to `Text~2' if there is + a \verb"\part", \verb"\subpart", \verb"\subsubpart", \verb"\choice", + or \verb"\CorrectChoice" command belonging to this question on the + following page. For those situations in which the current question + flows onto the next page, but there is no \verb"\part", + \verb"\subpart", \verb"\subsubpart", \verb"\choice", or + \verb"\CorrectChoice" belonging to this question on that page, you + should give the command\indc{addquestionobject} + \begin{center} + \verb"\addquestionobject" + \end{center} + at the end of the text of the question to inform the + \verb"\ifincomplete" command that some portion of the question + appears on that following page. + +\item If there are pages on which none of those commands appear, the + default is to assume that that page continues a question begun on an + earlier page. There are two commands that you can use to tell the + \verb"\ifincomplete" command that it should \emph{not} assume that: + \begin{itemize} + \item the \verb"\nomorequestions"\indc{nomorequestions} command can + be used to mark the point at which the last question ends. This + can be useful if you want to include supplementary material (e.g., + tables or figures) at the end of the exam but you don't want the + last question on the exam to be described as incomplete. The + \verb"\nomorequestions" command also tells the + \verb"\ifcontinuation" command (see section~\ref{sec:ifcontin}) + that all questions are now complete. + \item The \verb"\noquestionsonthispage"\indc{noquestionsonthispage} + command tells the \verb"\ifincomplete" command (and the + \verb"\ifcontinuation" command; see section~\ref{sec:ifcontin}) + that this page does not contain any incomplete questions, and does + not continue a question begun on an earlier page. This is similar + to the job done by the \verb"\nomorequestions" command for the + pages that follow the end of all of the questions. Note that if + you're tempted to use this command on a page that follows the end + of all of the questions, then you should probably use the command + \verb"\nomorequestions" instead. + \end{itemize} +\end{enumerate} +If you give the command +\verb"\noquestionsonthispage"\indc{noquestionsonthispage} on a page, +then +\begin{itemize} +\item an \verb"\ifcontinuation"\indc{ifcontinuation} command on that + page will expand to its second argument, +\item an \verb"\ifincomplete" on that page will expand to its second + argument, and +\item an \verb"\ifincomplete" command on an earlier page will not + assume that a question from that earlier page continues onto this + page. +\end{itemize} +The way that this command affects the \verb"\ifincomplete" command on +earlier pages is as follows: If there is a page with no +\verb"\question", \verb"\part", \verb"\subpart", \verb"\subsubparts", +\verb"\choice", \verb"\CorrectChoice", or +\verb"\addquestionobject"\indc{addquestionobject} commands, then the +last page before that with a \verb"\question" (or \verb"\part", etc.) +would normally be deemed to have an incomplete question; if, however, +the page with no \verb"\question" (or \verb"\part", etc.) (along with +all adjacent pages with no \verb"\question" or \verb"\part" etc.) has +a \verb"\noquestionsonthispage" command, then that last page with a +\verb"\question" (or \verb"\part", etc.) will not be deemed +incomplete. + + +\indcstop{ifincomplete} + \index{questions!that span multiple pages|)} %-------------------------------------------------------------------- |