diff options
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r-- | Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx | 66 |
1 files changed, 44 insertions, 22 deletions
diff --git a/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx b/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx index 0f49fa33c05..570be45c7da 100644 --- a/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx +++ b/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx @@ -40,7 +40,7 @@ \end{document} %</driver> %\fi -%\CheckSum{553} +%\CheckSum{589} %\RecordChanges %\changes{v1.0}{2016/09/26}{Initial version.} %\changes{v1.1}{2016/10/17}{Added two from four exam mode.} @@ -49,10 +49,11 @@ %\changes{v1.1.2}{2016/10/29}{Add page numbers and multiple choice elements.} %\changes{v1.1.3}{2016/11/15}{Fixed question totals when using sub/subsubparts.} %\changes{v1.1.4}{2016/11/21}{Fixed turn-over prompts given page numbering change.} +%\changes{v1.2.0}{2017/03/14}{Added A-Only Exam Type.} %\pagestyle{fancy} %\title{Bangor University Computer Science Department\\ Exam Document Class} %\author{Cameron Gray \texttt{<c.gray@bangor.ac.uk>}} -%\date{November 15, 2016} +%\date{March 14, 2017} %\maketitle % %\begin{abstract} @@ -73,6 +74,9 @@ % %\oarg{ab} - produces a compulsory Section A and a `two from three' Section B %exam. +% +%\oarg{aonly} - produces a single section, all questions compulsory exam. +% %\oarg{twofour} - produces a single part `two from four' exam. % %The `answers' option controls the inclusion of solutions as part of the @@ -81,6 +85,9 @@ %|\documentclass[ab]{bangorexam}| - produces the student form of a Section A/B %exam paper. % +%|\documentclass[aonly]{bangorexam}| - produces the student form of an exam +%paper where all questions are compulsory. +% %|\documentclass[ab,answers]{bangorexam}| - produces the examiner form of the %paper. % @@ -278,11 +285,11 @@ %\end{macrocode} %\fi %\begin{macrocode} -\def\version{1.1.4 } +\def\version{1.2.0 } \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{bangorexam}[2016/10/29 \version C. Gray] +\ProvidesClass{bangorexam}[2017/03/14 \version C. Gray] % Based on the Exam document class by Philip S. Hirschhorn % Developed/Adapted for Bangor University by C. Gray @@ -312,8 +319,11 @@ \newcommand{\welATypeText}{Atebwch {\bf Adran A} (gorfodol) ac {\bf unrhyw ddau} gwestiwn o {\bf Adran B}.}% \newcommand{\engBTypeText}{Answer \textbf{two} out of four questions.}% \newcommand{\welBTypeText}{Atebwch \textbf{ddau} o'r pedwar cwestiwn.}% +\newcommand{\engCTypeText}{Answer all questions.}% +\newcommand{\welCTypeText}{Atebwch bob cwstiwn.}% \newcommand{\sectionAHeader}{\textbf{SECTION A} --- Answer \textbf{ALL} questions (Total marks \total{sectiona})}% \newcommand{\sectionBHeader}{\textbf{SECTION B} --- Answer any \textbf{TWO} questions (\total{sectionb} marks each)}% +\newcommand{\sectionAOnlyHeader}{Answer \textbf{ALL} questions (Total marks \total{sectiona})}% % ******************************************************************* % Class Level Options @@ -325,6 +335,7 @@ \newcommand{\welsh}{true}% \renewcommand{\sectionAHeader}{\textbf{ADRAN A} --- Atebwch BOB cwestiwn (Cyfanswm marciau \total{sectiona})}% \renewcommand{\sectionBHeader}{\textbf{ADRAN B} --- Atebwch unrhyw DDAU chwestiwn (\total{sectionb} marc yr un)}% + \renewcommand{\sectionAOnlyHeader}{Atebwch \textbf{BOB} cwestiwn (Cyfanswm marciau \total{sectiona})}% }% % Exam Type % ------------------------------------------------------------------- @@ -332,20 +343,26 @@ \newcommand{\welTypeText}{} \DeclareOption{ab}{% \newcommand{\examtype}{ab}% - \renewcommand{\engTypeText}{\engATypeText} - \renewcommand{\welTypeText}{\welATypeText} + \renewcommand{\engTypeText}{\engATypeText}% + \renewcommand{\welTypeText}{\welATypeText}% +}% +\DeclareOption{aonly}{% + \newcommand{\examtype}{aonly}% + \renewcommand{\engTypeText}{\engCTypeText}% + \renewcommand{\welTypeText}{\welCTypeText}% + \renewcommand{\sectionAHeader}{\sectionAOnlyHeader} }% \DeclareOption{twofour}{% \newcommand{\examtype}{twofour}% - \renewcommand{\engTypeText}{\engBTypeText} - \renewcommand{\welTypeText}{\welBTypeText} + \renewcommand{\engTypeText}{\engBTypeText}% + \renewcommand{\welTypeText}{\welBTypeText}% }% \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}% + \ClassError{bangorexam}{An exam type option has not been defined; use ab, aonly, or twofour in the class options.}% \fi% \LoadClass[a4paper,twoside,11pt,addpoints]{exam}% @@ -518,6 +535,7 @@ } \vspace*{8mm} }{}% + \ifthenelse{\equal{\examtype}{aonly}}{\sectiona}{}% } % ******************************************************************* @@ -527,10 +545,10 @@ \newcounter{secb} \newcommand{\inDoc}{none}% \newcommand{\sectiona} {% - \ifthenelse{\equal{\examtype}{twofour}}{\ClassError{bangorexam}{Section A defined in a 'two from four' exam}\relax}{}% + \ifthenelse{\equal{\examtype}{twofour}}{\ClassError{bangorexam}{Section A defined in a 'two from four' exam.}\relax}{}% \ifnumcomp{\value{seca}}{>}{0} { - \ClassError{bangorexam}{There is already a Section A in this exam}\relax% + \ClassError{bangorexam}{There is already a Section A in this exam.}\relax% } { \stepcounter{seca}\relax% @@ -550,10 +568,11 @@ } \newcommand{\sectionb}{% -\ifthenelse{\equal{\examtype}{twofour}}{\ClassError{bangorexam}{Section B defined in a 'two from four' exam}\relax}{} +\ifthenelse{\equal{\examtype}{twofour}}{\ClassError{bangorexam}{Section B defined in a 'two from four' exam.}\relax}{} +\ifthenelse{\equal{\examtype}{aonly}}{\ClassError{bangorexam}{Section B defined in an 'A only' exam.}\relax}{} \ifnumcomp{\value{secb}}{>}{0} { - \ClassError{bangorexam}{There is already a Section B in this exam}\relax% + \ClassError{bangorexam}{There is already a Section B in this exam.}\relax% } { \stepcounter{secb}\relax% @@ -628,7 +647,7 @@ \setcounter{tmp}{0}% \addtocounter{tmp}{\value{question}}% \addtocounter{tmp}{-100} - \ClassError{bangorexam}{Section B question \arabic{tmp} does not have an equal number of points (Existing Section B question worth \arabic{sectionb})}\relax% + \ClassError{bangorexam}{Section B question \arabic{tmp} does not have an equal number of points (Existing Section B question worth \arabic{sectionb}).}\relax% }% }% {}% @@ -644,7 +663,7 @@ \ifnumcomp{\value{tf}}{=}{#1}% {}% {% - \ClassError{bangorexam}{Question \arabic{question} does not have an equal number of points (Existing question(s) worth \arabic{tf})}\relax% + \ClassError{bangorexam}{Question \arabic{question} does not have an equal number of points (Existing question(s) worth \arabic{tf}).}\relax% }% }% {}% @@ -680,19 +699,22 @@ \expandafter\ifstrequal\mytmp{4}% {\relax}% {% - \ClassError{bangorexam}{There is/are only (\numquestions) question(s) defined, there should be four}\relax% + \ClassError{bangorexam}{There is/are only (\numquestions) question(s) defined, there should be four.}\relax% }% }{% \ifnumcomp{\value{seca}}{=}{0}% {% - \ClassError{bangorexam}{There is no Section A defined in this exam}\relax% - }% - {\relax}% - \ifnumcomp{\value{secb}}{=}{0}% - {% - \ClassError{bangorexam}{There is no Section B defined in this exam}\relax% + \ClassError{bangorexam}{There is no Section A defined in this exam.}\relax% }% {\relax}% + \expandafter\ifstrequal\mytemp{ab} + {% + \ifnumcomp{\value{secb}}{=}{0}% + {% + \ClassError{bangorexam}{There is no Section B defined in this exam.}\relax% + }% + {\relax}% + }{}% }% } |