-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathexamdoc.tex
More file actions
7601 lines (6728 loc) · 253 KB
/
examdoc.tex
File metadata and controls
7601 lines (6728 loc) · 253 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%--------------------------------------------------------------------
%--------------------------------------------------------------------
% examdoc.tex
%
% This is the user's guide for the exam documentclass,
% by Philip Hirschhorn.
%
% The exam documentclass itself is in the file exam.cls.
%%% Copyright (c) 1997, 2000, 2004, 2008, 2011 Philip S. Hirschhorn
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
%
% This work consists of the files exam.cls and examdoc.tex
% The user's guide for exam.cls is in the file examdoc.tex.
%%% Philip Hirschhorn
%%% Department of Mathematics
%%% Wellesley College
%%% Wellesley, MA 02481
%%% psh@math.mit.edu
% The newest version of this documentclass should always be available
% from my web page: http://www-math.mit.edu/~psh/
%--------------------------------------------------------------------
%--------------------------------------------------------------------
\documentclass[12pt]{exam}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage[colorlinks]{hyperref}
% In case we're not using hyperref.sty:
\providecommand{\texorpdfstring}[2]{#1}
% The following can be used in \section commands
% without generating pdf warnings:
\newcommand{\bs}{\texorpdfstring{\char`\\}{}}
\newcommand{\docversion}{2.4}
\newcommand{\docdate}{May 22, 2011}
%\newcommand{\docdate}{\today}
\makeindex
\newcommand{\indc}[1]{\index{#1@\texttt{\char`\\#1}}}
\newcommand{\indcsub}[2]{\index{#1@\texttt{\char`\\#1}!#2}}
\newcommand{\indcstart}[1]{\index{#1@\texttt{\char`\\#1}|(}}
\newcommand{\indcstop}[1]{\index{#1@\texttt{\char`\\#1}|)}}
\newcommand{\indt}[1]{\index{#1@\texttt{#1}}}
\newcommand{\indtsub}[2]{\index{#1@\texttt{#1}!#2}}
\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
\subsubsection{Example:}
}%
{}
\def\samplehead#1#2#3#4{%
\begin{trivlist}
\item[]
\leavevmode
\hbox to \textwidth{%
\rlap{\parbox[b]{\textwidth}{\raggedright#1\strut}}%
\hfil\parbox[b]{\textwidth}{\centering#2\strut}\hfil
\llap{\parbox[b]{\textwidth}{\raggedleft#3\strut}}%
}% hbox
#4
\end{trivlist}
}
\def\samplefoot#1#2#3#4{%
\begin{trivlist}
\item[]
\leavevmode
#1
\vskip 3pt
\hbox to \textwidth{%
\rlap{\parbox[t]{\textwidth}{\raggedright#2}}%
\hfil\parbox[t]{\textwidth}{\centering#3}\hfil
\llap{\parbox[t]{\textwidth}{\raggedleft#4}}%
}% hbox
\end{trivlist}
}
% \makeatletter
% \@ifundefined{AmS}{\def\AmS{{\protect\the\textfont\tw@
% A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}}
% {}
% \makeatother
%---------------------------------------------------------------------
%---------------------------------------------------------------------
%---------------------------------------------------------------------
%---------------------------------------------------------------------
\begin{document}
\title{Using the exam document class}
\author{Philip Hirschhorn\\
Department of Mathematics\\
Wellesley College\\
Wellesley, MA 02481\\
psh@math.mit.edu\\[\bigskipamount]
Copyright \copyright~1994, 1997, 2000, 2004, 2008, 2011 Philip Hirschhorn\\
All rights reserved}
\date{\docdate}
\maketitle
\begin{center}
\small
This is the user's guide for version~\docversion{} of the
\verb"exam" document class.
\end{center}
\tableofcontents
%--------------------------------------------------------------------
\section{Introduction}
The file \verb"exam.cls" provides the \verb"exam" document class,
which attempts to make it easy for even a \LaTeX{} novice to prepare
exams. Specifically, \verb"exam.cls" sets the page layout so that
there are one inch margins\index{margins} all around (no matter what
size paper you're using) and provides commands that make it easy to
format questions, create flexible headers and footers, change the
margins, and create grading tables. In more detail:
\begin{itemize}
\item The class will automatically format and number the questions,
parts of questions, subparts of parts, and subsubparts of subparts
(see sections \ref{sec:Questions} and~\ref{sec:parts}).
\item You can include the point value\index{points} of each question
(or part, or subpart, or subsubpart), with your choice of having the
point values printed at the beginning of the text of the question,
opposite that in the left margin, opposite that in the right margin,
or in the right margin opposite the end of the question (see
section~\ref{sec:points}).
\item The class will add up the total points for each question (and
all of its parts, subparts, and subsubparts) and the total
points\index{points!total} on each page, and make those totals
available in macros (see sections \ref{sec:addup},
\ref{sec:pointsofq} and~\ref{sec:pointsonp}).
\item You can have the class print a grading table, indexed either by
question number or by page number (see
section~\ref{sec:GradeTables}).
\item You specify the header in three parts: One part to be left
justified, one part to be centered, and one part to be right
justified, and one or all of these can be omitted (see
section~\ref{sec:header}).
\item The footer is also specified in three parts: Left justified,
centered, and right justified (see section~\ref{sec:footer}).
\item The header and footer for the first page can be different from
the ones used on other pages (see sections \ref{sec:runningheader},
\ref{sec:lhead}, \ref{sec:runningfooter}, and \ref{sec:lfoot}).
\item Both headers and footers can contain more than one line. To
accommodate headers and footers with several lines, simple commands
are provided to enlarge the part of the page devoted to the header
and/or footer, and these commands can give one amount of space on
the first page and a different amount of space on all other pages
(see section~\ref{sec:extra-room}).
\item Macros are defined to enable you to state the total number of
pages in the exam (see section~\ref{sec:numpages}) and to change the
header and/or footer that appears on the last page of the exam (see
section~\ref{sec:lastpage}).
\item Macros are defined so that the headers and footers can vary
depending on whether the current page begins a new question or
continues a question that started on an earlier page (and, if one
continues onto the current page, to say what the number of that
question is). Macros are also defined so that the headers and
footers can vary depending on whether a question is complete on the
current page or continues on to the next page (and, if one
continues, to say what the number of that question is) (see
section~\ref{sec:QuesSpan}).
\item You can have a horizontal rule at the base of the header and/or
at the top of the footer (see section~\ref{sec:rules}).
\item The exam can begin with one or more cover pages, which are
numbered separately from the main pages of the exam and which can
have headers and footers different from the ones in the main pages
of the exam (see section~\ref{sec:coverpages}).
\item You can include solutions in your \LaTeX{} file and have these
solutions either printed or ignored (or replaced automatically by
space in which the students can write their answers) depending on a
single command (see section~\ref{sec:solutions},
section~\ref{sec:CorrectChoice}, and section~\ref{sec:AnsShortAns}).
\end{itemize}
The latest version of \verb"exam.cls" (possibly a
%
beta\index{beta test} test version) should always be available at
\verb"http://www-math.mit.edu/~psh/"\index{web page}.
%--------------------------------------------------------------------
\subsection{License}
\begin{itemize}
\item This work may be distributed and/or modified under the
%
\index{Latex Project Public License@\LaTeX{} Project Public License}
%
conditions of the \LaTeX{} Project Public
License\index{license},\index{LPPL} either version~1.3 of this
license or (at your option) any later version. The latest version
of this license is in \verb"http://www.latex-project.org/lppl.txt"
and version 1.3 or later is part of all distributions of \LaTeX{}
version 2003/12/01 or later.
\item This work has the LPPL maintenance status ``author-maintained''.
\item This work consists of the files \verb"exam.cls" and
\verb"examdoc.tex".
\end{itemize}
%--------------------------------------------------------------------
%--------------------------------------------------------------------
\section{Simple instructions for a basic exam}
\label{sec:Basic}
Producing a basic exam with the \texttt{exam} document class is fairly
easy. After you learn to do that, you can read the parts of this
user's guide that describe how to customize whatever you want to
change.
%--------------------------------------------------------------------
\subsection{The \texttt{\bs documentclass} command}
\label{sec:BasicDocumentclass}
To use the \texttt{exam} document class, your \verb"\documentclass"
command should be\indc{documentclass}
\begin{center}
\verb"\documentclass[addpoints]{exam}"
\end{center}
or, if you want to use 12~point type,
\begin{center}
\verb"\documentclass[addpoints,12pt]{exam}"
\end{center}
There are other options; for the full story, see
section~\ref{sec:Documentclass}.
%--------------------------------------------------------------------
\subsection{Asking for the student's name}
\label{sec:BasicName}
If you'll be leaving space for the answers on the question pages (see
sections~\ref{sec:BasicSpace} and \ref{sec:LeaveSpace}), then you'll
probably also want to leave space for the student's name%
\index{name}\index{student's name}. If you type
\begin{verbatim}
\begin{center}
\fbox{\fbox{\parbox{5.5in}{\centering
Answer the questions in the spaces provided on the
question sheets. If you run out of room for an answer,
continue on the back of the page.}}}
\end{center}
\vspace{0.1in}
\makebox[\textwidth]{Name and section:\enspace\hrulefill}
\vspace{0.2in}
\makebox[\textwidth]{Instructor's name:\enspace\hrulefill}
\end{verbatim}
after the \verb"\begin{document}" command and before the
\verb"\begin{questions}" command (see section~\ref{sec:Questions}),
then you'll get\\
\noindent
\parbox{\textwidth}{
\begin{center}
\fbox{\fbox{\parbox{5.5in}{\centering
Answer the questions in the spaces provided on the
question sheets. If you run out of room for an answer,
continue on the back of the page.}}}
\end{center}
\vspace{0.1in}
\makebox[\textwidth]{Name and section:\enspace\hrulefill}
\vspace{0.2in}
\makebox[\textwidth]{Instructor's name:\enspace\hrulefill}
}
%--------------------------------------------------------------------
\subsection{Asking questions}
\label{sec:BasicQuestions}
Once you've typed \verb"\begin{document}" and (if the students will be
writing their answers on the question pages) asked for the student's
name (see section~\ref{sec:BasicName}), you can list the questions
on the exam in a \texttt{questions} environment. You begin each
question with a \verb"\question"\indc{question} command, which is
optionally followed by a number of points inside of square brackets.
For example, if you type
%
\index{questions environment}\index{environment!questions}
\indt{questions}
\begin{verbatim}
\begin{questions}
\question[10]
Why is there air?
\question[15]
How much wood would a woodchuck chuck if a woodchuck could chuck
wood?
\question[10] Compute $\displaystyle\int_0^1 x^2 \, dx$.
\end{questions}
\end{verbatim}
then you'll get
\begin{questions}
\question[10]
Why is there air?
\question[15]
How much wood would a woodchuck chuck if a woodchuck could chuck
wood?
\question[10] Compute $\displaystyle\int_0^1 x^2 \, dx$.
\end{questions}
\bigskip
As the above example illustrates, you can leave blank lines
%
\index{blank lines} between the \verb"\question" command and the
actual beginning of the question, or before the first \verb"\question"
command in the environment, and they will be ignored. The point
values are entirely optional; if you omit the point values, you should
also omit the square brackets containing them.
If you give the command \verb"\marksnotpoints"\indc{marksnotpoints},
then the words ``point'' and ``points'' will be replaced by the words
``mark'' and ``marks''. There are many other customizations possible
for the points, including using a different language, changing the way
the points are printed, and by having them printed in one of the
margins. For the full story, see section~\ref{sec:points}.
%--------------------------------------------------------------------
\subsection{Questions with parts, and subparts, and subsubparts}
\label{sec:BasicParts}
If you want to create a question with parts, you use a
\texttt{parts}\indt{parts} environment and begin each part with the
command \verb"\part"\indc{part}. The \texttt{parts} environment can
be at the beginning of a question or after some text that begins the
question. (There are also \texttt{subparts} and \texttt{subsubparts}
environments; for the full details, see section~\ref{sec:parts}.) For
example, if you type
%
\index{parts environment}\index{environment!parts}
\begin{verbatim}
\begin{questions}
\question[10]
Why is there air?
\question
What if there were no air?
\begin{parts}
\part[5]
Describe the effect on the balloon industry.
\part[5]
Describe the effect on the aircraft industry.
\end{parts}
\question[20]
\begin{parts}
\part
Define the universe. Give three examples.
\part
If the universe were to end, how would you know?
\end{parts}
\end{questions}
\end{verbatim}
then you'll get
\begin{questions}
\question[10]
Why is there air?
\question
What if there were no air?
\begin{parts}
\part[5]
Describe the effect on the balloon industry.
\part[5]
Describe the effect on the aircraft industry.
\end{parts}
\question[20]
\begin{parts}
\part
Define the universe. Give three examples.
\part
If the universe were to end, how would you know?
\end{parts}
\end{questions}
\bigskip
The above example illustrates several things:
\begin{itemize}
\item Parts of a question should be put into a
\verb"parts"\indt{parts}\index{parts environment}%
\index{environment!parts} environment.
\item If a question begins with a \verb"parts" environment, then the
first part will appear on the same line with the question number.
\item You can leave blank
%
lines\index{blank lines} before and after the \verb"\part" command,
and they will be ignored.
\item You can assign points either to the question or to the parts of
a question.
\end{itemize}
%--------------------------------------------------------------------
\subsection{Leaving space for the answers}
\label{sec:BasicSpace}
\index{space!for answers}
\index{answer space}
To leave blank space after a question you use the \verb"\vspace"
command, and you end a page with the \verb"\newpage" command. For
example, if you wanted to leave 3~inches of space after the first
question and 2~inches of space after each of the parts of the second
question, your \texttt{questions} environment would contain the
following:
%
\index{blank space}\index{space!blank}
\begin{verbatim}
\question[10]
Why is there air?
\vspace{3in}
\question
What if there were no air?
\begin{parts}
\part[5]
Describe the effect on the balloon industry.
\vspace{2in}
\part[5]
Describe the effect on the aircraft industry.
\vspace{2in}
\end{parts}
\newpage
\end{verbatim}
If you want to equally distribute the space on a page among several
questions (or parts, or subparts, or subsubparts), you should
type\indc{stretch}\index{space!allocating}
%
\index{allocating space}
\begin{center}
\verb"\vspace{\stretch{1}}"
\end{center}
after each of the questions (or parts, etc.\@) and end the page with
\verb"\newpage". If you'd like one of those questions to receive
twice as much space as each of the others, then follow that one
question with \verb"\vspace{\stretch{2}}" and follow each of the
others with \verb"\vspace{\stretch{1}}". (You can use any decimal
number for the \verb"\stretch" value. For example,
\verb"\vspace{\stretch{1.5}}" will allocate 1.5 times the amount of
space allocated by \verb"\vspace{\stretch{1}}".)
In addition to leaving blank space, it's also possible to leave lined
space, dotted lined space, or an empty box. For the full story, see
section~\ref{sec:LeaveSpace}.
%--------------------------------------------------------------------
\subsection{Headers and footers}
\label{sec:BasicHeadFoot}
\index{header|(}
\index{footer|(}
To produce headers and footers, you give the command\indc{pagestyle}
\begin{center}
\verb"\pagestyle{headandfoot}"
\end{center}
in the preamble (i.e., after the \verb"\documentclass" command and
before the \verb"\begin{document}" command), followed by the commands
that say what will be in the headers and footers. Headers and
footers each have three parts: One part on the left, one centered
part, and one part on the right, and any of these can be empty.
The headers and footers are determined by the commands%
\indc{firstpageheader}\indc{firstpagefooter}\indc{firstpageheadrule}%
\indc{firstpagefootrule}\indc{runningheader}\indc{runningfooter}%
\indc{runningheadrule}\indc{runningfootrule}
\begin{center}
\begin{tabular}{l@{\qquad}l}
\verb"\firstpageheader"& for the header on the first page,\\
\verb"\firstpagefooter"& for the footer on the first page,\\
\verb"\firstpageheadrule"& to put a horizontal rule in the head of
the first page,\\
\verb"\firstpagefootrule"& to put a horizontal rule in the foot of
the first page,\\[0.5ex]
\verb"\runningheader"& for the header after the first page,\\
\verb"\runningfooter"& for the footer after the first page\\
\verb"\runningheadrule"& to put a horizontal rule in the head
after the first page, and\\
\verb"\runningfootrule"& to put a horizontal rule in the foot
after the first page.\\
\end{tabular}
\end{center}
For example, to have the header
%
\samplehead{Math 115}{First Exam}{July 4, 1776}{}
%
on the first page, the header
%
\samplehead{Math 115}{First Exam, Page 2 of 5}{July 4, 1776}{\hrule}
%
on all pages after the first, and no footer on any page, give the
commands
\begin{verbatim}
\pagestyle{headandfoot}
\runningheadrule
\firstpageheader{Math 115}{First Exam}{July 4, 1776}
\runningheader{Math 115}
{First Exam, Page \thepage\ of \numpages}
{July 4, 1776}
\firstpagefooter{}{}{}
\runningfooter{}{}{}
\end{verbatim}
For another example, to have the header
%
\samplehead{Math 115}{First Exam}{July 4, 1776}{}
%
on the first page, no header on the pages after the first, no footer
on the first page, and the footer
%
\samplefoot{\hrule}{Math 115}{First Exam}{Page 2 of 5}
%
on all pages after the first, give the commands
\begin{verbatim}
\pagestyle{headandfoot}
\firstpageheader{Math 115}{First Exam}{July 4, 1776}
\runningheader{}{}{}
\firstpagefooter{}{}{}
\runningfooter{Math 115}{First Exam}{Page \thepage\ of \numpages}
\runningfootrule
\end{verbatim}
Sections~\ref{sec:beginexamples} through \ref{sec:endexamples} contain
many other examples of headers and footers, and the full explanation
of the commands for headers and footers is in
sections~\ref{sec:pagestyle}--\ref{sec:QuesSpan}.
\index{header|)}
\index{footer|)}
%---------------------------------------------------------------------
%--------------------------------------------------------------------
\section{The \texttt{\bs documentclass} command}
\label{sec:Documentclass}
To use the \verb"exam" document class, you should specify \verb"exam"
as the required argument to your
\verb"\documentclass"\indc{documentclass}
command, as in
\begin{center}
\verb"\documentclass{exam}"
\end{center}
or, e.g., if you want to use 12~point type,
\begin{center}
\verb"\documentclass[12pt]{exam}"
\end{center}
There are two possible optional arguments that are specific to the
\verb"exam" document class:
\verb"addpoints"\indcsub{documentclass}{options} and \verb"solutions".
Most documents that use the \verb"exam" document class should use the
option \verb"addpoints" (see section~\ref{sec:addpoints}); the option
\verb"answers" is used when you want to print solutions to the
questions (see section~\ref{sec:answers}).
%--------------------------------------------------------------------
\subsection{The option \texttt{addpoints}}
\label{sec:addpoints}
The \verb"\documentclass" option
\verb"addpoints"\indt{addpoints}\indcsub{documentclass}{options}, used
as in
\begin{center}
\verb"\documentclass[addpoints]{exam}"
\end{center}
or
\begin{center}
\verb"\documentclass[12pt,addpoints]{exam}"
\end{center}
enables the commands that add up the points (see sections
\ref{sec:addup}, \ref{sec:Count}, \ref{sec:pointsofq},
and~\ref{sec:pointsonp}) and that produce grading tables and point
tables (see sections \ref{sec:GradeTables} and~\ref{sec:PointTables}).
This is an option, rather than the default, mainly for the sake of
maintaining backward compatibility; most documents that use the
\verb"exam" document class should use this option. The only reason
\emph{not} to use the \verb"addpoints" option is that this option
creates an error if you include any words in an argument that assigns
points to a question (see section~\ref{sec:points}). If
\verb"addpoints" is not in effect you can put whatever you want in the
argument for the points, but if \verb"addpoints" \emph{is} in effect
then the argument that contains the points must contain only digits
and the command \verb"\half" (see section~\ref{sec:Half}).
You can also turn \verb"addpoints" on and off wherever you like in the
exam by using the commands\indc{addpoints}\indc{noaddpoints}
\begin{center}
\begin{tabular}{l}
\verb"\addpoints"\\
\verb"\noaddpoints"
\end{tabular}
\end{center}
Using the document class option \verb"addpoints" is equivalent to
giving the command \verb"\addpoints" at the beginning of the exam.
%--------------------------------------------------------------------
\subsection{The option \texttt{answers}}
\label{sec:answers}
If you will be typing solutions into the exam (see sections
\ref{sec:solutions}, \ref{sec:CorrectChoice},
and~\ref{sec:AnsShortAns}) and you'd like the solutions to be printed
on the next run of \LaTeX, you should include the document class
option \verb"answers"\indt{answers}\indcsub{documentclass}{options},
as in
\begin{center}
\verb"\documentclass[answers]{exam}"
\end{center}
or
\begin{center}
\verb"\documentclass[answers,12pt]{exam}"
\end{center}
or
\begin{center}
\verb"\documentclass[12pt,addpoints,answers]{exam}"
\end{center}
Using the document class option \verb"answers" is equivalent to giving
the command \verb"\printanswers"\indc{printanswers} at the beginning
of the exam (see section~\ref{sec:solutions}). The effect of this is
that
\begin{itemize}
\item the contents of the
environments\indt{solution}\indt{solutionorbox}%
\indt{solutionorlines}\indt{solutionordottedlines}
\begin{center}
\begin{tabular}{l}
\verb"solution",\\
\verb"solutionorbox",\\
\verb"solutionorlines", and\\
\verb"solutionordottedlines"
\end{tabular}
\end{center}
(see section~\ref{sec:solutions}) will be printed on the next run of
\LaTeX,
\item any choices of a \texttt{choices}\indt{choices},
\texttt{oneparchoices}\indt{oneparchoices},
\texttt{checkboxes}\indt{checkboxes}, or
\texttt{oneparcheckboxes}\indt{oneparcheckboxes} environment (see
section~\ref{sec:MulChc}) that are created using a
\verb"\CorrectChoice"\indc{CorrectChoice} command (see
section~\ref{sec:CorrectChoice}) instead of a
\verb"\choice"\indc{choice} command will be printed with emphasis as
determined by the argument of the most recent
\verb"\CorrectChoiceEmphasis"\indc{CorrectChoiceEmphasis} command
(which by default is \verb"\bfseries"), and
\item any \verb"\answerline"\indc{answerline} commands (see
section~\ref{sec:ShortAns})\indcsub{answerline}{optional~argument}
that include an optional argument containing the answer (see
section~\ref{sec:AnsShortAns}) will have the answer printed on the
answer line.
\end{itemize}
%---------------------------------------------------------------------
%--------------------------------------------------------------------
\section{Questions and points}
\label{sec:QuestionsPoints}
To create questions, you use a \verb"questions"\indt{questions}
%
environment\index{questions environment}\index{environment!questions}
(see section~\ref{sec:Questions}); each question is begun with a
\verb"\question"\indc{question} command, which takes an optional
argument to assign some number of points\index{points} to the question
(see section~\ref{sec:points}). The questions are numbered
automatically. Point values can include half points (see
section~\ref{sec:Half}).
If you want a question to have several parts, you use a
%
\verb"parts"\indt{parts}%
\index{parts environment}\index{environment!parts} environment (see
section~\ref{sec:parts}); each part is begun with a
\verb"\part"\indc{part} command, which takes an optional argument to
assign some number of points to the part (see
section~\ref{sec:points}). The parts are numbered automatically.
Similarly, parts can have subparts, and subparts can have subsubparts
(see section~\ref{sec:parts}).
The points for a question (or part, or subpart, or subsubpart) appear
by default at the beginning of the question (or part, etc.), but there
are commands to have the points appear instead in either the left
margin or in the right margin (see section~\ref{sec:whereprint} and
section~\ref{sec:DrpPts}). The formatting of the points can also be
customized (see sections \ref{sec:Boxed}, \ref{sec:pointname},
\ref{sec:margins}, and~\ref{sec:pointformat}). It's also possible to
have questions (or parts, etc.) that are worth ``bonus points'', which
are added up separately from the non-bonus points (see
section~\ref{sec:Bonus}).
%--------------------------------------------------------------------
\subsection{Questions}
\label{sec:Questions}
To type the questions on the exam you use the
%
\verb"questions"\indt{questions}\index{questions environment}%
\index{environment!questions} environment. Each question is then
begun with the command \verb"\question"\indc{question}, and the
questions are numbered automatically.
For example, if you type
\begin{verbatim}
\begin{questions}
\question
Why is there air?
\question
How much wood would a woodchuck chuck if a woodchuck could chuck
wood?
\question Compute $\displaystyle\int_0^1 x^2 \, dx$.
\end{questions}
\end{verbatim}
then you'll get
\begin{questions}
\question
Why is there air?
\question
How much wood would a woodchuck chuck if a woodchuck could chuck
wood?
\question Compute $\displaystyle\int_0^1 x^2 \, dx$.
\end{questions}
\bigskip
As the above example illustrates, you can leave blank lines
%
\index{blank lines} between the \verb"\question" command and the
actual beginning of the question, or before the first \verb"\question"
command in the environment, and they will be ignored.
%---------------------------------------------------------------------
\subsection{Questions with parts and subparts (and subsubparts)}
\label{sec:parts}
If you want a question to have several parts, then you use the
%
\verb"parts"\indt{parts}\index{parts environment}%
\index{environment!parts} environment. For example, if you type
\begin{verbatim}
\begin{questions}
\question
Why is there air?
\question
What if there were no air?
\begin{parts}
\part
Describe the effect on the balloon industry.
\part
Describe the effect on the aircraft industry.
\end{parts}
\question
\begin{parts}
\part
Define the universe. Give three examples.
\part
If the universe were to end, how would you know?
\end{parts}
\end{questions}
\end{verbatim}
then you'll get
\begin{questions}
\question
Why is there air?
\question
What if there were no air?
\begin{parts}
\part
Describe the effect on the balloon industry.
\part
Describe the effect on the aircraft industry.
\end{parts}
\question
\begin{parts}
\part
Define the universe. Give three examples.
\part
If the universe were to end, how would you know?
\end{parts}
\end{questions}
\bigskip
The above example illustrates several things:
\begin{itemize}
\item Parts of a question should be put into a
\verb"parts"\indt{parts}\index{parts environment}%
\index{environment!parts} environment.
\item If a question begins with a \verb"parts" environment, then the
first part will appear on the same line with the question number.
\item You can leave blank
%
lines\index{blank lines} before and after the \verb"\part" command,
and they will be ignored.
\end{itemize}
\bigskip
There is also a \verb"subparts"\indt{subparts}%
\index{subparts environment}\index{environment!subparts} environment,
and even a \verb"subsubparts"\indt{subsubparts}%
\index{subsubparts environment}\index{environment!subsubparts}
environment, and they work just as you would expect. For example, if
you type\indc{subpart}\indc{subsubpart}
\begin{verbatim}
\begin{questions}
\question
\begin{parts}
\part
What do you do with a drunken sailor?
\part
Is your answer different if it is before noon?
\end{parts}
\question
This is the second question.
\begin{parts}
\part
This is a part.
\part
This is also a part.
\begin{subparts}
\subpart
This is a subpart.
\subpart
This is a periscope.
\subpart
This is a pair of diving planes.
\subpart
\begin{subsubparts}
\subsubpart
This is a subsubpart.
\subsubpart
The lower surface of a diving plane?
\subsubpart
The ocean floor, perhaps?
\end{subsubparts}
\end{subparts}
\part
It's sad to be apart.
\end{parts}
\question
\begin{parts}
\part
\begin{subparts}
\subpart
This is a subpart.
\subpart
This is another subpart.
\end{subparts}
\part
This is another part.
\end{parts}
\end{questions}
\end{verbatim}
then you'll get
\begin{questions}
\question
\begin{parts}
\part
What do you do with a drunken sailor?
\part
Is your answer different if it is before noon?
\end{parts}
\question
This is the second question.
\begin{parts}
\part
This is a part.
\part
This is also a part.
\begin{subparts}
\subpart
This is a subpart.
\subpart
This is a periscope.
\subpart
This is a pair of diving planes.
\subpart
\begin{subsubparts}