我正在尝试创建一个标题问题,其中总分会自动计算。我尝试了以下方法,但都无法实现我的目标:
\documentclass[addpoints]{exam}
\begin{document}
\begin{questions}
% Option 1: This works but does not do the points => point switch for 1 point
%\titledquestion{ (\totalpoints{} points) {\bf A question}}
% Option 2: It seems like this should work (?) but it gives an error...
%\titledquestion{ (\totalpoints{} \points) {\bf A question}}
% Option 3: This works, but I have to manually add the points of the
% parts which I want to avoid...
%\titledquestion{{\bf A question}}[1]
% Option 4: This does not work...I get an error.
%\titledquestion{{\bf A question}}[\totalpoints{}]
\thequestiontitle
\begin{parts}
\part[1]
First part.
\part[0]
Second part.
\end{parts}
\end{questions}
\end{document}
对于上面的选项 2,我收到错误:
! Undefined control sequence.
\points ...up \let \half =\relax \edef \pt@string
{\@points }\ifthenelse {\e...
而对于选项 4,我得到:
! LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.17 ...question{{\bf A question}}[\totalpoints{}]
最糟糕的情况是,我可以忍受糟糕的语法,但想避免计算出的要点摘要不正确......
非常感谢任何帮助/建议。
(请注意,\totalpoints{} \points
该命令确实有效\qformat
,但似乎不适用于标题问题?)