Пусть \numquestions\ не учитывают бонусные вопросы

Пусть \numquestions\ не учитывают бонусные вопросы

Я бы хотел использовать \numquestions и \numparts без учета bonusquestions и -parts, как это делает \numpoints. Как мне этого добиться?

Если использовать пример, я хочу сказать следующее: «Этот экзамен содержит 2 вопроса и бонусный вопрос."

\documentclass[addpoints]{exam}

\begin{document}
This exams contains \numquestions\ questions and a bonusquestion.

    \begin{questions}
    \question[100]
    Is this the first question?
    \question[100]
    Is this the second question?
    \bonusquestion[100]
    Does this question count?
    \end{questions}
    
\end{document}

решение1

Использование пакета totcountи команд \qquestionand \bbonusquestionвместо \questionи \bonusquestion.

а

\documentclass[addpoints]{exam}
    
%****************************** added <<<<<<<<<<<<<<<<<<
\usepackage{totcount}
\newtotcounter{q}
\setcounter{q}{0}
\newtotcounter{b}
\setcounter{b}{0}
\newcommand{\qquestion}[0]{\stepcounter{q}\question}
\newcommand{\bbonusquestion}[0]{\stepcounter{b}\bonusquestion}
%****************************** 
    
\begin{document}
    
This exams contains \total{q}\ question(s) and \total{b}\ bonusquestion(s).
    
    \begin{questions}
        \qquestion[100]
        Is this the first question?
        \qquestion[100]
        Is this the second question?
        \bbonusquestion[100]
        Does this question count?
        \bbonusquestion[100]
        Does this question count?       
    \end{questions}
    
\end{document}

Вдохновленныйпосчитайте количество вопросов отдельно...

Связанный контент