Document ClassesBasic problem with the exam class

Information and discussion about specific document classes and how to create your own document classes.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Basic problem with the exam class

Post by Johannes_B »

Do you need al the fuzz the exam class is adding? You don't want to print the points, as all questions have the same amount of points. A table summing up how many points are available for each question seems a bit pointless as well.

The screenshot you have shown just shows enumerated lists. Easy to do, no need for a special class or package.
See https://en.wikibooks.org/w/index.php?ti ... cial_lists

You can also have a look at Teacher's Corner, which covers exsheets, but not yet xsim.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Basic problem with the exam class

Post by Cham »

Stefan Kottwitz wrote:Do you have a current good-looking example to test? I lost the one I worked it when my computer crashed right now. :-o
Here's a working code which is very close to what I need :

Code: Select all

\documentclass[11pt]{exam}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{microtype}
\usepackage[margin=1in]{geometry}

\setlength\answerskip{4ex}
\setlength\answerlinelength{0.5in}

\begin{document}

\pointsinmargin\pointformat{}

A few questions to disturb you :

\bigskip

\begin{questions}

\question[2] Who's buried in Grant's tomb?

\answerline

\question[2] Blabla?

\answerline

A few more questions to annoy you :

\bigskip

\question[3] Which is heavier: A pound of feathers, or a pound of lead?

\answerline

A few choices questions :

\bigskip

\question[3] Blabla :

	\begin{choices}
		\choice John
		\choice Paul
		\choice George
		\choice Ringo
		\choice Socrates
	\end{choices}

\end{questions}

\end{document}
It just need three things to be modified :

1. Slide the answer line to the left, with a slight offset (indent).
2. Remove the answer line number (it's useless if it's at the left)
3. Change the choices capital letters to small letters, or maybe numbers?
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Basic problem with the exam class

Post by Cham »

Another glitch : the vertical spacing of the choice answer (in the choices environment) is a bit too large. Is there an option or some command to reduce it ? The manual isn't clear to me about this. Here's a MWE code to try :

Code: Select all

\documentclass[11pt]{exam}
\usepackage[T1]{fontenc}
\usepackage[margin=1in]{geometry}

\begin{document}

\begin{questions}

\question[3] Who are you ?

	\begin{choices}
		\choice John
		\choice Paul
		\choice George
		\choice Ringo
		\choice Socrates
		\choice Me
		\choice You
		\choice Him
	\end{choices}

\end{questions}

\end{document}
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Basic problem with the exam class

Post by Cham »

I solved the answer line problem (simple line at left, without a number). A simple macro does it :

Code: Select all

\newcommand{\TFLine}{\vspace{0.75cm}\hspace{1cm}\rule{1.5cm}{0.5pt}\vspace{0.25cm}}
I just use \TFLine, instead of \answerline.

My exam is almost done ! :) I only need to customize the choices capital letters to some other symbols (small letters or numbers). I would prefer something like a), b), ... instead of A, B, .... Any suggestion about this ?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Basic problem with the exam class

Post by Johannes_B »

Code: Select all

\renewcommand\thechoice{\alph{choice})}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Basic problem with the exam class

Post by Cham »

Cool ! It's working. Unfortunately, it leaves a point after the ")". It should be "a)", instead of "a)."

Also, what other options could we have ? Numbers instead of letters ?

Or circles to mark with an X ? (I think that the last one is described in the manual. I'll check this).
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Basic problem with the exam class

Post by Stefan Kottwitz »

Code: Select all

\renewcommand\thechoice{\alph{choice})}
\renewcommand\choicelabel{\thechoice}
Or, if you consider ) ad part of the label only:

Code: Select all

\renewcommand\thechoice{\alph{choice}}
\renewcommand\choicelabel{\thechoice)}
The latter macro had the period.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Basic problem with the exam class

Post by Cham »

It's all working great. Thanks a lot! :)

Now, while the result seems pretty with "a)", I'm not sure anymore that it's better looking than "A." ! At least, I now have a choice in the code.

A long time ago, I was creating this kind of exams with a WYSIWYG word processor (pesky Word and the likes). The printed output was good, but editing was always a pain in the arse. Now that I have a full LaTeX version, I could throw away Word to the trash bin. Adios, Micro$ ! :twisted:
Codyben123
Posts: 1
Joined: Mon Mar 11, 2019 12:18 am

Basic problem with the exam class

Post by Codyben123 »

In the exam class the comments you want are called "Instructions for a group of questions" (see section 6.1 of the examdoc.pdf document).
In your case type \uplevel{A few questions to annoy you:}
That's all you need.
Post Reply