diff options
author | Karl Berry <karl@freefriends.org> | 2016-10-09 22:59:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-10-09 22:59:03 +0000 |
commit | ca8c7aacb845a15368d8eb5901ad86a0d821c7ca (patch) | |
tree | f9b5bab83aee9611b4f3bcc7a938aad524c48423 /Master/texmf-dist | |
parent | 08b96c312c68a33902a948ab94b27b779eaed4cf (diff) |
bangorexam (9oct16)
git-svn-id: svn://tug.org/texlive/trunk@42242 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/bangorexam/README.txt | 143 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/bangorexam/bangorexam.pdf | bin | 0 -> 178908 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx | 585 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/bangorexam/bangorexam.ins | 30 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls | 318 |
5 files changed, 1076 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/bangorexam/README.txt b/Master/texmf-dist/doc/latex/bangorexam/README.txt new file mode 100644 index 00000000000..1cfe1775f7c --- /dev/null +++ b/Master/texmf-dist/doc/latex/bangorexam/README.txt @@ -0,0 +1,143 @@ +Bangor University Computer Science Department +Exam Document Class +Cameron Gray <c.gray@bangor.ac.uk> +September 26, 2016 + +Abstract +Starting with the 2016/17 academic year, the Computer Science department at +Bangor University have moved to LATEX for preparation of examination papers for all +taught courses. This was done for multiple reasons, including the reduction of burden +on support staff. +This package is the embodiment of that effort. It includes all of the elements needed +to produce an examination paper, including examiner’s copies with solutions included. + +1 Usage - Class Options + +The document class is activated (or loaded) using the usual LATEX command +\documentclass{bangorexam}. The class requires one of the following options to +control which ‘style’ of exam paper is produced. +[ab] - produces a compulsory Section A and a ‘two from three’ Section B exam. +[twofour] - produces a single part ‘two from four’ exam. + +The ‘answers’ option controls the inclusion of solutions as part of the output. +\documentclass[ab]{bangorexam} - produces the student form of a Section A/B +exam paper. +\documentclass[ab,answers]{bangorexam} - produces the examiner form of the +paper. + +2 Usage - Preamble Macros + +The class includes several macros that must be added to the document’s preamble. These +set important aspects such as the module code and title. + +\school{English name}{Welsh name} The name of the school setting this exam, provided in both English and Welsh. + +\module{code}{full name} The code (including the 3-letter prefix) and full name of the module. + +\examperiod{resit|s1|s2} Specifies the period of the exam, s1 for January/End of Semester 1, s2 for May/End of Semester 2, or resit for Supplementary exams (August Resits). + +\timeallowed{hours} The amount of time allowed in hours. This should be the numerical part only, e.g. \timeallowed{1\half} or \timeallowed{3}. + +3 Usage - Body Macros + +Various macros exist to typeset the questions within the exam paper. The macros listed +here are provided to comply with Bangor University’s style and formatting requirements. +Users should not adjust any formatting, font, header, footer, margin other other display +parameters. Please use \emph{} for italic text and \textbf{} for boldface fonts only. +The document class has been designed to support amsmath and amssymb mathematics +typesetting with the conventional font. + +\sectiona Only applies when class option ab is active. Begins the compulsory Section A. + +\sectionb Only applies when class option ab is active. Begins the student-choice Section B. + +\pointsdesc{description}Sets the suffix/descriptive text following a points value. This defaults to an empty string, so 5 points would be rendered as [5]. Setting \pointsdesc{%} would result in [5%]. + +\guidance{guidance text} Sets a ’guidance’ paragraph at the beginning of all question sections (at the start for two of four or both of section A and B if ab). + +\guidancea{guidance text} Sets a ’guidance’ paragraph at the start of section A only. + +\guidanceb{guidance text} Sets a ’guidance’ paragraph at the start of section B only. + +4 Usage - Environments + +There are three key environments questions, parts, and solution. These represent a +numbered sequence of questions, parts and sub-parts of one question, and a solution/answer +for a question respectively. + +4.1 Questions Environment + +All questions must be set within a questions environment. You may add other items, such +as explanations, images, scenarios etc., in this environment too. The most simple questions environment is as follows: +\begin{questions} +\end{questions} + +However, this will not actually produce any output. +Questions must be added with use of the \question macro. + +\question[points] Question Text + +This macro can only be used within the Questions environment and is used to typeset a +question. The optional argument sets the number of points/marks/percentage awarded for +correct answers. See the \pointsdesc macro for customisation options. +Whenever a new block is started (with \begin{questions}), the numbering begins at +1. (Questions, at present, can only be labelled with Arabic numerals.) + +4.2 Parts Environment + +Within a question, examiners may wish to have multiple sub-questions (a.k.a parts). This is provided for by the \begin{parts}...\end{parts} environment. Each sub-question +or part is handled with the part macro. + +\part[points] Part Text + +This macro can only be used within the parts environment and is used to typeset a subquestion. The optional parameter sets the number of points/marks/percentage awarded for +correct answers. See the \pointsdesc macro for customisation options. + +The parts environment may only be used within the questions environment, as in the +example below: +\begin{questions} +\question Use the graph in Figure 1 to answer the following: +\begin{parts} +\part Sub-question 1 +\part[10] Sub-question 2 +\end{parts} +\end{questions} + +Whenever a new block is started (with \begin{parts}), the sub-question numbering +begins with a). (Sub-questions, at present, can only be labelled with English letters). + +4.3 Solution Environment + +Following either a \question or \part, the examiner should include a solution block. +This block/environment will only be included if the answers class option is in effect. (See Class Options for more details). Any standard LaTeX content can be placed in a solution block. A minimal example is below: +\begin{questions} +\question A really hard question. +\begin{solution} +The answer is placed here. +\end{solution} +\end{questions} + +5 Usage - Multiple Choice Questions + +There are four environments that will allow typesetting of multiple choice selections +depending on the desired layout. All must be used within a Questions or Parts environment. +The first pair present a list of possible responses labelled with letters. The choices +environment presents one choice per line, whereas the horizontalchoices environment +lays out choices in a single paragraph, wrapping lines wherever necessary. +The second pair present tick or check boxes instead of labelled choices. A checkboxes +environment will again typeset options one to a line, and the horizontalcheckboxes +environment will present all options in one paragraph. +Within any of the four environments each choice is typeset using the choice macro. Please +note; there is no points argument for individual choices, this should be handled at the +question or part level. + +\choice Choice Text + +Typesets a single choice according to which environment it is placed in. +Solutions to multiple choice questions are handled somewhat differently. Instead of a +solutions environment, typeset the correct option using the correctchoice macro. + +\correctchoiceChoice Text + +Typeset the correct choice based on where the macro is placed. When answers is in effect, +the output of this macro will either highlight the option in boldface, or replace the checkbox with a tick.
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/bangorexam/bangorexam.pdf b/Master/texmf-dist/doc/latex/bangorexam/bangorexam.pdf Binary files differnew file mode 100644 index 00000000000..49724645919 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bangorexam/bangorexam.pdf diff --git a/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx b/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx new file mode 100644 index 00000000000..6287774a016 --- /dev/null +++ b/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx @@ -0,0 +1,585 @@ +%\iffalse +%<*package> +%% \CharacterTable +%% {Upper-case\A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case\a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits\0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar\$ Percent \% Ampersand \& +%% Acute accent \' Left paren\( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals\= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex\^ Underscore\_ +%% Grave accent \` Left brace\{ Vertical bar \| +%% Right brace \} Tilde \~} +%</package> +%\fi +% \iffalse +% Doc-Source file to use with LaTeX2e +% Copyright (C) 2016 Cameron Gray <c.gray@bangor.ac.uk>, all rights reserved. +% \fi +% \iffalse +%<*driver> +\documentclass[a4paper]{ltxdoc} + +\usepackage[top=2cm, bottom=2cm, right=2cm, left=2in, headsep=14pt]{geometry} +\usepackage{fancyhdr,courier} +\fancyhead[R]{\texttt{bangorexam} - Exam Document Class} +\renewcommand{\headrulewidth}{0.5pt} +\fancyfoot{} +\fancyfoot[R]{\thepage} +\setlength\parindent{0pt} +\hyphenpenalty=10000 +\hbadness=10000 +\sloppy +\begin{document} +\DocInput{bangorexam.dtx} +\end{document} +%</driver> +%\fi +%\CheckSum{432} +%\RecordChanges +%\changes{v1.0}{2016/09/26}{Initial version.} +%\pagestyle{fancy} +%\title{Bangor University Computer Science Department\\ Exam Document Class} +%\author{Cameron Gray \texttt{<c.gray@bangor.ac.uk>}} +%\date{September 26, 2016} +%\maketitle +% +%\begin{abstract} +%Starting with the 2016/17 academic year, the Computer Science department at +%Bangor University have moved to \LaTeX\ for preparation of examination papers +%for all taught courses. This was done for multiple reasons, including the +%reduction of burden on support staff. +% +%This package is the embodiment of that effort. It includes all of the +%elements needed to produce an examination paper, including examiner's copies +%with solutions included. +%\end{abstract} +% +%\section{Usage - Class Options} +%The document class is activated (or loaded) using the usual \LaTeX\ command +%|\documentclass{bangorexam}|. The class requires one of the following options +%to control which `style' of exam paper is produced. +% +%\oarg{ab} - produces a compulsory Section A and a `two from three' Section B +%exam. +%\oarg{twofour} - produces a single part `two from four' exam. +% +%The `answers' option controls the inclusion of solutions as part of the +%output. +% +%|\documentclass[ab]{bangorexam}| - produces the student form of a Section A/B +%exam paper. +% +%|\documentclass[ab,answers]{bangorexam}| - produces the examiner form of the +%paper. +% +%\section{Usage - Preamble Macros} +%The class includes several macros that must be added to the document's +%preamble. These set important aspects such as the module code and title. +% +%\ \\ +% +%\DescribeMacro{\school\marg{English name}\marg{Welsh name}} The name of the +%school setting this exam, provided in both English and Welsh. +% +%\ \\ +% +%\DescribeMacro{\module\marg{code}\marg{full name}} The code (including the +%3-letter prefix) and full name of the module. +% +%\ \\ +% +%\DescribeMacro{\examperiod\marg{resit\textbar{}s1\textbar{}s2}} Specifies +%the period of the exam, s1 for January/End of Semester 1, s2 for May/End of +%Semester 2, or resit for Supplementary exams (August Resits). +% +%\ \\ +% +%\DescribeMacro{\timeallowed\marg{hours}} The amount of time allowed in hours. +%This should be the numerical part only, e.g. |\timeallowed{1\half}| or +%|\timeallowed{3}|. +% +%\ \\ +% +%\section{Usage - Body Macros} +%Various macros exist to typeset the questions within the exam paper. The +%macros listed here are provided to comply with Bangor University's style and +%formatting requirements. Users should not adjust any formatting, font, +%header, footer, margin other other display parameters. Please use |\emph{}| +%for italic text and |\textbf{}| for boldface fonts only. The document class +%has been designed to support amsmath and amssymb mathematics typesetting +%with the conventional font. +% +%\ \\ +% +%\DescribeMacro{\sectiona} \[\emph{Only applies when class option ab is +%active.}\] Begins the compulsory Section A. +% +%\ \\ +% +%\DescribeMacro{\sectionb} \[\emph{Only applies when class option ab is +%active.}\] Begins the student-choice Section B. +% +%\ \\ +% +%\DescribeMacro{\pointsdesc\marg{description}} Sets the suffix/descriptive text +%following a points value. This defaults to an empty string, so 5 points would +%be rendered as |[5]|. Setting |\pointsdesc{%}| would result in |[5%]|. +% +%\ \\ +% +%\DescribeMacro{\guidance\marg{guidance text}} Sets a 'guidance' paragraph at +%the beginning of all question sections (at the start for two of four or both +%of section A and B if ab). +% +%\ \\ +% +%\DescribeMacro{\guidancea\marg{guidance text}} Sets a 'guidance' paragraph at +%the start of section A only. +% +%\ \\ +% +%\DescribeMacro{\guidanceb\marg{guidance text}} Sets a 'guidance' paragraph at +%the start of section B only. +% +%\ \\ +% +%\section{Usage - Environments} +%There are three key environments |questions|, |parts|, and |solution|. +%These represent a numbered sequence of questions, parts and sub-parts of one +%question, and a solution/answer for a question respectively. +% +%\subsection{Questions Environment} +%All questions must be set within a questions environment. You may add other +%items, such as explanations, images, scenarios etc., in this environment +%too. The most simple questions environment is as follows:\\ +%\begin{verbatim} +%\begin{questions} +%\end{questions} +%\end{verbatim} +%However, this will not actually produce any output. +% +%Questions must be added with use of the |\question| macro. +% +%\ \\ +% +%\DescribeMacro{\question\oarg{points} Question Text} This macro can only +%be used within the Questions environment and is used to typeset a question. +%The optional argument sets the number of points/marks/percentage awarded for +%correct answers. See the |\pointsdesc| macro for customisation options. +% +%Whenever a new block is started (with |\begin{questions}|), the numbering +%begins at 1. (Questions, at present, can only be labelled with Arabic +%numerals.) +% +%\subsection{Parts Environment} +%Within a question, examiners may wish to have multiple sub-questions (a.k.a +%parts). This is provided for by the |\begin{parts}...\end{parts}| +%environment. Each sub-question or part is handled with the part macro. +% +%\ \\ +% +%\DescribeMacro{\part\oarg{points} Part Text} This macro can only be used +%within the parts environment and is used to typeset a sub-question. The +%optional parameter sets the number of points/marks/percentage awarded for +%correct answers. See the |\pointsdesc| macro for customisation options. +% +%\ \\ +% +%The parts environment may only be used within the questions +%environment, as in the example below: +% +%\begin{verbatim} +%\begin{questions} +% \question Use the graph in Figure 1 to answer the following: +% \begin{parts} +%\part Sub-question 1 +%\part[10] Sub-question 2 +% \end{parts} +%\end{questions} +%\end{verbatim} +% +%\ \\ +% +%Whenever a new block is started (with |\begin{parts}|), the sub-question +%numbering begins with a). (Sub-questions, at present, can only be labelled +%with English letters). +% +%\subsection{Solution Environment} +%Following either a |\question| or |\part|, the examiner should include a +%solution block. This block/environment will only be included if the answers +%class option is in effect. (See Class Options for more details). Any standard +%LaTeX content can be placed in a solution block. A minimal example is below: +% +%\begin{verbatim} +%\begin{questions} +% \question A really hard question. +% \begin{solution} +%The answer is placed here. +% \end{solution} +%\end{questions} +%\end{verbatim} +% +%\ \\ +% +%\section{Usage - Multiple Choice Questions} +%There are four environments that will allow typesetting of multiple choice +%selections depending on the desired layout. All must be used within a +%Questions or Parts environment. +% +%The first pair present a list of possible responses labelled with letters. +%The |choices| environment presents one choice per line, whereas the +%|horizontalchoices| environment lays out choices in a single paragraph, +%wrapping lines wherever necessary. +% +%The second pair present tick or check boxes instead of labelled choices. +%A |checkboxes| environment will again typeset options one to a line, and the +%|horizontalcheckboxes| environment will present all options in one paragraph. +% +%Within any of the four environments each choice is typeset using the choice +%macro. Please note; there is no points argument for individual choices, this +%should be handled at the question or part level. +% +%\ \\ +% +%\DescribeMacro{\choice Choice Text} Typesets a single choice according to +%which environment it is placed in. +% +%Solutions to multiple choice questions are handled somewhat differently. +%Instead of a |solutions| environment, typeset the correct option using the +%|correctchoice| macro. +% +%\ \\ +% +%\DescribeMacro{\correctchoice Choice Text} Typeset the correct choice based +%on where the macro is placed. When |answers| is in effect, the output of +%this macro will either highlight the option in boldface, or replace the +%checkbox with a tick. +% +% +% +% +%\StopEventually{} +%\section{The Code} +%\iffalse +%\begin{macrocode} +%<*bangorexam.cls> +%\end{macrocode} +%\fi +%\begin{macrocode} +\def\version{1.0.0} + +\NeedsTeXFormat{LaTeX2e} + +\ProvidesClass{bangorexam}[2016/10/03 \version C. Gray] + +% Based on the Exam document class by Philip S. Hirschhorn +% Developed/Adapted for Bangor University by C. Gray + +\RequirePackage[dvipsnames]{xcolor} +\RequirePackage[T1]{fontenc} +\RequirePackage[UKenglish]{babel} +\RequirePackage[UKenglish]{isodate} +\RequirePackage[utf8]{inputenc} + +\RequirePackage{array} +\RequirePackage{color} +\RequirePackage{etoolbox} +\RequirePackage{graphicx} +\RequirePackage{ifthen} +\RequirePackage{letltxmacro} +\RequirePackage{newpxtext,newpxmath} +\RequirePackage{totcount} +\RequirePackage{xstring} + +\RequirePackage{courier} + +% ******************************************************************* +% Class Level Options +% ******************************************************************* + +% Enable Welsh headings, etc. Does not affect the cover sheet. +% ------------------------------------------------------------------- +\DeclareOption{welsh}{% +\newcommand{\welsh}{true}% +}% +% Exam Type +% ------------------------------------------------------------------- +\DeclareOption{ab}{% +\newtotcounter{sectiona}% +\newtotcounter{sectionb} +\newcommand{\examtype}{ab}% +\newcommand{\engTypeText}{Answer {\bf Section A} (compulsory) and {\bf any two} questions from {\bf Section B}.}% +\newcommand{\welTypeText}{Atebwch {\bf Adran A} (gorfodol) ac {\bf unrhyw ddau} gwestiwn o {\bf Adran B}.}% +\newcommand{\sectionAHeader}{\textbf{ADRAN A} --- Atebwch BOB cwestiwn (Cyfanswm marciau \total{sectiona})}% +\newcommand{\sectionBHeader}{\textbf{ADRAN B} --- Atebwch unrhyw DDAU chwestiwn (\total{sectionb} marc yr un)}% +\ifx\welsh\undefined% +\renewcommand{\sectionAHeader}{\textbf{SECTION A} --- Answer \textbf{ALL} questions (Total marks \total{sectiona})}% +\renewcommand{\sectionBHeader}{\textbf{SECTION B} --- Answer any \textbf{TWO} questions (\total{sectionb} marks each)}% +\fi% +}% +\DeclareOption{twofour}{% +\newcommand{\examtype}{twofour}% +\newcommand{\engTypeText}{Answer \textbf{two} out of four questions.}% +\newcommand{\welTypeTest}{Atebwch \textbf{ddau} o'r pedwar cwestiwn.}% +}% +\DeclareOption{answers}{\PassOptionsToClass{\CurrentOption}{exam}}% +\DeclareOption{draft}{\PassOptionsToClass{\CurrentOption}{exam}}% +\ProcessOptions\relax% + +\ifx\examtype\undefined% +\ClassError{bangorexam}{An exam type option has not been defined; use ab or twofour in the class options.}% +\fi% + +\LoadClass[a4paper,twoside,11pt,addpoints]{exam}% + +% ******************************************************************* +% Layout +% ******************************************************************* +% Page layout +\setlength{\parindent}{0mm}% +\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}% + +% Footer +\pagestyle{headandfoot}% +\coverfooter{}{}{\iflastpage{}{/ troi drosodd\\/ turn over}{}}% +\footer{}{}{\oddeven{}{\iflastpage{}{/ troi drosodd / turn over}}}% + +% Cover Column Definition +\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} + +\SolutionEmphasis{\color{red}} + +% ******************************************************************* +% Configuration Macros +% ******************************************************************* +\newcounter{tmp} +\newtotcounter{all} + +\newcommand{\school}[2] {% +\def \engSchool {\expandafter\MakeUppercase\expandafter{#1}}% +\def \welSchool {\expandafter\MakeUppercase\expandafter{#2}}% +}% +\newcommand{\module}[2]{% +\StrSubstitute{#1}{-}{}[\mTmp]% +\def \moduleCode {\expandafter\MakeUppercase\expandafter{\mTmp}}% +\def \moduleName {#2}% +}% +\newcommand{\examperiod}[1]{% +\setcounter{tmp}{\the\year}% +\ifnum \the\month>8% +\stepcounter{tmp}% +\newcommand{\examYear}{\arabic{tmp}}% +\else% +\newcommand{\examYear}{\arabic{tmp}}% +\fi% +\newcommand{\welSemesterText}{Arholiadau Diwedd Semester\ \welSemester}% +\newcommand{\engSemesterText}{End of Semester \engSemester\ Examinations}% +\ifthenelse{\equal{#1}{s1}}{% +\def \welSemester {Un}% +\def \engSemester {One}% +\def \welExamMonth {IONAWR}% +\def \engExamMonth {JANUARY}% +}{}% +\ifthenelse{\equal{#1}{s2}}{% +\def \welSemester {Dau}% +\def \engSemester {Two}% +\def \welExamMonth {MAI}% +\def \engExamMonth {MAY}% +}{}% +\ifthenelse{\equal{#1}{resit}}{% +\renewcommand{\welSemesterText}{Arholiadau Atodol}% +\renewcommand{\engSemesterText}{Supplementary Examination}% +\def \welExamMonth {AWST}% +\def \engExamMonth {AUGUST}% +}{}% +} + +\newcommand{\timeallowed}[1]{% +\def \timeAllowed {#1}% +} + +\newcommand{\guidance}[1]{% +\def \guidance@a {#1}% +\def \guidance@b {#1}% +} + +\newcommand{\guidancea}[1]{% +\def \guidance@a {#1}% +} + +\newcommand{\guidanceb}[1]{% +\def \guidance@b {#1}% +} + +% ******************************************************************* +% Cover Page +% ******************************************************************* + +\renewcommand{\maketitle}{% +\ifx\timeAllowed\undefined% +\ClassError{bangorexam}{The time allowed for this exam has not been defined (missing \backslash timealllowed?).}% +\fi% +\ifx\engExamMonth\undefined% +\ClassError{bangorexam}{The exam period for this exam has not been set (missing \backslash examperiod?).}% +\fi% +\ifx\moduleCode\undefined% +\ClassError{bangorexam}{The module details for this exam have not been specified (missing \backslash module?).}% +\fi% +\ifx\welSchool\undefined% +\ClassError{bangorexam}{The academic school setting this exam has not been defined (missing \backslash school?).}% +\fi% + +\begin{center} +\bfseries +\huge +PRIFYSGOL\\ +\large\mbox{}\\ +\huge +BANGOR\\ +\large\mbox{}\\ +\huge +UNIVERSITY + +\vfill +\Large +\welSchool \\ +\engSchool +\end{center} +\medskip +\large +\begin{tabular}{C{0.5\textwidth}C{0.5\textwidth}} +{\bf \welSemesterText\par\welExamMonth\ \examYear}\par\vspace*{\bigskipamount} +Amser a ganiateir:~\timeAllowed~awr &% +{\bf \engSemesterText\par\engExamMonth\ \examYear}\par\vspace*{\bigskipamount} +Time allowed:~\timeAllowed~hours +\end{tabular} + +\vspace*{20mm} +\LARGE +\begin{center} +{\bf \moduleCode\\ +\mbox{}\\ +\moduleName} + +\vfill +\large +{\welTypeText} \\ +{\engTypeText} \\ +\ + +\medskip +{\bf Total marks \total{all}} +\vfill +\end{center} +} +\AtBeginDocument{ +\begin{coverpages} +\setlength{\hoffset}{0mm} +\setlength{\marginparwidth}{0pt} +\maketitle +\end{coverpages} +\pointsinrightmargin +} + +% ******************************************************************* +% Section Commands +% ******************************************************************* +\newcommand{\hassectiona}{false}% +\newcommand{\hassectionb}{false}% +\newcommand{\inDoc}{none}% +\newcommand{\sectiona} {% +\ifthenelse{\equal{\examtype}{twofour}}{\ClassError{bangorexam}{\\sectiona used in a 'two from four' exam.}}{}% +\ifthenelse{\equal{\hassectiona}{true}}{\ClassError{bangorexam}{There is already a \\sectiona in this exam.}}{}% +\renewcommand{\hassectiona}{true}% +\renewcommand{\inDoc}{secA}% +\clearpage +{% +\LARGE +\textbf{\moduleCode: \quad \moduleName} + +\vspace*{8mm} +\large +\sectionAHeader +\ifcsdef{guidance@a}{\normalsize\par\guidance@a}{}% +} +\vspace*{8mm} +} + +\newcommand{\sectionb}{% +\ifthenelse{\equal{\examtype}{twofour}}{\ClassError{bangorexam}{\\sectionb used in a 'two from four' exam.}}{} +\ifthenelse{\equal{\hassectionb}{true}}{\ClassError{bangorexam}{There is already a \\sectionb in this exam.}}{} +\renewcommand{\hassectionb}{true} +\renewcommand{\inDoc}{secB} +\clearpage +{% +\large +\sectionBHeader +\ifcsdef{guidance@b}{\normalsize\par\guidance@b}{}% +} +\vspace*{8mm} +} + +% ******************************************************************* +% Patch Questions to make it Section-aware +% ******************************************************************* +\renewcommand{\questionshook}{% + \edef\mytemp{{\inDoc}}% + \expandafter\ifstrequal\mytemp{secB}{\addtocounter{question}{100}}{}% +} + +\renewcommand{\thequestion}{% + \edef\mytemp{{\inDoc}}% + \setcounter{tmp}{0}% + \addtocounter{tmp}{\value{question}}% + \expandafter\ifstrequal\mytemp{secB}{\addtocounter{tmp}{-100}\arabic{tmp}}{\arabic{question}}% +} + +\newcommand{\be@adduppoints}[1]{% + \edef\mytemp{{\inDoc}}% + \expandafter\ifstrequal\mytemp{secA}% + {% + \addtocounter{sectiona}{#1}% + \addtocounter{all}{#1}% + }% + {}% + \expandafter\ifstrequal\mytemp{secB}% + {% + \ifnumcomp{\value{sectionb}}{=}{0}% + {% + \addtocounter{sectionb}{#1}% + \addtocounter{all}{#1}% + \addtocounter{all}{#1}}% + {}% + \ifnumcomp{\value{sectionb}}{=}{#1}% + {}% + {% + \ClassError{bangorexam}{Section B question \arabic{question} does not have an equal number of points (Existing Section B question worth \arabic{sectionb})}% + }% + }% + {}% +} + +\newcommand{\patchqnumaddpoints}{% +\be@adduppoints{\totalpoints}% +} +\pointformat{[\thepoints]} +\pointname{\null\patchqnumaddpoints} +\newcommand{\pointsdec}[1]{% +\pointname{#1}\patchqnumaddpoints +} +% \end{macrocode}%\iffalse +% \begin{macrocode} +%</bangorexam.cls> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%\fi +%\Finale +\endinput
\ No newline at end of file diff --git a/Master/texmf-dist/source/latex/bangorexam/bangorexam.ins b/Master/texmf-dist/source/latex/bangorexam/bangorexam.ins new file mode 100644 index 00000000000..4e3252831e8 --- /dev/null +++ b/Master/texmf-dist/source/latex/bangorexam/bangorexam.ins @@ -0,0 +1,30 @@ +\input docstrip + +\preamble + + bangorexam.dtx + Copyright 2016 Cameron Gray/Bangor University <c.gray@bangor.ac.uk> + + This work may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either version 1.3 + of this license of (at your option) any later version. + The latest version of this license is in + http://www.latex-project.org/lppl.txt + and version 1.3 or later is part of all distributions of LaTeX + version 2005/12/01 or later. + + This work has the LPPL maintenance status `maintained'. + + The Current Maintainer of this work is Cameron Gray <c.gray@bangor.ac.uk>. + + This work consists of the files bangorexam.dtx and bangorexam.ins and the derived + file bangorexam.cls. + +\endpreamble + +\askforoverwritefalse +\generate{\file{bangorexam.cls}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{bangorexam.dtx}{bangorexam.cls,package}} +} + +\endbatchfile diff --git a/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls b/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls new file mode 100644 index 00000000000..7f6030d316f --- /dev/null +++ b/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls @@ -0,0 +1,318 @@ +%% +%% This is file `bangorexam.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% bangorexam.dtx (with options: `bangorexam.cls,package') +%% +%% bangorexam.dtx +%% Copyright 2016 Cameron Gray/Bangor University <c.gray@bangor.ac.uk> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Cameron Gray <c.gray@bangor.ac.uk>. +%% +%% This work consists of the files bangorexam.dtx and bangorexam.ins and the derived +%% file bangorexam.cls. +%% +%% \CharacterTable +%% {Upper-case\A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case\a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits\0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar\$ Percent \% Ampersand \& +%% Acute accent \' Left paren\( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals\= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex\^ Underscore\_ +%% Grave accent \` Left brace\{ Vertical bar \| +%% Right brace \} Tilde \~} +\def\version{1.0.0} + +\NeedsTeXFormat{LaTeX2e} + +\ProvidesClass{bangorexam}[2016/10/03 \version C. Gray] + + +\RequirePackage[dvipsnames]{xcolor} +\RequirePackage[T1]{fontenc} +\RequirePackage[UKenglish]{babel} +\RequirePackage[UKenglish]{isodate} +\RequirePackage[utf8]{inputenc} + +\RequirePackage{array} +\RequirePackage{color} +\RequirePackage{etoolbox} +\RequirePackage{graphicx} +\RequirePackage{ifthen} +\RequirePackage{letltxmacro} +\RequirePackage{newpxtext,newpxmath} +\RequirePackage{totcount} +\RequirePackage{xstring} + +\RequirePackage{courier} + + +\DeclareOption{welsh}{% +\newcommand{\welsh}{true}% +}% +\DeclareOption{ab}{% +\newtotcounter{sectiona}% +\newtotcounter{sectionb} +\newcommand{\examtype}{ab}% +\newcommand{\engTypeText}{Answer {\bf Section A} (compulsory) and {\bf any two} questions from {\bf Section B}.}% +\newcommand{\welTypeText}{Atebwch {\bf Adran A} (gorfodol) ac {\bf unrhyw ddau} gwestiwn o {\bf Adran B}.}% +\newcommand{\sectionAHeader}{\textbf{ADRAN A} --- Atebwch BOB cwestiwn (Cyfanswm marciau \total{sectiona})}% +\newcommand{\sectionBHeader}{\textbf{ADRAN B} --- Atebwch unrhyw DDAU chwestiwn (\total{sectionb} marc yr un)}% +\ifx\welsh\undefined% +\renewcommand{\sectionAHeader}{\textbf{SECTION A} --- Answer \textbf{ALL} questions (Total marks \total{sectiona})}% +\renewcommand{\sectionBHeader}{\textbf{SECTION B} --- Answer any \textbf{TWO} questions (\total{sectionb} marks each)}% +\fi% +}% +\DeclareOption{twofour}{% +\newcommand{\examtype}{twofour}% +\newcommand{\engTypeText}{Answer \textbf{two} out of four questions.}% +\newcommand{\welTypeTest}{Atebwch \textbf{ddau} o'r pedwar cwestiwn.}% +}% +\DeclareOption{answers}{\PassOptionsToClass{\CurrentOption}{exam}}% +\DeclareOption{draft}{\PassOptionsToClass{\CurrentOption}{exam}}% +\ProcessOptions\relax% + +\ifx\examtype\undefined% +\ClassError{bangorexam}{An exam type option has not been defined; use ab or twofour in the class options.}% +\fi% + +\LoadClass[a4paper,twoside,11pt,addpoints]{exam}% + +\setlength{\parindent}{0mm}% +\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}% + +\pagestyle{headandfoot}% +\coverfooter{}{}{\iflastpage{}{/ troi drosodd\\/ turn over}{}}% +\footer{}{}{\oddeven{}{\iflastpage{}{/ troi drosodd / turn over}}}% + +\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} + +\SolutionEmphasis{\color{red}} + +\newcounter{tmp} +\newtotcounter{all} + +\newcommand{\school}[2] {% +\def \engSchool {\expandafter\MakeUppercase\expandafter{#1}}% +\def \welSchool {\expandafter\MakeUppercase\expandafter{#2}}% +}% +\newcommand{\module}[2]{% +\StrSubstitute{#1}{-}{}[\mTmp]% +\def \moduleCode {\expandafter\MakeUppercase\expandafter{\mTmp}}% +\def \moduleName {#2}% +}% +\newcommand{\examperiod}[1]{% +\setcounter{tmp}{\the\year}% +\ifnum \the\month>8% +\stepcounter{tmp}% +\newcommand{\examYear}{\arabic{tmp}}% +\else% +\newcommand{\examYear}{\arabic{tmp}}% +\fi% +\newcommand{\welSemesterText}{Arholiadau Diwedd Semester\ \welSemester}% +\newcommand{\engSemesterText}{End of Semester \engSemester\ Examinations}% +\ifthenelse{\equal{#1}{s1}}{% +\def \welSemester {Un}% +\def \engSemester {One}% +\def \welExamMonth {IONAWR}% +\def \engExamMonth {JANUARY}% +}{}% +\ifthenelse{\equal{#1}{s2}}{% +\def \welSemester {Dau}% +\def \engSemester {Two}% +\def \welExamMonth {MAI}% +\def \engExamMonth {MAY}% +}{}% +\ifthenelse{\equal{#1}{resit}}{% +\renewcommand{\welSemesterText}{Arholiadau Atodol}% +\renewcommand{\engSemesterText}{Supplementary Examination}% +\def \welExamMonth {AWST}% +\def \engExamMonth {AUGUST}% +}{}% +} + +\newcommand{\timeallowed}[1]{% +\def \timeAllowed {#1}% +} + +\newcommand{\guidance}[1]{% +\def \guidance@a {#1}% +\def \guidance@b {#1}% +} + +\newcommand{\guidancea}[1]{% +\def \guidance@a {#1}% +} + +\newcommand{\guidanceb}[1]{% +\def \guidance@b {#1}% +} + + +\renewcommand{\maketitle}{% +\ifx\timeAllowed\undefined% +\ClassError{bangorexam}{The time allowed for this exam has not been defined (missing \backslash timealllowed?).}% +\fi% +\ifx\engExamMonth\undefined% +\ClassError{bangorexam}{The exam period for this exam has not been set (missing \backslash examperiod?).}% +\fi% +\ifx\moduleCode\undefined% +\ClassError{bangorexam}{The module details for this exam have not been specified (missing \backslash module?).}% +\fi% +\ifx\welSchool\undefined% +\ClassError{bangorexam}{The academic school setting this exam has not been defined (missing \backslash school?).}% +\fi% + +\begin{center} +\bfseries +\huge +PRIFYSGOL\\ +\large\mbox{}\\ +\huge +BANGOR\\ +\large\mbox{}\\ +\huge +UNIVERSITY + +\vfill +\Large +\welSchool \\ +\engSchool +\end{center} +\medskip +\large +\begin{tabular}{C{0.5\textwidth}C{0.5\textwidth}} +{\bf \welSemesterText\par\welExamMonth\ \examYear}\par\vspace*{\bigskipamount} +Amser a ganiateir:~\timeAllowed~awr &% +{\bf \engSemesterText\par\engExamMonth\ \examYear}\par\vspace*{\bigskipamount} +Time allowed:~\timeAllowed~hours +\end{tabular} + +\vspace*{20mm} +\LARGE +\begin{center} +{\bf \moduleCode\\ +\mbox{}\\ +\moduleName} + +\vfill +\large +{\welTypeText} \\ +{\engTypeText} \\ +\ + +\medskip +{\bf Total marks \total{all}} +\vfill +\end{center} +} +\AtBeginDocument{ +\begin{coverpages} +\setlength{\hoffset}{0mm} +\setlength{\marginparwidth}{0pt} +\maketitle +\end{coverpages} +\pointsinrightmargin +} + +\newcommand{\hassectiona}{false}% +\newcommand{\hassectionb}{false}% +\newcommand{\inDoc}{none}% +\newcommand{\sectiona} {% +\ifthenelse{\equal{\examtype}{twofour}}{\ClassError{bangorexam}{\\sectiona used in a 'two from four' exam.}}{}% +\ifthenelse{\equal{\hassectiona}{true}}{\ClassError{bangorexam}{There is already a \\sectiona in this exam.}}{}% +\renewcommand{\hassectiona}{true}% +\renewcommand{\inDoc}{secA}% +\clearpage +{% +\LARGE +\textbf{\moduleCode: \quad \moduleName} + +\vspace*{8mm} +\large +\sectionAHeader +\ifcsdef{guidance@a}{\normalsize\par\guidance@a}{}% +} +\vspace*{8mm} +} + +\newcommand{\sectionb}{% +\ifthenelse{\equal{\examtype}{twofour}}{\ClassError{bangorexam}{\\sectionb used in a 'two from four' exam.}}{} +\ifthenelse{\equal{\hassectionb}{true}}{\ClassError{bangorexam}{There is already a \\sectionb in this exam.}}{} +\renewcommand{\hassectionb}{true} +\renewcommand{\inDoc}{secB} +\clearpage +{% +\large +\sectionBHeader +\ifcsdef{guidance@b}{\normalsize\par\guidance@b}{}% +} +\vspace*{8mm} +} + +\renewcommand{\questionshook}{% + \edef\mytemp{{\inDoc}}% + \expandafter\ifstrequal\mytemp{secB}{\addtocounter{question}{100}}{}% +} + +\renewcommand{\thequestion}{% + \edef\mytemp{{\inDoc}}% + \setcounter{tmp}{0}% + \addtocounter{tmp}{\value{question}}% + \expandafter\ifstrequal\mytemp{secB}{\addtocounter{tmp}{-100}\arabic{tmp}}{\arabic{question}}% +} + +\newcommand{\be@adduppoints}[1]{% + \edef\mytemp{{\inDoc}}% + \expandafter\ifstrequal\mytemp{secA}% + {% + \addtocounter{sectiona}{#1}% + \addtocounter{all}{#1}% + }% + {}% + \expandafter\ifstrequal\mytemp{secB}% + {% + \ifnumcomp{\value{sectionb}}{=}{0}% + {% + \addtocounter{sectionb}{#1}% + \addtocounter{all}{#1}% + \addtocounter{all}{#1}}% + {}% + \ifnumcomp{\value{sectionb}}{=}{#1}% + {}% + {% + \ClassError{bangorexam}{Section B question \arabic{question} does not have an equal number of points (Existing Section B question worth \arabic{sectionb})}% + }% + }% + {}% +} + +\newcommand{\patchqnumaddpoints}{% +\be@adduppoints{\totalpoints}% +} +\pointformat{[\thepoints]} +\pointname{\null\patchqnumaddpoints} +\newcommand{\pointsdec}[1]{% +\pointname{#1}\patchqnumaddpoints +} +\endinput +%% +%% End of file `bangorexam.cls'. |