考试科目中部分问题后面立即打印的分数

考试科目中部分问题后面立即打印的分数

我正在使用考试类 (exam.cls) 进行考试。我试图在部分问题之后立即打印分数。有人知道如何实现吗?

\documentclass[11pt]{exam}
\begin{document} 
\begin{questions} 
\question Some questions about emotions. 
    \begin{parts}
        \part[2] Are we happy?
        \part[2] Are we mad?
    \end{parts}    
\end{questions}
\end{document}

给出:

一些点位置不正确的问题

我希望它显示如下(尽管没有垂直间距): 一些关于正确点位置的问题

感谢您的帮助!

答案1

从这个美好的回答并进行了一些修改。

\documentclass[a4paper,addpoints]{exam}

\makeatletter
\@qformatfalse
\def\droppointsatend{%
  \def\level@of@question{question}%
  \leavevmode\unskip\nobreak%
  \ifx\level@of@question\@queslevel%
    \dotfill(\mbox{\totalpoints\ \points})%
  \else%
    \quad \mbox{(\@points\  \points)}%
  \fi%
  \par
}
\makeatother

\begin{document}
\pointsdroppedatright
\begin{questions}
\question Some questions about emotions. 
    \begin{parts}
        \part[2] Are we happy? \droppointsatend
        \part[2] Are we mad? \droppointsatend
        \part[2] Are we mad Are we mad Are we mad Are we mad Are we mad Are we mad Are we mad Are we mad Are we mad Are we mad? \droppointsatend
    \end{parts}  

\question Second questions about emotions.   
\begin{parts}
        \part[2] Are we happy? \droppointsatend
        \part[2] Are we mad? \droppointsatend 
 \end{parts}    
\end{questions}


\noindent Total to earn: \numpoints\ \points


\end{document}

在此处输入图片描述

答案2

您可以尝试以下代码。这应该会给出所需的结果:

\documentclass[11pt]{exam}
\begin{document} 
\begin{questions} 
\question Some questions about emotions. 
    \begin{parts}
        \part Are we happy? (2 points)
        \part Are we mad? (2 points)
    \end{parts}    
\end{questions}
\end{document}

相关内容