当与班级一起出考试题时exam
,我喜欢在每一页上添加一个仅针对该页问题的部分成绩表,然后在考试末尾按页码添加最终成绩表。
以下是 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}
有没有办法让这种行为自动化?我在考试文档类是创建部分成绩表的技术,如 MWE 中所示。对于全长考试来说,这有点乏味。
答案1
这大概是我所能做到的最自动化程度了。评分范围并不适用于每一页。它们可能使用本地定义而不是全局定义。
您可能需要考虑改变页面几何形状并将分级表放在文本区域之外。
\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}
此版本使用 flowfram 而不是 tikzpagenodes。它不会覆盖问题和部分评分表。1 英寸的数字是猜测。
\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}