%    examexample.tex    Example for an exam in Latex suitable for
%    GRTEX
%       copyright 1993 by Joel A. Shapiro
%       copyright (c) 1996 by Joel A. Shapiro
%       undernote and mvaquest added, Nov 1996, JaS
%       many addtions to include numerical questions, Oct 2003, JaS
%
\documentstyle[12pt]{article}
%
\input exammac
% If you want the pages numbered, uncomment the next line. default no numbers
% \pagesnumberedtrue
%
% If you want to see the comments in attribution and explanation, which 
%   should NOT appear on a real exam, uncomment the line below. See Q34
\realexamfalse   % Note: I have uncommented it already. insert % to recomment.
%   If, for some reason, you want one of attrib and explain without the
%   other, you can define \attrib or \explain AFTER the input exammac2 line.
%
% The default style is two columns in landscape mode. If you want one
% column in portrait mode, uncomment the \twocolumnfalse statement
% below. Dimensions are set in exammac2, and can be overwritten after
% the \input exammac2 line
%
% \twocolumnfalse
% if you want two column in portrait, or one column in landscape, you
% need to change the \iftwocolumn statement after \begin{document}
%
\input exammac2
\begin{document}
\iftwocolumn\special{papersize=11in,8.5in}\fi
% 
% The next %% line has to appear exactly as it is, after the part of the
% header which should appear only once and before those things which
% need repeating on each version of the exam.
%%End of header
\ifpagesnumbered   \setcounter {page}{1} \fi
%
% enter your cover page material here, if you want one.
\def\ie{\hbox{\it i.e.\ }}     \def\etc{\hbox{\it etc.\ }}
\begin{center}
\Large
Writing Exams in (La)\TeX\\
for use with GRTEX\\
Joel A. Shapiro\\
\normalsize March 23, 1997\\
 Copyright \copyright\ 1993, 1995, 1997, 2003 by Joel A. Shapiro
\end{center}
\bigskip
\noindent\hbox to 0pt{\hss 1.\quad}%
These are instructions for preparing exams in latex (or tex) in a way
which will be compatible with the program GRTEX, which makes multiple
versions, each containing selected questions with the questions and/or
answers in permuted orders. But these instructions are formatted to look
like an exam.

\noindent\hbox to 0pt{\hss 2.\quad}%
That way, the input for this file, called {\tt examexample.tex}, can
serve as an example as well as serving as instructions.  You can copy
{\tt examex.template}, which is a template into which you can insert your
own material.

\noindent\hbox to 0pt{\hss 3.\quad}% 
You will see that the format provides several options for the style of
questions, both with and without accompanying figures. One way to
learn how to make an exam to your liking is to examine this example,
select the styles you want to use, copy this file and change the text
to say what you want.

\noindent\hbox to 0pt{\hss 4.\quad}% 
You can also change from two column to one column, portrait style, by 
uncommenting the indicated line (see the source file). To print this
file as a source file, type  {\tt enscript -G examexample.tex} (on a Sun,
or whatever you use to print an ordinary ASCII file on other machines)
rather than \LaTeX ing it. Another option you can choose is to have
the pages numbered, by uncommenting a different line. 

\noindent\hbox to 0pt{\hss 5.\quad}%  
You will need a question file in a format
like this one, which is suitable for \TeX ing or \LaTeX ing.
It is also suitable for {\tt grtex} when taken together with a 
{\it want} file, which contains information for GRTeX such as which
questions will be used and the style of permutation. 
The {\it want} file is described in detail in the GRTeX writeup.
% \footnote{I need to add more detailed references, as well as
% making better ones}. 
The program {\tt grtex} will ask you for the names of 
these files and of the output files, one of which can then be \TeX ed or 
\LaTeX ed, and the other of which is an answer key input to {\tt GRAD} or 
{\tt grfix}.
\eject

\begin{center}
$\Rightarrow$\hbox to 4in{\vrule height 1.25in\vbox to 1.25in{\hsize=4.0in
  \hrule width 4in\vfil
\phantom{a}  \hfil Your name sticker with {\bf exam code} \hfil \phantom{a}
  \vfil
  \hrule width 4in}
    \hss \vrule height 1.25in}$\Leftarrow$
