2

I'm using the exam class (exam.cls) to make an exam. I'm trying to get the points printed right after the part question. Anyone an idea how to achieve this?

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

Gives:

Some questions with incorrect point location

Where I want it to appears as follows (although without the vertical spacing): Some questions with correct point location

Thanks for your help!

2

From this nice answer with some modifying.

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

enter image description here

0

You can try the following code. This should give the desired result:

\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}
  • Hi Parth, it would be nice if I don't have to type (x points) over and over again, like in the example. You put \part[2] and it gives automatically (2 points). Any suggestions for that? – BoukjeDG Jun 25 at 8:12
  • I have a solution where you can simply type (x points) or (y points) and replace x and y at just one place. Will that help? – Parth Sarthi Sharma Jun 25 at 8:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.