[Tex/LaTex] Format question in examclass

examformatting

I want to format all the questions and subquestions in bold.
\qformat only affects what's in front of the real text.

MWE:

\documentclass[answers]{exam}
\begin{document}
    This should not be in bold
    \begin{questions}
        \question This is a question
        \begin{solution}
             This should not be in bold
        \end{solution}
        \begin{parts}
            \part This is a subquestion
        \end{parts}

        \question This is a second question
    \end{questions}
    This should not be in bold
\end{document}

I want This is a question, This is a subquestion and This is a second question in bold.

I have no idea of how to do this.

Best Answer

Something like this?

\documentclass[answers]{exam}

\usepackage{xpatch}
\makeatletter
\xpatchcmd{\questions}{\par\fi\@doitem}{\par\fi\bfseries\@doitem}{}{}
\xpatchcmd{\questions}{\par\fi\@doitem}{\par\fi\bfseries\@doitem}{}{}
\xpatchcmd{\questions}{\par\fi\@doitem}{\par\fi\bfseries\@doitem}{}{}
\makeatother

\SolutionEmphasis{\normalfont}

\begin{document}

This should not be in bold
\begin{questions}
\show\question
  \question This is a question
  \begin{solution}
  This should not be in bold
  \end{solution}
  \begin{parts}
  \part This is a subquestion
  \end{parts}

  \question This is a second question
\end{questions}

This should not be in bold

\end{document}

enter image description here

If you only want the text of the question in boldface, here's a different set of patches.

\documentclass[answers]{exam}

\usepackage{xpatch}
\makeatletter
\xpretocmd{\item@points@pageinfo}{\normalfont}{}{}
\xapptocmd{\item@points@pageinfo}{\bfseries}{}{}
\makeatother

\SolutionEmphasis{\normalfont}

\begin{document}

This should not be in bold
\begin{questions}
  \question[3] This is a question
  \begin{solution}
  This should not be in bold
  \end{solution}
  \begin{parts}
  \part This is a subquestion
  \end{parts}

  \question This is a second question
\end{questions}

This should not be in bold

\end{document}

enter image description here

Related Question