Tuesday, March 30, 2010

[QnA] Use the latest version of exam.cls for preparing exam papers

When preparing an exam paper, we might want to have two versions of this exam paper: one with answers for teachers and the other has only questions for students.

The exam.cls makes this task easy. But make sure you are using the latest version of it or you will not have the handy ``ifprintanswer'' function.

Here is an sample to show how to use the exam.cls with the ifprintanswer function:

\documentclass{exam} % Set ``exam'' as the document class
\newcommand{\ans}[1]{\ifprintanswers{#1}\fi} % define a new command to simplify
% the following usage

\printanswers % Add this line to print the answers.
% If no answers printing is wanted, just comment this line out.

\ans{The answer} The question's description
\choice The choice A
\choice The choice B
\choice The choice C
\choice The choice D

Using the LaTeX exam class

No comments:

Post a Comment