0

Is there an easy way to display only the points-per-question in an exam, automatically adding the points from the parts and printing the total next to the question? Here is a minimal working example:

\documentclass[addpoints]{exam}
\begin{document}
\begin{questions}
  \question This is a question with parts.
  \begin{parts}
    \part[1] This
    \part[2] That
    \part[3] The Other
  \end{parts}
  \question[3] Another question!
\end{questions}
\end{document}

The output should display 1. (6 points) ... for question 1 and each part will have the points suppressed (i.e. points won't be printed there). This seems like it should be possible (grade tables exist after all), but I can't seem to figure it out and there isn't anything like this in the documentation on the CTAN... Thanks in advance!

2 Answers 2

1

There might be an easier solution in the manual.

\documentclass[addpoints]{exam}
\makeatletter
\newcommand{\qpoints}{\@ifundefined{pointsofq@\roman{question}}{}%
  {(\csname pointsofq@\roman{question}\endcsname ~points)~}}
\makeatother
\begin{document}
\begin{questions}
  \question\qpoints This is a question with parts.
  \begin{parts}
    \part[1] This
    \part[2] That
    \part[3] The Other
  \end{parts}
  \question[3] Another question!
\end{questions}
\end{document}

This version removes normal point listings.

\documentclass[addpoints]{exam}
\makeatletter
\newcommand{\qpoints}{\@ifundefined{pointsofq@\roman{question}}{}%
  {(\csname pointsofq@\roman{question}\endcsname ~points)~}}
\makeatother
\pointformat{\hspace{-5pt}} % prevents other points from being printed

\begin{document}
\begin{questions}
  \question\qpoints This is a question with parts.
  \begin{parts}
    \part[1] This
    \part[2] That
    \part[3] The Other
  \end{parts}
  \question[3]\qpoints Another question!
\end{questions}
\end{document}
2
  • There is still a problem with question 2 (after using \pointformat{}); I think I can fix this using another conditional within \qpoints and supplying an argument specifying an override of points.
    – User12345
    Mar 5, 2021 at 10:41
  • 1
    BTW, if you look in the aux file you will find the names of many similar macros. Mar 5, 2021 at 14:12
0

Based on John's answer: use \pointsdroppedatright to suppress part points. Use \totalpoints for non-part questions.

\documentclass[addpoints]{exam}

\makeatletter
\newcommand{\qpoints}{\@ifundefined{pointsofq@\roman{question}}{}%
  {(\csname pointsofq@\roman{question}\endcsname ~points)~}}
\makeatother

\pointsdroppedatright

\begin{document}
\begin{questions}
  \question\qpoints This is a question with parts.
  \begin{parts}
    \part[1] This
    \part[2] That
    \part[3] The Other
  \end{parts}
  \question[3] (\totalpoints~points)~Another question!
  \question[4] (\totalpoints~points)~Another question!
  \question[5] (\totalpoints~points)~Another question!
  \question[6] (\totalpoints~points)~Another question!
  \question[7] (\totalpoints~points)~Another question!
\end{questions}
\end{document}

You must log in to answer this question.

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