-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuow-exam.cls
More file actions
98 lines (73 loc) · 2.61 KB
/
Copy pathuow-exam.cls
File metadata and controls
98 lines (73 loc) · 2.61 KB
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
%-----------------------------------------------------------
% LaTeX class for University of Warwick exams
% Copyright 2017 Michael B. Gale (m.gale@warwick.ac.uk)
%-----------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{uow-exam}[2017/09/19 UoW Exam Class]
\DeclareOption{answers}{
\PassOptionsToClass{\CurrentOption}{exam}
}
%% Process given options
\ProcessOptions\relax
\LoadClass[a4paper,12pt,addpoints,fleqn]{exam}
\pointsdroppedatright
\bracketedpoints
\setlength{\rightpointsmargin}{2.5cm}
% Use the times font
\usepackage{times}
\usepackage{etoolbox}
% Variables and commands to change them
\newcommand{\TheModuleCode}{CSXXX0}
\newcommand{\TheModuleName}{Module name}
\newcommand{\TheExamPeriod}{Summer 2018}
\newcommand{\TheExamsName}{Second Year Examinations}
\newcommand{\TheTimeAllowed}{2 hours}
\newcommand{\TheQuestionInstructions}{Answer \textbf{FOUR} questions.}
\newcommand{\TheOtherInstructions}{Read carefully the instructions on the answer book and make sure that the particulars required are entered on \textbf{each} answer book.}
\newcommand{\ModuleCode}[1]{\renewcommand{\TheModuleCode}{#1}}
\newcommand{\ModuleName}[1]{\renewcommand{\TheModuleName}{#1}}
\newcommand{\ExamPeriod}[1]{\renewcommand{\TheExamPeriod}{#1}}
\newcommand{\ExamsName}[1]{\renewcommand{\TheExamsName}{#1}}
\newcommand{\TimeAllowed}[1]{\renewcommand{\TheTimeAllowed}{#1}}
\newcommand{\QuestionInstructions}[1]{\renewcommand{\TheQuestionInstructions}{#1}}
\newcommand{\OtherInstructions}[1]{\renewcommand{\TheOtherInstructions}{#1}}
% Headers and footers
\pagestyle{headandfoot}
\header{\textbf{\TheModuleCode}}{\ifprintanswers \textbf{\color{red}SOLUTIONS} \else \fi}{\textbf{\TheExamPeriod}}
\footer{}{-~\thepage~-}{ \iflastpage{End}{Continued}}
% No indentation
\setlength{\parindent}{0mm}
\newcommand{\doublehrule}{{\hrule\vspace*{2pt}\hrule}}
% make heading
\newcommand{\MakeHeading}{
\textbf{THE UNIVERSITY OF WARWICK} \\
\textbf{\TheExamsName: \TheExamPeriod}\\
\textbf{\TheModuleName}\\
\doublehrule \vspace{\bigskipamount}
\normalfont
\textbf{Time allowed: \TheTimeAllowed.}\\
\TheQuestionInstructions \\
\TheOtherInstructions \\
\doublehrule \vspace{\smallskipamount}
\smallskip
}
% add lines between questions
\newtoggle{IsFirstQuestion}
\let\oldquestions\questions
\def\questions{
\oldquestions
\toggletrue{IsFirstQuestion}
\renewcommand{\question}{
\iftoggle{IsFirstQuestion}
{}
{\bigskip \hrule \bigskip \pagebreak}
\item
\togglefalse{IsFirstQuestion}}
}
\let\oldquestionsend\endquestions
\def\endquestions{
\oldquestionsend
\bigskip
\doublehrule
\bigskip
}