Skip to content

Commit 9addc9c

Browse files
authored
Merge pull request #14 from OpenSecEd/exam
Adds LaTeX and Makefile templates for exams (fixes #11)
2 parents 029f07c + 22238a7 commit 9addc9c

File tree

5 files changed

+144
-11
lines changed

5 files changed

+144
-11
lines changed

Makefile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ texgen.pdf: abstract.tex
1313
texgen.pdf: preamble.tex
1414
texgen.pdf: contents.tex
1515
texgen.pdf: acknowledgements.tex
16+
texgen.pdf: Makefile.notes
17+
texgen.pdf: Makefile.slides
1618
texgen.pdf: letter.tex
19+
texgen.pdf: exam.tex
20+
texgen.pdf: Makefile.exam
1721
texgen.pdf: Makefile.guide
18-
texgen.pdf: Makefile.notes
1922
texgen.pdf: Makefile.root
20-
texgen.pdf: Makefile.slides
2123
texgen.pdf: program.nw
2224
texgen.pdf: Makefile.noweb
2325
texgen.pdf: README.md.template
@@ -45,18 +47,20 @@ PKG_INSTALL_FILES-share+= README.md.template
4547
PKG_INSTALL_FILES-share+= CONTRIBUTING.md.template
4648
PKG_INSTALL_FILES-share+= LICENSE.CC
4749
PKG_INSTALL_FILES-share+= LICENSE.MIT
48-
PKG_INSTALL_FILES-share+= abstract.tex
49-
PKG_INSTALL_FILES-share+= contents.tex
5050
PKG_INSTALL_FILES-share+= notes.tex
51-
PKG_INSTALL_FILES-share+= preamble.tex
5251
PKG_INSTALL_FILES-share+= slides.tex
53-
PKG_INSTALL_FILES-share+= Makefile.root
52+
PKG_INSTALL_FILES-share+= preamble.tex
53+
PKG_INSTALL_FILES-share+= abstract.tex
54+
PKG_INSTALL_FILES-share+= contents.tex
5455
PKG_INSTALL_FILES-share+= Makefile.notes
5556
PKG_INSTALL_FILES-share+= Makefile.slides
57+
PKG_INSTALL_FILES-share+= letter.tex
58+
PKG_INSTALL_FILES-share+= exam.tex
59+
PKG_INSTALL_FILES-share+= Makefile.exam
60+
PKG_INSTALL_FILES-share+= Makefile.root
5661
PKG_INSTALL_FILES-share+= Makefile.guide
5762
PKG_INSTALL_FILES-share+= program.nw
5863
PKG_INSTALL_FILES-share+= Makefile.noweb
59-
PKG_INSTALL_FILES-share+= letter.tex
6064

6165
PKG_TARBALL= texgen.tar
6266
PKG_TARBALL_FILES= ${PKG_INSTALL_FILES-bin} ${PKG_INSTALL_FILES-share}

Makefile.exam

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
EXAM_NAME= exam
2+
EXAM_QNAME= questions
3+
EXAM_FLAGS= -NCE
4+
5+
.PHONY: <year>
6+
<year>: exam-<date>.pdf exam-<date>.pdf exam-<date>.pdf
7+
8+
EXAM_IDS+= <date> <date> <date>
9+
10+
EXAM_TAGS+= AnalyseNeededCryptoProperties
11+
EXAM_TAGS+= DesignSystemsByCombiningPrimitives
12+
EXAM_TAGS+= EvaluateSecureDesigns
13+
14+
EXAM_DBS+= ../modules/crypto/overview/questions.tex
15+
EXAM_DBS+= ../modules/crypto/overivew/slides.tex
16+
17+
STUDENTS?= user1 user2 user3
18+
19+
.PHONY: individualized
20+
individualized: $(foreach id,${STUDENTS}, ${EXAM_NAME}-${id}.pdf)
21+
22+
EXAM_IDS+= ${STUDENTS}
23+
24+
EXAM_TAGS-user1= AnalyseNeededCryptoProperties
25+
EXAM_TAGS-user2= DesignSystemsByCombiningPrimitives
26+
EXAM_TAGS-user3= EvaluateSecureDesigns
27+
28+
$(foreach id,${STUDENTS},$(eval EXAM_FLAGS-${id}=-NCi))
29+
30+
31+
INCLUDE_MAKEFILES=<submodule_prefix>/makefiles
32+
include ${INCLUDE_MAKEFILES}/tex.mk
33+
include ${INCLUDE_MAKEFILES}/exam.mk

exam.tex

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
\documentclass[addpoints]{exam}
2+
\input{preamble.tex}
3+
\usepackage{color}
4+
\usepackage{authblk}
5+
6+
%\printanswers
7+
8+
\title{<title>}
9+
\date{<iso-date>}
10+
\author{%
11+
<author>
12+
}
13+
\affil{%
14+
<affil>
15+
}
16+
17+
\begin{document}
18+
\maketitle
19+
\thispagestyle{foot}
20+
21+
\section*{Instructions}
22+
23+
Carefully read the questions before you start answering them.
24+
Note the time limit of the exam and plan your answers accordingly.
25+
(The questions are \emph{not} sorted by difficulty.)
26+
Only answer the question, do not write about subjects remotely related to the
27+
question.
28+
29+
Make sure you follow these rules:
30+
\begin{itemize}
31+
\item Write your answers on separate sheets, not on the exam paper.
32+
\item Only write on one side of the sheets.
33+
\item Start each question on a new sheet.
34+
\item Do not forget to \emph{motivate your answers.}
35+
\end{itemize}
36+
37+
Make sure you write your answers clearly: if the examiner cannot read an
38+
answer, the answer will be awarded zero(!) points --- even if the answer is
39+
correct.
40+
41+
\begin{description}
42+
\item[Time] 5 hours.
43+
\item[Aids] Dictionary.
44+
\item[Questions] \numquestions
45+
\item[Maximum points] \numpoints
46+
\end{description}
47+
48+
\subsection*{Grading}
49+
50+
Each question is worth three (3) points, representing how well you fulfil the
51+
intended learning outcomes covered by the question.
52+
The following grading criteria applies:
53+
\begin{description}
54+
\item[E] at least one point on each question.
55+
\item[D] closer to C than E.
56+
\item[C] at least two points on each question.
57+
\item[B] closer to A than C.
58+
\item[A] at least three points on each question.
59+
\end{description}
60+
61+
62+
\clearpage
63+
\section*{Questions}
64+
65+
The questions are given below in uniformly random order.
66+
67+
\begin{questions}
68+
\input{questions-<date>.tex}
69+
\end{questions}
70+
71+
72+
\printbibliography
73+
\end{document}
74+

preamble.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
\usepackage[natbib,style=alphabetic,maxbibnames=99]{biblatex}
1111
\addbibresource{<package>.bib}
1212

13+
\usepackage{subfigure}
14+
1315
\usepackage[noend]{algpseudocode}
1416
\usepackage{xparse}
1517

texgen.nw

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ program code.
156156
\item[-s] toggles slides.
157157
\item[-w] toggles NOWEB source code.
158158
\item[-l] toggles letter.
159+
\item[-e] toggles exam.
159160
\item[-p] toggles preamble.
160161
\item[-a] toggles abstract.
161162
\item[-c] toggles contents.
@@ -215,16 +216,21 @@ long_usage="${long_usage}\n-c\ttoggles contents"
215216
shift;;
216217
@
217218

218-
We also have the letter, which is the same as for notes and the slides.
219+
We also have the letter and exam, which are the same as for notes and the
220+
slides.
219221
<<variables>>=
220-
options="${options}l"
221-
usage="${usage} [-l]"
222+
options="${options}le"
223+
usage="${usage} [-l] [-e]"
222224
long_usage="${long_usage}\n-l\ttoggles letter"
225+
long_usage="${long_usage}\n-e\ttoggles exam"
223226
@ Then we do the same when processing this too.
224227
<<arguments handler code>>=
225228
-l)
226229
files="${files} letter.tex"
227230
shift;;
231+
-e)
232+
files="${files} exam.tex"
233+
shift;;
228234
@
229235

