The exam class
Another pointer to a LaTeX class which which I ran across, called simply “exam”. As you might guess, its entire purpose is to help you typeset exams. Rather than exhaustively go through all of the features, I would like to point out a few items:
- The magic seems to come with the questions environment, similar to the enumerate environment. Instead of \item, you would use \question.
- There is an optional item to \question, which is the point value for the particular question. There are several options for typesetting point values.
- Questions can have parts, which individually can have subparts, which can have subsubparts. In particular, see the \parts environment and the \parts macro.
- There is a solution environment. If you express the desire (either by using the answers option in the documentclass declaration or by using the \printanswers macro in your preamble) your answers will be typeset with the questions. Otherwise they are hidden. The solution environment also takes an option, which is the blank space to be left for students to write their answers when answers are not printed.
- There is a coverpages environment, which allows you to typeset material before page 1 of the exam.
- There is a gradetable macro. If you put point values on your questions (and use the \addpoints macro in your preamble), a table is placed in your document which allows you to hand-write the points earned on each question in an appropriate blank, adding up the result in the end to get a score.
All-in-all, a pretty basic class. There are many options which I have not gone over, but the included documentation is well-done. Of course, there are always a couple of things that I would like to see included in the next version.
- I would like the option to typeset a solution within the space allowed for the student. In a perfect world, the “correct” solution would fit in the space allotted to the student; also, it would be easier to compare the key with the original exam if the two were paginated the same.
- A little customization for the short-answer solutions would be nice. In this class, the short-answer blanks come right after the corresponding question part. What if it were delayed to when the question itself were finished?
I’m sure there are other ideas people might have for improvements to this class. I will also mention that the exam class is not the only game in town; there is also the examdesign class and the exams class.
Here is an example LaTeX file using the exam class, and the compiled output.
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 | \documentclass[12pt]{exam} \usepackage{amsmath} \usepackage{color} %% exam options \boxedpoints \addpoints \printanswers \setlength\answerlinelength{3in} \cfoot{Page \thepage\ of \numpages} \begin{document} \begin{coverpages} \begin{center} {\Huge \bf MAT305 Exam 1} \vskip 0.2in \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. This exam has \numquestions\ questions for a total of \numpoints\ points.}}} \end{center} \vspace{0.1in} \hbox to \textwidth{Name and section:\enspace\hrulefill} \vspace{0.2in} \hbox to \textwidth{Instructor's name:\enspace\hrulefill} \begin{center} \gradetable[h] \end{center} \end{coverpages} \begin{questions} \question[10] Solve the separable differential equation \[ y' + t^3y^2= t^3.\] \begin{solution} We begin by manipulating: \begin{align*} y' &= t^3(1-y^2)\\ \intertext{There are the constant solutions $y = \pm 1$. Discarding the possibility that $1-y^2 = 0$ (on the strength of the uniqueness theorem for linear DEs), we have} \frac{y'}{1-y^2} &= t^3\\ \left(\frac{1}{1-y} + \frac{1}{1+y}\right) y' &= 2t^3\\ \frac{d}{dt}(\ln|1+y| - \ln|1-y|) &= 2t^3\\ \ln \left|\frac{1+y}{1-y}\right| &= \frac{t^4}2+C & (C\text{ arbitrary})\\ \frac{1+y}{1-y} &= ce^{t^4/2} & (c\text{ arbitrary})\\ y &= \frac{ce^{t^4/2}-1}{ce^{t^4/2}+1} \end{align*} \end{solution} \vfill \hskip 3in Answer: \hrulefill \pagebreak \question Solve the differential equation \[ y' + 14y = t\] using an integration factor, using the following procedure. \begin{parts} \part[5] What is the integrating factor $\mu(t)$?\answerline \part[5] What function is $\mu(t)y' + 14\mu(t)y$ the derivative of?\answerline \part[5] Find the general antiderivative of both sides of $\mu(t)(y'+14y) = \mu(t) t$ and solve for $y$. \end{parts} \begin{solution} The integrating factor $\mu(t)$ should satisfy $\mu'(t) = 14 \mu(t)$, so we choose \[\mu(t) = e^{14t}.\] This makes the left side the derivative of the expression \[ e^{14t}y \] according to the product rule. Therefore, by taking the general antiderivative of the indicated expression, we have \begin{align*} e^{14t}y &= \int te^{14t} \, dt\\ &= \frac{1}{14}te^{14t} - \frac{1}{196} e^{14t} + C &(C\text{ arbitrary})\\ y &= \frac t {14} - \frac{1}{196} + Ce^{-14t}. \end{align*} \end{solution} \end{questions} \end{document} |