-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuob-cs-exam.cls
178 lines (145 loc) · 4.11 KB
/
uob-cs-exam.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
% UOB-CS-EXAM
%
% Created by Martijn Stam, Nicolas Wu (2017-2018).
% Updated by Alex Kavvos (2021-2023)
%
% You should also be given a template exam.tex which will serve as a model
% for your exam.
%
% This LaTeX class file is a modification of the standard `exam` class, to
% suit University of Bristol exam regulations. The class creates a title page
% when \maketitle is called, and automatically places an "END OF PAPER"
% marking at the end.
% NOTE: The cs-uob-exam.cls style will normally require you to run LaTeX
% several times when compiling final output, since it must calculate the
% number of questions and associated marks. If you do not run LaTeX enough
% times, the marks may be incorrectly calculated. **It is strongly
% recommended that you use latexmk to do this, as it will automatically run
% latex for you, and detect when no more reruns are required.**
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{uob-cs-exam}[2023/10/24 UoB CS Exam LaTeX class]
%% OPTIONS
%%% Flag for online exam instructions.
\newif\if@online
\@onlinefalse
\DeclareOption{online}{\@onlinetrue}
%%% Pass unknown options to exam.
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{exam}}
\ProcessOptions\relax
%% END OF OPTIONS
% load the exam class
\LoadClass[12pt, addpoints]{exam}
%MSM: loading package to ease layout etc.
% \usepackage{cmbright}
\usepackage{mlmodern}
\usepackage[T1]{fontenc}
\RequirePackage{soul} % to underline text
\RequirePackage{fmtcount} % to convert numbers into text
\RequirePackage[dvipsnames]{xcolor}
% set up exam.cls to provide correct UoB layout for questions
\marksnotpoints
\marginpointname{ \points}
%\renewcommand\thequestion{{\bfseries Q\arabic{question}}}
\qformat{\textbf{Question~\thequestion} (\totalpoints~\points) \hfill}
\pointsdroppedatright
\pointformat{(\themarginpoints)}
\setlength{\rightpointsmargin}{2.4cm}
% set up exam.cls to provide correct UoB page layout
\pagestyle{headandfoot}
\lhead{\ifcontinuation{\oddeven{}{(cont.)}}{}}
\chead{}
\rhead{\ifcontinuation{\oddeven{(cont.)}{}}{}}
\lfoot{}
\cfoot{{\bfseries Page \thepage\ of \numpages}}
\rfoot[]{
{
\bfseries
\iflastpage{
\vfill
\begin{center}
{\large\bfseries END OF PAPER}
\end{center}
}{
\ifincomplete%
{\oddeven{Turn Over/Qu.~continues \ldots}{Qu.~continues \ldots}}%
{\oddeven{Turn Over/\ldots}{}}%
}
}
}
% Colour parameters (incl. for solutions)
\CorrectChoiceEmphasis{\color{red}\bfseries}
\shadedsolutions
\definecolor{SolutionColor}{rgb}{1,0.9,0.9}
\renewcommand\maketitle{
\begin{center}
{
\large\bfseries
UNIVERSITY OF BRISTOL\\[5mm]
\When~Examination Period\\[5mm]
\Dept
}
\vspace*{15mm}
{
\large\bfseries
\Year~Examination for the Degrees of\\
\Degrees
}
\vspace*{2cm}
{\large\bfseries \Coms}\\
{\large\bfseries \Name}
\vspace*{15mm}
{
\large\bfseries
TIME ALLOWED:\\
\Time
\if@online
plus \UploadTime~to allow for collation and uploading of answers.
\else
% nothing for in person exams
\fi
}
\vspace*{10mm}
\ifprintanswers
{\Large\bfseries\color{Red}Answers}
\vspace*{10mm}
% This seems to be for printing ILOs. I assume that is something we no longer do.
%
% {
% \bfseries
% \ul{Intended Learning Outcomes:}
% }\\[2mm]
% \ILO
\else
% Rubric generation
{
\ifx\Rubrik\undefined
This paper contains \textbf{\numquestions} questions. \\
\textbf{All} answers will be marked. \\
The maximum for this paper is \textbf{\numpoints\ marks}.\\[5mm]
\else
{\Rubrik}
\fi
}
\fi
\vspace*{15mm}
% Other instructions
{
\bfseries
\ul{Other Instructions}\\[2mm]
\Instruct
}
\vfill
{
\if@online
% nothing here for online exams
\else
{
\large\bfseries
% Please write your student number on the answer booklet, as found on your uCard.\\[2mm]
TURN OVER ONLY WHEN TOLD TO START WRITING\\
}
\fi
}
\end{center}
\newpage
}