I am using the exam
template and wonder how to count the total number of questions and the total number of marks to provide the totals on a cover sheet (before declaring them)?
Here is what I have. I am sure it is easy, but was not able to find an example or the right commands in the documentation...
Can anybody help?
\documentclass[11pt]{exam}
\RequirePackage{amssymb, amsfonts, amsmath, latexsym, verbatim, xspace, setspace}
\RequirePackage{tikz, pgflibraryplotmarks}
\usepackage[margin=1in]{geometry}
\begin{document}
% some hearder and student info here, excluded for simplicity
% instructions
\textbf{Instructions:}
% how to count questions and marks to give the totals on a cover sheet?
This exam contains XXX questions, \numpages pages (including the cover) for the total of XXX marks.
\begin{questions}
% Basic question
\addpoints
\question[10] Differentiate $f(x)=x^2$ with respect to $x$.
% Basic question
\addpoints
\question[10] Differentiate $f(x)=x^3$ with respect to $x$.
\end{questions}
\end{document}
This exam contains \numquestions{} questions, \numpages{} pages (including the cover) for the total of \numpoints{} marks.