It is a good idea to group them in several files, for example depending on
topic and difficulty. Here is an example for file
"mycollection/chapter1.txt":
What is the most massively useful thing an interstellar hitchhiker
can have while traveling through the universe?
- A ray gun
- The force
+ A towel
- The bible
Which are the worst three poetries in the universe?
- The poetry of German folk songs
+ Vogon poetry
- The poetry of Lady Gaga
+ The poetry of the Azgoths of Kria
- Dan Brown's Illuminati
+ The poetry of Paula Nancy Millstone Jennings
of Sussex
And so on. You may have noticed that the plus (+) sign indicates the right
answers. Note that the - and + signs must be at the first column! Also note
that an empty line must be used as separator between questions and answers.
You can use almost any LaTeX commands here, for example you can specify
equations etcetera the usual way.
Optionally you may also add an image to a question, for example:
Which of the life forms below is the most dangerous in the universe?
@pics/animals.jpg 50
- Herbert Haas
+ The Ravenous Bugblatter Beast of Traal
- The Alien
- Pope Benedikt XVI
Note that any reference to an image must be specified in a dedicated line
which starts with an "@" and this line must follow the question block.
Optionally the image width can be specified in percent of the text width (here
50 percent).
Usually you create a title page only once for each lecture. Dynamic elements
such as exam group and date can be specified as argument or option in the
configuration file (see below).
A simple example would be the following content of file titlepage.tex:
\begin{center}
\Large Hitchhiker certification exam\\
\textsc{Gagrakacka University}\\
\end{center}
\vspace*{10mm}
\textsc{Name:}\\[5cm]
\vspace*{10mm}
Cheating is penalized with Vogon poetry.
\newpage
For each new exam you typically create an exam configuration file where you
basically specify how many questions should be taken from which collection
file. Additionally other parameters can be (optionally) set. Here is an
example of myexam.conf:
cover = titlepage.tex
include chapter1.txt 10
include chapter1_hard.txt 5
include chapter2.txt 10
include chapter3.txt 10
include chapter4.txt 10
include chapter5.txt 6
And here is a bit more elaborated configuration file:
! This is a comment.
! First start with some general descriptions
! Usually you want a nice cover page
cover = titlepage.tex
! Separation line (in mm) between the questions? If not, omit this line.
line = 0.3
! Path to the the collection files (absolute or relative)
path = mycollection/
!!! Normally questions are enumerated automatically. Optionally you may
!!! want a style like "Question 1: ...." or in German "Frage 1: ...", in
!!! case you can specify a qword:
! qword = Question
date = 23. April 2010
head = Hitchiker certification 2010
! The collection files -- always put them at the end of this file
! The numbers indicate the number of questions to choose from each document
include chapter1.txt 10
!include chapter1_hard.txt 5
include chapter2.txt 10
include chapter3.txt 10
include chapter4.txt 10
include chapter5.txt 6
Either:
$ examinator myexam.conf
Alternatively you want several different exam groups:
$ examinator myexam.conf -g "Group A"
$ examinator myexam.conf -g "Group B"
Now you will find four different files in your current directory: myexam_Group_A.tex
and myexam_Group_B.tex, and the solutions myexam_Group_A_solutions.tex and
myexam_Group_B_solutions.tex.
Run pdflatex on all the resulting LaTeX files.