From 9567f224aed1af01ef4a8df55c8c01176c489106 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 14 Mar 2017 21:52:28 +0000 Subject: bangorexam (14mar17) git-svn-id: svn://tug.org/texlive/trunk@43500 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/bangorexam/bangorexam.cls | 47 ++++++++++++++-------- 1 file changed, 31 insertions(+), 16 deletions(-) (limited to 'Master/texmf-dist/tex/latex/bangorexam') diff --git a/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls b/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls index 15aae01ffb5..f15114cb42e 100644 --- a/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls +++ b/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls @@ -39,11 +39,11 @@ %% Right bracket \] Circumflex\^ Underscore\_ %% Grave accent \` Left brace\{ Vertical bar \| %% Right brace \} Tilde \~} -\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] \RequirePackage[dvipsnames]{xcolor} @@ -68,33 +68,43 @@ \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})}% \DeclareOption{welsh}{% \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})}% }% \newcommand{\engTypeText}{} \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}% @@ -255,16 +265,17 @@ Time allowed:~\timeAllowed~hours } \vspace*{8mm} }{}% +\ifthenelse{\equal{\examtype}{aonly}}{\sectiona}{}% } \newcounter{seca} \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% @@ -284,10 +295,11 @@ Time allowed:~\timeAllowed~hours } \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% @@ -359,7 +371,7 @@ Time allowed:~\timeAllowed~hours \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% }% }% {}% @@ -375,7 +387,7 @@ Time allowed:~\timeAllowed~hours \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% }% }% {}% @@ -405,19 +417,22 @@ Time allowed:~\timeAllowed~hours \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% +\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% +\ClassError{bangorexam}{There is no Section B defined in this exam.}\relax% }% {\relax}% + }{}% }% } -- cgit v1.2.3