230236
Next, there are the standard files part of any repository: general
@@ -364,9 +370,12 @@ done
364370
@ Now the question is what values to substitute.
365371

366372
There are some values that we can substitute automatically, e.g.\ dates.
367-
We will substitute [[<year>]] with the current year.
373+
We will substitute [[<year>]] with the current year, [[<date>]] with the
374+
current date and [[<iso-date>]] with the current date in ISO-format.
368375
<<run sed(1) on file>>=
369376
sed -i "s/<year>/$(date +%Y)/g" ${f}
377+
sed -i "s/<date>/$(date +%y%m%d)/g" ${f}
378+
sed -i "s/<iso-date>/$(date +%Y-%m-%d)/g" ${f}
370379
@
371380

372381
\subsection{Getting the values to substitute}
@@ -504,6 +513,17 @@ sed -i "s/<submodule_prefix>/${submodule_prefix## }/g" ${f}
504513
\lstinputlisting[language={[latex]tex}]{letter.tex}
505514

506515

516+
\section{Template for exams}
517+
518+
\subsection{Main file for exam}
519+
520+
\lstinputlisting[language={[latex]tex}]{exam.tex}
521+
522+
\subsection{Makefile for exams}
523+
524+
\lstinputlisting{Makefile.exam}
525+
526+
507527
\section{Template for NOWEB programs}
508528

509529
\subsection{NOWEB source code}

0 commit comments

Comments
 (0)