\end{center}
\vskip .20in

\noindent\hbox to 0pt{\hss 6.\quad}% 
Most instructors like to have a cover page, and not have any exam
problems on the first sheet. This leaves room for a page
of instructions and a page of formulas and constants. In two column
style, I call each column a page. To deliberately end the page, as I
did after item 5, use {\tt $\backslash$eject} or 
{\tt $\backslash$vfill$\backslash$eject}. To make sure to end the
whole side, even in two column mode, use 
{\tt $\backslash$clearpage} instead.


\noindent\hbox to 0pt{\hss 7.\quad}%
Please note that \TeX, \LaTeX, and emacs cannot 
be used directly on encrypted
files. Unfortunately this means that the input and output will, at
least temporarily, be on the disk in cleartext on the computer. Be
very careful that exam files are secret in a subdirectory that is
secret. They can be encrypted at all times except just around the \TeX
ing and the printing. 

\noindent\hbox to 0pt{\hss 8.\quad}%
This file requires \LaTeX\ and calls on the 
files  {\tt epsf.tex},\\
{\tt exammac.tex} and {\tt exammac2.tex}, which
must be in the path searched by \LaTeX. On the public Suns
this should be the case without your taking any action.

\noindent\hbox to 0pt{\hss 9.\quad}%
The path to what is described here 
%available question formats are introduced 
starts with ``Question'' 1.
this included available question formats, rules for a good \LaTeX\ or 
\TeX\ file, database use, and how to get started.


\bigskip

$$\hbox{Elementary charge}~e = 1.6 \times 10^{-19}~\hbox{C},\qquad
\hbox{Electron charge} = -e.$$
$${1\over 4\pi \epsilon_0} = 9 \times 10^9~{\rm N\cdot m^2/C^2},
  \qquad \epsilon_0 = 8.85 \times 10^{-12}~{\rm C^2/N\cdot m}$$
Mass of electron $= 9.11 \times 10^{-31}$ kg\\
Mass of proton $= 1.67 \times 10^{-27}$ kg\\
1 electron volt (eV)  $= 1.6 \times 10^{-19}$ J


% end of header page material
% comment out one of the two next commands
\clearpage    % if you do not want questions appearing on same page 
              % with parts of the header, especially in two-column mode
% \vfill\eject  % if you don't mind if header page on left and quests on right

% enter your exam questions here.

\setup{1}{1}%
{The sections of these instructions are to be found as follows}
{Instructions for writing individual questions: ``Question'' 4}
{Instructions for the {\tt grtex} input question file: ``Question''
  24}
{References to other documentation on {\tt grtex}, {\tt grad}, {\tt
    grek}, {\it etc}.: ``Question'' 37}
{Suggestions for maintaining a database of questions: ``Question'' 33}
{Suggestions for getting started: The ``tail'' after ``Question'' 37}
\stdquest

\setup{2}{1}%
{The programs {\tt grtex, gread, grfix, and grad} currently (Oct, 2009) 
support two kinds of exams. The traditional exam form permits up to 100
multiple choice questions. The newer form permits up to 15 numerical
answer questions and up to 30 multiple choice questions.
\gdef\undernote{Finally we have some comments on things you can insert into
all questions, starting with ``Question'' 32.}}
{The mark-sense forms for multiple choice questions and for numerical
  answer questions are totally different}
{Multiple choice questions are discussed beginning with ``Question''
  4}
{Multiple choice with accompanying pictures start with ``Question''
  11}
{Multiple choice with answer choices {\bf on the pictures} start with
 ``Question'' 22}
{Numerical answer questions are discussed starting with
 ``Question'' 28}
\stdquest
 
\setup{3}{1}
{All of the questions on the exam must appear together, with no intermediate
  material, although there can be material before all the questions and
  after all the questions.  Each question is a separate
  paragraph, that is, there is at least one blank line before and
  after each question.}
{MC next}
{MC pictures at 11}
{numerical at 28}
{file format at 24}
{}
\ivlquest

