1

Often I have homework with just a few graded exercises. I like to TeX my homework in just one file and to hide the exercises that will not be graded such that I can hand in my graded exercises with the corresponding points.

So I like to have a option like "answers", but then for "graded exercises". Is this possible?

Example

I have this:

Example entire file

And I want an option to only show this:

Show assignment to hand in

1
  • I suggest to skim through these classes: ctan.org/topic/exam . These vary by age (nothing done for quite some time) and capability. Open some tabs in your browser, call the manuals and get some idea about the packages. Also search for them here, which can be very eye-opening.
    – MS-SPO
    Commented Oct 11, 2022 at 14:23

1 Answer 1

1

Manually using conditionals

\documentclass[addpoints]{exam}

%\newcommand*{\SHOWUNGRADED}{}  % uncomment to show ungraded exercises

\begin{document}
\begin{questions}

\question[10]
Why is there air?

\ifdefined\SHOWUNGRADED
    \question Compute $\displaystyle\int_0^1 x^2 \, dx$.
% \else    % uncomment to keep question numbering (part, subpart similarly)
%    \stepcounter{question}   % uncomment too, to keep numbering 
\fi

\question[15]
How much wood would a woodchuck chuck if a woodchuck could chuck
wood?

\end{questions}
\end{document}

It would be nice to get this automatically done for questions, parts and so on, however I could not find a predefined solution in the documentation.

2
  • Is it possible to preserve the question numbers this way?
    – anonymous
    Commented Oct 11, 2022 at 13:38
  • Also manually, as I updated my answer. Commented Oct 11, 2022 at 14:17

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