LaTeX forum ⇒ Document Classes ⇒ Basic problem with the exam class Topic is solved

Information and discussion about specific document classes and how to create your own document classes.
Cham
Posts: 901
Joined: Sat Apr 02, 2011 4:06 pm

Basic problem with the exam class

I need to add a few comments before some questions, using the exam class. Here's a MWE showing my problem. What is wrong with this very basic code ?

\documentclass[11pt]{exam}\usepackage[T1]{fontenc}\usepackage[margin=1in]{geometry} \begin{document} \begin{questions} A few questions to disturb you : \question[2] Who's buried in Grant's tomb? \answerline A few more questions to annoy you : \question[3] Which is heavier: A pound of feathers, or a pound of lead? \answerline \end{questions} \end{document}

LaTeX gives me a couple of errors :
LaTeX Error: Something's wrong--perhaps a missing \item.

How can I add a few lines of text (comments) before some questions ? The comments are not part of the questions themselves.

Also, I would like to remove the points for some of the questions. Removing [2] for example gives an empty ().

Stefan Kottwitz
Posts: 9416
Joined: Mon Mar 10, 2008 9:44 pm
Hi Cham!

The error occurs because \begin{questions} starts a list environment. So everything has to be an \item, \question makes an implicit \item.

Simply add non-question text right before \begin{questions}.

For having 0 points, I would clearly say \question[0] so (0 points) is visible. Otherwise it looks like forgotten, not stated. It would be more consistent.

Stefan

Cham
Posts: 901
Joined: Sat Apr 02, 2011 4:06 pm
Stefan, I need to not show the points at all for many questions.

Actually, I need to write a long list of about 25 questions, and each one have a 2 points value. I don't want to repeat the 2 points on each question. Just stating the points at the comment level (before the question) would be enough and better looking.

Stefan Kottwitz
Posts: 9416
Joined: Mon Mar 10, 2008 9:44 pm
You canard these commands to your preamble and use them:


Stefan

Cham
Posts: 901
Joined: Sat Apr 02, 2011 4:06 pm
Here's what I'm trying to do (text in French, but this is irrelevent) :
test.jpg (36.95 KiB) Viewed 1979 times

It's a long list of multiple choices questions, followed by a list of True/False questions. There's a comment between the first list and the second list (T/F), and yet the numbers should follow in a logical way.

How would you do this ?

PS. I'll try your suggestion above...

Stefan Kottwitz
Posts: 9416
Joined: Mon Mar 10, 2008 9:44 pm
I would use the exam manual as the base to do that. I normally don't use this class myself. I guess the manual helps, and if there's something to modify or to hack, let us know.

Stefan

Cham
Posts: 901
Joined: Sat Apr 02, 2011 4:06 pm
For this exam, I would like to completely remove the points for all the questions. The points would be stated separately in a comment, before each list of questions (multiple choices, true/false, and some development questions),

I don't see the option/command to remove all the points, in the manual.

Stefan Kottwitz
Posts: 9416
Joined: Mon Mar 10, 2008 9:44 pm
In that case you could use \pointsinmargin\pointformat{} as above. Specifically, \pointformat{} makes the formatting being empty, the other command if for avoiding the unnecessary indentation then.

Stefan

Cham
Posts: 901
Joined: Sat Apr 02, 2011 4:06 pm
It's working great ! Thanks a lot !

Now, how could we slide the \answerline line to the left, and remove its number ? Or to define a left side answer rule ?

I also need to customize the symbols in the choices list. By default, they are capitalized letters (A, B, C, ...). I would prefer simple integers, or small letters instead. The documentation doesn't seem to show how to change this.

Stefan Kottwitz
Posts: 9416
Joined: Mon Mar 10, 2008 9:44 pm
Do you have a current good-looking example to test? I lost the one I worked it when my computer crashed right now.

Maybe also Clemes jumps in, a moderator from latex.org, he is the author of the exsheets package and its successor xsim. Just to give you new ideas.

Stefan