带有奖励栏的考试成绩表

带有奖励栏的考试成绩表

我们想在考试中添加奖励题,但不是作为单独的部分,而是以问题编号代替。如果不操纵考试包,这可以实现吗?

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

例子

答案1

尝试一下这个代码。

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}

\combinedgradetable[h][questions]

C

更新后续问题之后

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}

相关内容