考试:仅显示每个问题的总分值,添加部分

考试:仅显示每个问题的总分值,添加部分

有没有一种简单的方法可以只显示考试中每个问题的分数,自动添加各部分的分数并在问题旁边打印总分?这是一个最小的工作示例:

\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}

输出应显示1. (6 points) ...问题 1 和每个部分的点都会被抑制(即点不会打印在那里)。这似乎应该是可能的(毕竟等级表是存在的),但我似乎无法弄清楚,而且在 CTAN 的文档中也没有类似的东西……提前谢谢!

答案1

手册中可能有更简单的解决方案。

\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}

此版本删除了正常的点列表。

\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

根据约翰的回答:用于\pointsdroppedatright抑制部分要点。用于\totalpoints非部分问题。

\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}

相关内容