\setup{4}{4}   %This is{ a comment
{\gdef\undernote{$\dagger$\ Well, certainly not the second and
    third. But the answers should start with a \{ in column 1.
    What the true restrictions are needs to be clarified.\\
    $*$ As of June, 1996, tex comments between arguments within questions were
    causing some problems.}
  Each of the multiple-choice questions must be given in a very particular
  form, with exactly the eight components described below. Each
  must start in the first column of a new line${}^\dagger$.  
  Comments may be placed
  as desired.${}^*$ 
Each question appears as follows:}%
{The \TeX\ command {\tt $\backslash$setup} with argument \#1 containing
  the question number and \#2 the correct answer: \\
  {\tt $\backslash$setup\{27\}\{2\}}.  The initial  $\backslash$
  must be placed in column 1.}%
{The question, enclosed in braces.
    If the question takes more than one line, it is recommended that following
  lines in the source code be indented for clarity.
  The final brace should be followed by 
  a \% and a newline.}%  Another comment }
{Five answers, enclosed in braces, with the opening 
  brace in column 1.  An argument's closing \} must be followed by
  a newline.}%
{A \TeX\ command of the form $\backslash$xxx{\tt quest}, possibly followed by 
  arguments, with the initial $\backslash$ in column 1.}%
{It is essential that the setup have exactly 8 arguments, and that
  there be no intermediate spaces or other material (even commented out 
  material) between them.
  The meanings of the arguments are given in the next question.
  The choices of $\backslash$xxxquest are given in the question after that.}%
\stdquest
%This is another comment.

\setup{5}{3}
{The arguments to the {\tt $\backslash$setup} macro are}
{\#1 is a number (integer) identifying the question in the ``want''
  file. It will be replaced by GRTEX with the number to appear as the 
  question number on the exam. }%
{\#2 is the correct answer, one of 1, 2, 3, 4, or 5}%
{\#3 is the text of the question, which may include any \TeX\ or
  \LaTeX\ code which makes sense. In all styles of question, this is set above
  the answers.}%
{\#4--\#8 are the five answers, without a leading letter or number.
  There must be five arguments here even if you use a question format
  with fewer answer choices.}%
{}
\fourquest

\setup{6}{5}
{\gdef\undernote{But in Nov.~1996 I added {\tt $\backslash$mvaquest}
  and {\tt $\backslash$lmvaquest}, and in Jan.~2003, I added the
    numerical question styles {\tt numquest}, \break
    {\tt numsidepix}, and {\tt numbotpix}}%
The first question was of the form {\tt $\backslash$stdquest},
  which has no attached figure, has the question statement set above
  the answers, which are in an itemized list below the question. 
  So was Question \#4, but that one also had a footnote added with an {\tt
    undernote}, a feature added Nov.~'96 to all forms of questions,
  and explained in question 32 below.
 Question  \#5 used {\tt $\backslash$fourquest}, which is the same
  thing except the student is presented with only four answers. I
  don't encourage this, but it is available. The other forms of
  question available on May 11, 1993 were}%
{\quad{\tt $\backslash$lilquest}}%
{\quad{\tt $\backslash$ivlquest}}%
{\quad{\tt $\backslash$pixquest}}%
{\quad{\tt $\backslash$lpixquest}}%
{\quad{\tt $\backslash$fpixquest}}%
\stdquest

\setup{7}{4}
{This is an example of {\tt lilquest}. \\
  Two large parallel conducting plates are 10 cm apart and carry equal but
  opposite charges on their facing surfaces.  An electron placed midway
  between the plates experiences a force of $3.2 \times 10^{-17}$ N.
  The potential difference between the plates is}%
{2000 V}%
{200 V}%
{40 V}%
{20 V}%
{10 V}%
\lilquest

\setup{8}{1}
{Two capacitors have capacitances of $7\mu$F and $5\mu$F respectively.
  They are connected in parallel to a battery.  After the battery has 
  charged them, the $7\mu$F-capacitor has a stored energy of 
  $2.24 \times 10^{-4}$ J.  What is the charge on the {\bf other} 
  capacitor, i.e. the $5\mu$F-capacitor?}%
{$40\mu$C}%
{$96\mu$C}%
{Zero}%
{$56\mu$C}%
{{\tt stdquest} questions are just so beautiful!}%
\stdquest

\setup{9}{4}
{A parallel-plate capacitor is charged and then disconnected from the
  charging battery.  A dielectric slab is inserted in the gap between the
  capacitor plates.  As a result,}%
{the capacitance stays the same, while the electric field decreases}%
{the capacitance stays the same, while the electric field increases}%
{the capacitance and electric field both increase}%
{the capacitance increases, while the electric field decreases}%
{the capacitance and electric field both decrease}%
\stdquest

\setup{10}{3}
{This is a {\tt ivlquest}. Note {\tt iv} is four, and {\tt l} is for little.\\
  A charge of +6.0 nC is at the origin, and another charge of +6.0 nC is on
  the x-axis at x = 1.0 m.  If the potential is chosen to be zero at
  infinity, what is the value of the potential on the y-axis at y = 1.0 m?}%
{15.8 V}%
{108 V}%
{92.2 V}%
{85.4 V}%
{empty}%
\ivlquest

\setup{11}{1}
{Two conducting, hollow spheres have different radii.  A thin, 
  conducting wire connects the spheres.  A charge Q is placed 
  on the smaller sphere.  Then,}%
{charge will flow until the spheres have equal potentials.}%
{charge will flow until the spheres have equal charges.}%
{all of the charge will flow to the larger sphere.}%
{charge will flow until the spheres have equal electric fields at their
  surfaces.}%
{There will be no flow of charge, so the charge Q will remain on the
  smaller sphere.}%
\pixquest{1in}{227f90h1.ps1}

\setup{12}{2}
{Note that the last question had a figure attached. It was a question
  of type {\tt pixquest}, and had the 8 arguments to {\tt$\backslash$setup},\\
  followed by {\tt $\backslash$pixquest\{1in\}\{227f90h1.ps1\}}.}%
{The {\tt $\backslash$pixquest} macro requires two arguments of its
  own, unlike {\tt $\backslash$stdquest}, {\tt $\backslash$fourquest},
  {\tt $\backslash$lilquest} and {\tt $\backslash$ivlquest}, which
  don't require arguments.}%
{The first argument is the width of the figure to be included. This
  should not be very large, or there will be insufficient room for the
  answers to format decently.}%
{The second argument is the name of a file containing a postscript
  figure to be inserted. Note that it has been given a unique name.
  This figure was the first figure on the first hour exam in 227 in
  fall, 1990.}
{I hope that people will make their exams available to the department
  after giving them. I have put together several big files of
  questions. As these files are large enough, people might reuse some
  of the questions.}%
{There are currently two other styles of questions with figures other
than those with answers on them (Q22). See Q14 and Q17.}%
\stdquest

\setup{13}{2}
{A charge of $+5Q$ is at the origin.  Concentric with it is a
  conducting spherical shell of inner radius $R_1$  and outer radius
  $R_2$.  This shell is given a {\bf net} charge of $-2Q$.  
  The distance $r$ is measured from the origin.  In the region 
  $r > R_2$ , the electric field is $1/4\pi\epsilon_0$ times}%
{$[-2Q/r^2]\hat r$}%
{$[3Q/r^2]\hat r$}%
{$[5Q/r^2]\hat r$}%
{$[7Q/r^2]\hat r$}%
{Zero}%
\lpixquest{2in}{227f90h1.ps2}

\setup{14}{2}
{In the preceding problem, the figure was to the right of everything,
  and both the question and the answers were set narrower than usual. }%
{It was set with {\tt lpixquest}, where the {\tt l} stands for long.}%
{{\tt lpixquest} takes the same two arguments as {\tt pixquest}.}%
{The decision which form to use depends on how high the picture will
  be, and how much space will be taken by the answers alone, and how
  much by the answers and question together.}%
{For the last problem, the figure was fairly tall, the answers didn't
  take much space, but the question statement together with the
  answers took as much vertical space as the figure. So {\tt
    lpixquest} was just what was needed.}%
{}
\fourquest

\setup{15}{5}
{In the preceding problem, the charge on the surface of the shell at 
  $r = R_1$ is}%
{Zero}%
{$-\displaystyle {5Q\over r^2}\hat r$}%
{$-\displaystyle {2Q\over r^2}\hat r$}%
{$\displaystyle {3Q\over r^2}\hat r$}%
{$\displaystyle {7Q\over r^2}\hat r$}%
\lilquest

\setup{16}{5}
{In the preceding problem, the charge on the surface of the shell at 
  $r = R_2$ is}%
{Zero}%
{$-2$Q}%
{$-5Q$}%
{+3Q}%
{}%
\ivlquest

\setup{17}{2}
{Consider two points A and B.  An electric field points from B
  towards A, and is constant in magnitude, so that $E_B  = E_A$.  
  How are the electric potentials at A and B related?}%
{$V_B = V_A$}%
{$V_B > V_A$}%
{$V_B < V_A$}%
{$V_B < V_A$  only if a positive charge is moved from B to A}%
{$V_B < V_A$  only if a negative charge is moved from B to A}%
\fpixquest{1.25in}{227f90h1.ps3}

\setup{18}{3}
{In the last problem, the figure was very short, and some of the
  answers long enough so they need to wrap when next to the picture. 
  Note that the figure was set next to the first four answers, and the
  last one didn't need to wrap. The {\tt $\backslash$fpixquest} macro
  figured this out by itself. Permutation of the answers would still be
  treated properly, although if the current ``d'' and ``e'' were the
  first two, they would both wrap and there would be no advantage over
  {\tt pixquest}, except the picture would appear higher. {\tt
  fpixquest} proves that}%
{\TeX\ is marvelously flexible.}%
{\TeX\ is overly complex.}%
{Anyone who writes his exams using WordMark has no sense of quality.
(This comment is archaic)}%
{Joel is {\bf crazy} to have spent 8 hours getting {\tt fpixquest} to
  work.}%
{All of the above.}
\stdquest

\setup{19}{3}
{The equivalent capacitance of the three capacitors is}%
{$0.16\mu$F}%
{$0.19\mu$F}%
{$1.00\mu$F}%
{$5.20\mu$F}%
{$6.25\mu$F}%
\lpixquest{2in}{227f90h1.ps4}

\setup{20}{3}
{The {\tt pixquest} and {\tt lpixquest} can be called with empty.ps
  as the second argument, as in \\
  {\tt $\backslash$pixquest\{1in\}\{empty.ps\}}. This leaves space 
  but does not insert a figure.  If the shape is not right, you can
  edit the BoundingBox in {\tt empty.ps}.  You can also use \\
  {\tt thinempty.ps}, which 
  is 100 times higher than it is wide to set aside extra vertical space
  for a question.  A width of 0.04in reserves 4 vertical inches for the
  question. \\ Can this be done with {\tt $\backslash$fpixquest}? }%
{No}%
{No!}%
{No!!}%
{No!!!}%
{What would be the point?}%
\lpixquest{2in}{empty.ps}

\setup{21}{5}
{A charge of $+2.0\mu$C is fixed on the x-axis at x = 3 cm, while
  a charge of $-3.0\mu$C is fixed on the y-axis at y = 3 cm.  The force on a
  third charge of $-1.0\mu$C placed at the origin is of magnitude}%
{10 N}%
{20 N}%
{30 N}%
{50 N}%
{36.1 N}%
\lpixquest{2in}{227f90h1.ps5}

\setup{22}{1}
{\gdef\undernote{This format requires adjustment by hand
    of the positions.  These adjustments do not currently survive a switch from
    one column to two column mode. Any \TeX\ hackers are encouraged to
    fix this bug, and inform me.\\ Note {\tt mvaquest} takes one
    argument, the file name of the picture, so this question ended
    with $\backslash${\tt mvaquest\{mvapix.eps\}}}
Sometimes the five answers might be best indicated by placing the 
(a), (b), \etc at the right locations on a figure. This is the
function of the question style mvaquest (for ``move answers''). The
positions are indicated in place of textual answers in the five answer
arguments to setup. For example, in this problem the first two answers
are indicated by
\begin{quote}
  \tt \{$\backslash$placeit\ 100,152 \}\\
  \{$\backslash$placeit\ 180,97 \}
\end{quote}
The spaces and lack thereof are essential --- the two coordinates,
given in points (1/72 of an inch), must be separated by a comma and no
spaces, and the second argument must be followed by a space.}
{\placeit 100,152 }
{\placeit 180,97 }
{\placeit 180,70 }
{\placeit 18,134 }
{\placeit 50,48 }
\mvaquest{mvapix.eps}

\setup{23}{1}
{You also might want to have the figure on the right
of the question, with the answers (a)---(e) appearing on the figure, 
as with mvaquest. This
question is of that type. Note that the placement adjusted for one
type is unlikely to work for the other. Note also that this format 
requires a width as well as the file name for the figure. This
question ended with {\tt $\backslash$lmvaquest\{2in\}\{mvapix.eps\}}}
{\placeit 62,82 }
{\placeit 90,59 }
{\placeit 90,42 }
{\placeit 26,72 }
{\placeit 40,32 }
\lmvaquest{2in}{mvapix.eps}

\setup{24}{4}
{Here are the rules for the format of the exam so that GRTEX will be
  able to do what it has to. Note they still permit immense flexibility}%
{The file begins with a latex header. This should include all the
  material needed to set things up, which does not need to be repeated
  for each version. It needs to be ended with a line that says exactly\\
  {\tt \%\%End of header}}%
{Next should follow all the material before the questions, which is to
  be repeated on each version of the exam. It must not have the
  command {\tt $\backslash$setup} in it starting in column 1 or 2.}%
{Then follows any number of questions, separated by blank lines. Each
  multiple-choice question 
  begins with {\tt $\backslash$setup}, followed by exactly eight
  arguments, then followed by a question formatting macro 
  {\tt $\backslash$???quest}, followed by the correct number of
  arguments for that style question.
  Numerical answer questions have a different form (See question 29).
}%
{After all the questions there must be a line that says exactly\\
  {\tt \% end of exam questions.}\\
  Then can follow any material which should follow the 
  questions on each version.}%
{Finally, the file ends with 
   $$\left\{ { \hbox{\tt $\backslash$bye \it for \TeX}  \atop 
  \hbox{\tt $\backslash$end$\{$document$\}$
 \it for \LaTeX} }\right.$$}%
\stdquest

\setup{25}{5}
{There are other possible styles which should probably be developed.}%
{You could design additions to {\tt exammac.tex}.}%
{You could find a student to do it for you.}%
{You could make do with the styles I've provided.}%
{You can include the picture directly in the question text. Note that
  the answers can also have figures included. These will move with the
  answer when permutted.}%
{You could give a clear description of the required style and a
  convincing argument for why I should spend the time creating it.}%
\stdquest

\setup{26}{5}
{For a certain charge distribution, the potential as a function of $r$ is
  given by $$ V(r) = {Q(3R -r )\over 8\pi\epsilon_0 R}\quad\hbox{for}~ r<R.$$
(The quantities $Q$ and $R$ are constants).  Then the electric 
  field as a function of $r$ (for $r<R$) is}%
{$[+Q/4\pi\epsilon_0 r^2 ]\hat  r$}%
{$[-Q/4\pi\epsilon_0 r^2 ]\hat  r$}%
{$[-Q(3R^2-2r)/8\pi\epsilon_0 R^3]\hat  r$}%
{$[-Qr/4\pi\epsilon_0 R^3] \hat  r$}%
{$[+Qr/4\pi\epsilon_0 R^3] \hat  r$}%
\stdquest

\setup{27}{1}
{A semi-infinite line charge of uniform density $\lambda$ lies along
  the negative x-axis from $x=0$ to $x=-\infty$.  
  The magnitude of the electric field
  at any point x on the positive x-axis is $1/4\pi\epsilon_0$ times}%
{$\lambda/x$}%
{$\lambda/x^2$}%
{$2\lambda/x$}%
{$\lambda/2x$}%
{None of the other answers}%
\fpixquest{2.5in}{227f90h1.ps6}

\numsidepix{28}{10,5}{1.0in}{echarge.eps}
{In 2002, Dick Plano introduced the possibility of giving questions
  which require numerical answers, rather than multiple choice. This
  requires a new exam answer form, with room for 15 numerical answer
  questions and 30 multiple choice questions. Answers are in
  scientific notation with sign, three significant digits, and an exponent of
  $\pm$ two digits. So a question looks like:\\
  What is the value of the physical constant \varname?}
 {\def\varname{$e$}\def\answer{1.60E-19,1.60E-19,1.60E-19,1.60E-19,1.61E-19}}
 {\def\varname{$G$}\def\answer{6.67E-11,6.67E-11,6.67E-11,6.60E-11,6.70E-11}}
 {\def\varname{$\hbar$}\def\answer{1.05E-34,1.05E-34,1.06E-34,1.05E00,
   1.06E00}}
 {\def\varname{$c$}\def\answer{3.00E8,3.00E8,3.00E8,2.99E8,3.00E8}}
 {}

\numquest{29}{10,5}%
{The numerical answer questions work differently than the multiple
  choice questions, in several ways. There is no setup command --- the
  type of question, {\tt numquest} or {\tt numsidepix} or {\tt numbotpix}
  determines the type of question at the beginning of the
  question. The arguments are\\
  1. the question number\\
  2. two numbers, fixed or floating point, giving the points to give
  for a fully correct answer and for a ``partially correct'' answer\\
  3. the question statement, including some tex macros\\
  4-8 alternate definitions of the macros, including of
  $\backslash${\tt answer}.\\
{\tt answer} is a set of 5 numbers, the correct answer, the lower end
of the ``fully correct answer'' interval, the upper end of that
interval, the lower end
of the ``partially correct answer'' interval, and the upper end of that
interval.}
{}
{}
{}
{}
{}

\numsidepix{30}{10,5}{1.0in}{227f90h1.ps1}
{There are three forms of numerical question currently. These
are {\tt numquest}, which has no picture; {\tt numsidepix}, which,
like this question, has a picture on the side, and  {\tt numbotpix},
like the next question. The latter two have two additional arguments 
occurring before the question statement and after the point
specification. The first of these is the width of the picture, with
units, and the second is the filename of the picture.}
{}
{}
{}
{}
{}

\numbotpix{31}{10,5}{4.0in}{227f90h1.ps6}
{This is a {\tt numbotpix}}
{}
{}
{}
{}
{}

\setup{32}{1}
{In November, 1996, I added the capability to add a footnote to each 
question --- something which appears after the answers on a full
line. As it is expected to be used rarely, I did not want to build a 
ninth argument into setup. So, if you want a question footnote
\gdef\undernote{This is a question footnote.}}
{You insert a tex command {\tt $\backslash$gdef$\backslash$undernote}%
\{Text of footnote\}
into the question statement.}
{Then you follow the question statement, as usual,
 with the answers, the $\backslash${\tt
  xxxquest}, and any arguments that form of question may have.}
{This feature is now available with all the question styles.}
{(A useless fourth comment.)}
{}
\fourquest

\setup{33}{4}
{In order to make a database of exam questions more useful, it is good
to be able to track where the questions originated, what material is covered,
how the students performed (including which wrong answers were popular), and
why certain wrong answers were used as ``distractors''. To do this, two
tex macros, $\backslash${\tt attrib} and $\backslash${\tt explain} have been
added to {\tt exammac2.tex}.
\attrib{ Joel Shapiro, not covered in Serway, 227f03h1:0 (16,13,18,51*,3)}}
{$\backslash${\tt attrib} is intended to come at the end of the question
statement. It should give % the number (in the database) of the question,
% I have dropped this, because using msort 0 permits seeing the database num.
authorship, physics topic covered, exam used, and performance statistics.}
{The above question statement ended with:\\
{\tt to \{$\backslash$tt exammac2.tex\}.
$\backslash$attrib\{ Joel Shapiro, not covered in Serway,
227f03h1:0 (16,13,18,51*,3)\}\}}}
{The performance statistics should be a parenthesized list, of the
  percentage of students giving each
  answer, with the correct answer starred.}
{Of course this needs to be turned off for the real exam. See the next
  question.} 
{}
\fourquest

\setup{34}{4}
{The $\backslash${\tt explain} macro should appear in each {\bf answer}.}  
{$\backslash${\tt explain} is intended to tell
why each answer is a good answer to present.\explain{like this}}
{The explanation in the last answer was included by ending the last
  answer with:\\  
{\tt to present.$\backslash$explain\{like this\}\}}}
{Of course {\tt explain} and {\tt attrib} must be turned off for the real
  exam. When $\backslash${\tt realexamtrue}, the {\tt explain} and
  {\tt attrib} commands, with their arguments, produce no output.}
{To get the attrib and explain comments to show up, 
  the command $\backslash${\tt realexamfalse} needs
  to appear uncommented in the exam header.}
{}
\fourquest

\setup{35}{1} 
{Here is an example:\\
A uniform surface charge density of $+5.0$ nC/m${}^2$ is distributed
  over the entire $xy$-plane. Consider a spherical (radius = 0.050 m)
  surface centered on the origin. Determine the electric flux through
  this spherical surface.
\attrib{\#11; Question only from Saunders TestBank
   24.6 on 24.2, edited slightly. \\
   227f96h1:6 (33*,38,11,7,11)}}
{4.44 Nm${}^2/$C\explain{$\pi r^2\sigma/\epsilon_0$}}
{17.74 Nm${}^2/$C\explain{$4 \pi r^2\sigma/\epsilon_0$}}
{0.296 Nm${}^2/$C\explain{$4 \pi r^3\sigma/3\epsilon_0$}}
{45.0 Nm${}^2/$C\explain{$k_e\sigma$}}
{$1.8\times 10^4 \hbox{ Nm}^2/$C\explain{$k_e\sigma/r^2$}}
\stdquest

\setup{36}{1}
{The database for a course can get quite large, and some thought
  should be given to how to structure it. I believe it is useful to 
  have a directory structure something like what is shown here:\\
  \epsfxsize=4.5in\epsfbox{dirstruct.eps}}
{The ``question'' file for {\tt grtex} would be in the {\tt database}
directory, and would contain all the questions. Any figures referred
to in a question would be referenced as \{{\tt ../eps/}{\it
  figurefile}\}}
{The question file would contain $\backslash${\tt input cover.tex}
and $\backslash${\tt input tail.tex} in the appropriate places, before
and after the questions. It might also contain an {\tt input
  options.tex}.}
{Each semester has its own directory, which will contain the files 
{\tt cover.tex}, {\tt tail.tex} and {\tt options.tex} for the current
exam. It also contains the ``want'' file for the exam.}
{To make an exam, one changes directory to that for the current
  semester, and executes grtex. When asked for the FILE FOR 
  Questions, give {\tt ../database/}{\it
    filename} so as to get the file from the database directory.}
{Note that if you expect to share questions and figures among
  different courses, you might eliminate the course layer in the
  directory structure.}
\stdquest

\setup{37}{1}
{Here are some other documents relevant for computer assisted exams
  and record keeping.\attrib{As of Oct.~24, 2003}}
{This file, the template, and the pictures used are in \\
{\tt /physics/doc/physics/grading/grtex} on the Suns.}
{GRTeX, by Richard J. Plano, explains how to use the {\tt grtex}
  program which produces multiple versions of the exam. It also
  discusses other aspects of the {\tt GREAD/GRED/GRAD/GREK} assembly
  of programs.}
{{\tt /physics/doc/physics/grading/grek\_unix} contains a number of 
files by Mohan Kalelkar explaining the use of GREK.}
{{\tt /physics/doc/physics/grading/grtex/grtex.*} contains older
  instructions by Joel Shapiro for using {\tt grtex}. This predates
  the numerical questions and does not include them.}
{}
\fourquest

% end of exam questions.
% If you wish, you can enter material here which will appear after all the 
% exam questions
%
%   \vfill\eject

\bigskip
\begin{center}
  \large \bf Getting Started
\end{center}

The instructions above provide a very rich set, probably too rich, of
options for a beginning grtex exam writer. I suggest you start by
producing a simple exam. You could start with the template 
{\tt examex.template}.
If you have cover page material, enter it after the line\\
{\tt \% enter your cover page material here, if you want one.}\\
but if not, comment out the line $\backslash${\tt clearpage} so it reads\\
{\tt \% $\backslash$clearpage}\\
Then enter a set of questions after the line\\
{\tt \% enter your exam questions here.    \#\#\#\#\#\#\#\#\#\# }\\
and before the line\\
{\tt \% end of exam questions.}\\
Finally, if you have material to go after all the questions, enter it
just before the {\tt clearpage} at the end of the file.

\clearpage % Needed to insure new version doesn't start in second column
\end{document}
