diff options
author | Karl Berry <karl@freefriends.org> | 2016-11-13 22:55:57 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-11-13 22:55:57 +0000 |
commit | 8e807bf7738d6b68003c2e29f1741b4d6767c1e8 (patch) | |
tree | 42b3d95cfd00c5e16306bae5a60d6363207fc514 /Master/texmf-dist/source/latex | |
parent | ec1d6615b3f8a002cfece585c65a79cde23b4a6e (diff) |
bangorexam (13nov16)
git-svn-id: svn://tug.org/texlive/trunk@42502 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r-- | Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx b/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx index 096d240aa1f..0d45d4074d4 100644 --- a/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx +++ b/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx @@ -40,12 +40,13 @@ \end{document} %</driver> %\fi -%\CheckSum{501} +%\CheckSum{536} %\RecordChanges %\changes{v1.0}{2016/09/26}{Initial version.} %\changes{v1.1}{2016/10/17}{Added two from four exam mode.} %\changes{v1.1.1}{2016/10/18}{Emergency bugfix for etoolkit interaction on %new documents.} +%\changes{v1.1.2}{2016/10/29}{Add page numbers and multiple choice elements.} %\pagestyle{fancy} %\title{Bangor University Computer Science Department\\ Exam Document Class} %\author{Cameron Gray \texttt{<c.gray@bangor.ac.uk>}} @@ -275,11 +276,11 @@ %\end{macrocode} %\fi %\begin{macrocode} -\def\version{1.1.1} +\def\version{1.1.2 } \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{bangorexam}[2016/10/18 \version{} C. Gray] +\ProvidesClass{bangorexam}[2016/10/29 \version C. Gray] % Based on the Exam document class by Philip S. Hirschhorn % Developed/Adapted for Bangor University by C. Gray @@ -357,7 +358,7 @@ % Footer \pagestyle{headandfoot}% \coverfooter{}{}{\iflastpage{}{/ troi drosodd\\/ turn over}{}}% -\footer{}{}{\oddeven{}{\iflastpage{}{/ troi drosodd\\/ turn over}}}% +\footer{}{\thepage}{\oddeven{}{\iflastpage{}{/ troi drosodd\\/ turn over}}}% % Cover Column Definition \newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} @@ -373,6 +374,9 @@ \newtotcounter{tf} \newtotcounter{sectiona} \newtotcounter{sectionb} +\newcounter{lq} +\newcounter{lqp} +\setcounter{lq}{-1} \newcommand{\school}[2] {% \def \engSchool {\expandafter\MakeUppercase\expandafter{#1}}% @@ -498,6 +502,7 @@ \setlength{\marginparwidth}{0pt} \maketitle \end{coverpages} + \setcounter{page}{2} \pointsinrightmargin \ifthenelse{\equal{\examtype}{twofour}}{ \clearpage @@ -565,6 +570,7 @@ % Patch Questions to make it Section-aware % ******************************************************************* \renewcommand{\questionshook}{% + \setlength{\itemsep}{14pt}% \edef\mytemp{{\inDoc}}% \expandafter\ifstrequal\mytemp{secB}{\addtocounter{question}{100}}{}% } @@ -576,9 +582,22 @@ \expandafter\ifstrequal\mytemp{secB}{\addtocounter{tmp}{-100}\arabic{tmp}}{\arabic{question}}% } -\newcommand{\be@adduppoints}[1]{% - \edef\mytemp{{\inDoc}}% - \expandafter\ifstrequal\mytemp{secA}% +\newcommand{\be@adduppoints}[1]{% + \ifnumcomp{\value{question}}{=}{\value{lq}} + {% Same question + \addtocounter{lqp}{#1}% + } + {% Moved onto next question + \be@addpoints{\totalpoints}% + \setcounter{lq}{\value{question}}% + \setcounter{lqp}{0}% + \addtocounter{lqp}{#1}% + }% +} + +\newcommand{\be@addpoints}[1]{% + \edef\mytemp{{\inDoc}}% + \expandafter\ifstrequal\mytemp{secA}% {% \addtocounter{sectiona}{#1}% \addtocounter{all}{#1}% @@ -595,7 +614,10 @@ \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})}\relax% + \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% }% }% {}% @@ -618,7 +640,7 @@ } \newcommand{\patchqnumaddpoints}{% -\be@adduppoints{\totalpoints}% +\be@adduppoints{\@points}% } \pointformat{[\thepoints]} \pointname{\null\patchqnumaddpoints} @@ -627,6 +649,15 @@ } % ******************************************************************* +% Multiple Choice commands. +% ******************************************************************* + +\let\horizontalchoices\oneparchoices +\let\endhorizontalchoices\endoneparchoices +\let\horizontalcheckboxes\oneparcheckboxes +\let\endhorizontalcheckboxes\endoneparcheckboxes + +% ******************************************************************* % End of document validation % ******************************************************************* |