#StackBounty: #exam #exercises #exsheets #exercisebank Any way to separate final Answer and Solution?

Bounty: 50

I am using exam package to typeset few problems along with its solutions.

question Evaluate $int frac{x^{4}}{x^{2}+1} d x$
begin{solution}
Solution: $int frac{mathrm{x}^{4}}{mathrm{x}^{2}+1} mathrm{~d} mathrm{x}=int frac{mathrm{x}^{4}-1+1}{mathrm{x}^{2}+1} mathrm{~d} mathrm{x}$
$$
begin{aligned}
    &=int frac{x^{4}-1}{x^{2}+1}+frac{1}{x^{2}+1} d x \
    &=intleft(x^{2}-1right) d x+int frac{1}{x^{2}+1} d x \
    &=frac{x^{3}}{3}-x+tan ^{-1} x+C
end{aligned}
$$
end{solution}

I want to separate "final answer" from the "solution".

So that I can give a handout containing:

  1. just questions & final answers.
    enter image description here
  2. Or sometimes just the questions (without answers or solutions).
  3. Or sometimes questions and solutions.

I am hoping for something like this:

question question
answer answer %or even begin{answer} end{answer} <-- for final answer
begin{solution}
  solution
end{solution}

Now, I should be able to print just final answers using printanswers (or some command like that) and printing of solutions controlled by printsolutions.

I don’t have any preference for exampackage, I am using it because it has printanswers and nice solution environment. I am open to use any other package.

EDIT: Adding some custom code to any latex packages/classes is also okay. I just need this thing to work. It would be ideal if there is a facility to deferred print the options.


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.