2

When writing exams with the exam class, I like to add a partial grade table to each page for just the questions on that page, and then add a final grade table at the end of the exam by page number.

Here's a MWE:

\documentclass[addpoints]{exam}

\begin{document}
\begin{questions}
\begingradingrange{page1}
\question[10] What does $2+2$ equal?
\question[10] What is $\frac{d}{dx} \sin x$?
\endgradingrange{page1}
\vfill
\begin{flushright}
\partialgradetable{page1}[h]
\end{flushright}

\clearpage
\begingradingrange{page2}
\question I have many parts. 
\begin{parts}
\part[5] Graph $y=x^2$.
\part[7] Compute the Laplace Transform of $y(t) = e^{2t} \cos t$. 
\end{parts}
\question[42] Quis custodiet ipsos custodes?
\endgradingrange{page2}
\vfill
\begin{flushright}
\partialgradetable{page2}[h]\\
\gradetable[h][pages]
\end{flushright}
\end{questions}
\end{document}

Which produces the following output: pdfoutput

Is there a way to automate this behavior? The only advice I found in the Exam Doc Class was the technique of creating partial grade tables as shown in the MWE. This gets a bit tedious with a full length exam.

2
  • Is there an updated link for the Exam Doc Class?
    – jvriesem
    Commented Dec 12, 2021 at 19:53
  • 1
    @jvriesem should be fixed now
    – erfink
    Commented Dec 12, 2021 at 21:30

1 Answer 1

3

This is about as automated as I can make it. The grading ranges won't work with everypage. They probably use local rather than global definitions.

You might want to think about changing the page geometry and putting the grading tables outside the text area.

\documentclass[addpoints]{exam}
\usepackage{everypage}
\usepackage{tikzpagenodes}

\AddEverypageHook{%
  \begin{tikzpicture}[remember picture,overlay]
    \node[above left] at (current page text area.south east)
      {\partialgradetable{page\thepage}[h]};
  \end{tikzpicture}%
}
\newcommand{\nextpage}{\endgradingrange{page\thepage}%
  \newpage
  \begingradingrange{page\thepage}}

\begin{document}
\begingradingrange{page\thepage}
\begin{questions}
\question[10] What does $2+2$ equal?
\question[10] What is $\frac{d}{dx} \sin x$?
\nextpage

\question I have many parts. 
\begin{parts}
\part[5] Graph $y=x^2$.
\part[7] Compute the Laplace Transform of $y(t) = e^{2t} \cos t$. 
\end{parts}
\question[42] Quis custodiet ipsos custodes?
\endgradingrange{page\thepage}

\begin{tikzpicture}[remember picture,overlay]
  \node[below left] at (current page text area.south east)
    {\gradetable[h][pages]
};
\end{tikzpicture}%
\end{questions}
\end{document}

This version uses flowfram instead of tikzpagenodes. It will NOT overlay the questions and the partial grading table. The 1in figure is a guess.

\documentclass[addpoints]{exam}
\usepackage{flowfram}

\newflowframe{\textwidth}{\dimexpr \textheight-1in}{0pt}{1in}

\newdynamicframe{\textwidth}{1in}{0pt}{0pt}[partial]
\setdynamiccontents*{partial}{\vspace*{\fill}\hspace*{\fill}%
  \partialgradetable{page\thepage}[h]}

\newcommand{\nextpage}{\endgradingrange{page\thepage}%
  \newpage
  \begingradingrange{page\thepage}}

\begin{document}
\begingradingrange{page\thepage}
\begin{questions}
\question[10] What does $2+2$ equal?
\question[10] What is $\frac{d}{dx} \sin x$?
\nextpage

\question I have many parts. 
\begin{parts}
\part[5] Graph $y=x^2$.
\part[7] Compute the Laplace Transform of $y(t) = e^{2t} \cos t$. 
\end{parts}
\question[42] Quis custodiet ipsos custodes?
\endgradingrange{page\thepage}

\vfill\hspace*{\fill}%
\raisebox{\dimexpr -1in-\baselineskip-\height}[0pt][0pt]{\gradetable[h][pages]}
\end{questions}
\end{document}
1
  • Awesome! Thank you for the options. In practice, I don't think that overlaying the questions and gradetable will be an issue---students need space to give answers anyways. I really like the idea of having a generous bottom margin to allow the grade tables to sit outside the text area.
    – erfink
    Commented Apr 15, 2018 at 22:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .