Exercise 24: Creating an Exam Paper with the exam Class (Solution)
This is a solution to Exercise 24.
\documentclass
[
12pt,
a4paper,
answers,% display the solutions
addpoints% add up the points so the total can be accessed by \numpoints
]{exam}
\pointsinrightmargin
\bracketedpoints
\unframedsolutions
\SolutionEmphasis
\begin{document}
This exam has \numquestions\ questions worth a total of \numpoints\
points.
\begin{center}
\fbox{\parbox{0.8\linewidth}{\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[\linewidth]{Name and section:\enspace\hrulefill}
\vspace{0.2in}
\makebox[\linewidth]{Instructor's name:\enspace\hrulefill}
\begin{center}
\gradetable
\end{center}
\begin{questions}
\question Find the derivatives with respect to $x$ of the following
functions:
\begin{parts}
\part[\half] $y = x + 1$
\begin{solution}
$y' = 1$
\end{solution}
\part[1] $y = x^3 + 4x^2 - x + 3$
\begin{solutionorbox}[1.5cm]
$y' = 3x^2 + 8x - 1$
\end{solutionorbox}
\part[1\half] $y = \cos(x^2)$
\begin{solutionorlines}[1.5cm]
$y' = -2x\sin(x^2)$
\end{solutionorlines}
\end{parts}
\question[1] Which of the following ingredients are used in
mind-controlling cookies?
\begin{checkboxes}
\choice arsenic
\choice cyanide
\choice curare
\CorrectChoice secret genetically modified sugar beet
\end{checkboxes}
\end{questions}
\end{document}
Download examcls.tex or examcls.pdf.
