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

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

Basic problem with the exam class

Postby Johannes_B » Wed Nov 01, 2017 8:22 am

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.

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

Postby Cham » Wed Nov 01, 2017 12:08 pm

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 :
  1. \documentclass[11pt]{exam}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage[french]{babel}
  5. \usepackage{microtype}
  6. \usepackage[margin=1in]{geometry}
  7.  
  8. \setlength\answerskip{4ex}
  9. \setlength\answerlinelength{0.5in}
  10.  
  11. \begin{document}
  12.  
  13. \pointsinmargin\pointformat{}
  14.  
  15. A few questions to disturb you :
  16.  
  17. \bigskip
  18.  
  19. \begin{questions}
  20.  
  21. \question[2] Who's buried in Grant's tomb?
  22.  
  23. \answerline
  24.  
  25. \question[2] Blabla?
  26.  
  27. \answerline
  28.  
  29. A few more questions to annoy you :
  30.  
  31. \bigskip
  32.  
  33. \question[3] Which is heavier: A pound of feathers, or a pound of lead?
  34.  
  35. \answerline
  36.  
  37. A few choices questions :
  38.  
  39. \bigskip
  40.  
  41. \question[3] Blabla :
  42.  
  43. \begin{choices}
  44. \choice John
  45. \choice Paul
  46. \choice George
  47. \choice Ringo
  48. \choice Socrates
  49. \end{choices}
  50.  
  51. \end{questions}
  52.  
  53. \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: 813
Joined: Sat Apr 02, 2011 4:06 pm

Postby Cham » Wed Nov 01, 2017 10:45 pm

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 :

  1. \documentclass[11pt]{exam}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[margin=1in]{geometry}
  4.  
  5. \begin{document}
  6.  
  7. \begin{questions}
  8.  
  9. \question[3] Who are you ?
  10.  
  11. \begin{choices}
  12. \choice John
  13. \choice Paul
  14. \choice George
  15. \choice Ringo
  16. \choice Socrates
  17. \choice Me
  18. \choice You
  19. \choice Him
  20. \end{choices}
  21.  
  22. \end{questions}
  23.  
  24. \end{document}

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

Postby Cham » Thu Nov 02, 2017 2:13 pm

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

  1. \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: 3582
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Nov 02, 2017 6:04 pm

  1. \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: 813
Joined: Sat Apr 02, 2011 4:06 pm

Postby Cham » Thu Nov 02, 2017 9:35 pm

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: 8522
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Thu Nov 02, 2017 10:58 pm

  1. \renewcommand\thechoice{\alph{choice})}
  2. \renewcommand\choicelabel{\thechoice}

Or, if you consider ) ad part of the label only:

  1. \renewcommand\thechoice{\alph{choice}}
  2. \renewcommand\choicelabel{\thechoice)}


The latter macro had the period.

Stefan
Site admin

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

Postby Cham » Fri Nov 03, 2017 12:05 am

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:


Return to “Document Classes”

Who is online

Users browsing this forum: No registered users and 2 guests