0

We want to add bonus questions to our exams but not as a separate section but instead of a question number. Is this possible without manipulating the exam package?

\documentclass[addpoints]{exam}
\begin{document}

\begin{questions}
    \question [1] Question 1
    \question [2] Question 2
    \bonusquestion [2] What's your favorite color?
\end{questions}

\gradetable[h]
    
\end{document}

example

0

1 Answer 1

1

Try this code.

b

\documentclass[addpoints]{exam} 


%******************************************** added <<<<<<<<<<<<
\usepackage{xpatch} 
\makeatletter
\chbpword{Bonus Question:}  
\gdef\bonuspoint@block{Bonus Question:}%

\xapptocmd{\questions}{%
    \def\bonusquestion{%
                \@bonustrue%
                \def\thequestiontitle{Bonus}%
                \process@question%
            }%
            }{}{}
\makeatother
%******************************************** 

\begin{document}
    
    \begin{questions}
        \question [10] Question 1
        \question [20] Question 2
        \bonusquestion [35] What's your favorite color?
    \end{questions} 

    \combinedpointtable[h][questions] % changed <<<<<<<<<<<<<<<<<
    
\end{document}

With \combinedgradetable[h][questions]

c

UPDATE after follow up question

d

\documentclass[addpoints]{exam}     

%******************************************** added <<<<<<<<<<<<
\usepackage{xpatch} 
\makeatletter
\chbpword{Bonus Question:}  
\gdef\bonuspoint@block{Bonus Question:}%

\xapptocmd{\questions}{%
    \def\bonusquestion{%
                \@bonustrue%
                \def\thequestiontitle{Bonus}%
                \process@question%
            }%
            }{}{}
        
\renewcommand\questionlabel{\if@bonus\relax\else\thequestion.\fi}
\makeatother
%******************************************** 
    
\begin{document}
    
    \begin{questions}
        \question [10] Question 1
        \question [20] Question 2
        \bonusquestion [35] What's your favorite color? 
    \end{questions} 

    \combinedgradetable[h][questions] % changed <<<<<<<<<<<<<<<<<
    
\end{document}
2
  • Great! Could it be just "Bonus Question:" without "3. "? Where do I find documentation to this @block statement?
    – RootRaven
    Sep 19, 2022 at 19:20
  • 1
    @RootRaven (1) Please see the updated answer. (2) You have to scan the exam.cls with a text editor and see the comments. Look around line 3977. Sep 20, 2022 at 13:47

You must log in to answer this question.

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