texlive[42502] Master/texmf-dist: bangorexam (13nov16)
commits+karl at tug.org
commits+karl at tug.org
Sun Nov 13 23:55:57 CET 2016
Revision: 42502
http://tug.org/svn/texlive?view=revision&revision=42502
Author: karl
Date: 2016-11-13 23:55:57 +0100 (Sun, 13 Nov 2016)
Log Message:
-----------
bangorexam (13nov16)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/bangorexam/bangorexam.pdf
trunk/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx
trunk/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls
Modified: trunk/Master/texmf-dist/doc/latex/bangorexam/bangorexam.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx 2016-11-13 22:55:45 UTC (rev 42501)
+++ trunk/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx 2016-11-13 22:55:57 UTC (rev 42502)
@@ -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 at 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 at adduppoints}[1]{%
- \edef\mytemp{{\inDoc}}%
- \expandafter\ifstrequal\mytemp{secA}%
+\newcommand{\be at adduppoints}[1]{%
+ \ifnumcomp{\value{question}}{=}{\value{lq}}
+ {% Same question
+ \addtocounter{lqp}{#1}%
+ }
+ {% Moved onto next question
+ \be at addpoints{\totalpoints}%
+ \setcounter{lq}{\value{question}}%
+ \setcounter{lqp}{0}%
+ \addtocounter{lqp}{#1}%
+ }%
+}
+
+\newcommand{\be at 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 at adduppoints{\totalpoints}%
+\be at 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
% *******************************************************************
Modified: trunk/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls 2016-11-13 22:55:45 UTC (rev 42501)
+++ trunk/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls 2016-11-13 22:55:57 UTC (rev 42502)
@@ -39,11 +39,11 @@
%% Right bracket \] Circumflex\^ Underscore\_
%% Grave accent \` Left brace\{ Vertical bar \|
%% Right brace \} Tilde \~}
-\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]
\RequirePackage[dvipsnames]{xcolor}
@@ -104,7 +104,7 @@
\pagestyle{headandfoot}%
\coverfooter{}{}{\iflastpage{}{/ troi drosodd\\/ turn over}{}}%
-\footer{}{}{\oddeven{}{\iflastpage{}{/ troi drosodd\\/ turn over}}}%
+\footer{}{\thepage}{\oddeven{}{\iflastpage{}{/ troi drosodd\\/ turn over}}}%
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
@@ -116,6 +116,9 @@
\newtotcounter{tf}
\newtotcounter{sectiona}
\newtotcounter{sectionb}
+\newcounter{lq}
+\newcounter{lqp}
+\setcounter{lq}{-1}
\newcommand{\school}[2] {%
\def \engSchool {\expandafter\MakeUppercase\expandafter{#1}}%
@@ -238,6 +241,7 @@
\setlength{\marginparwidth}{0pt}
\maketitle
\end{coverpages}
+\setcounter{page}{2}
\pointsinrightmargin
\ifthenelse{\equal{\examtype}{twofour}}{
\clearpage
@@ -299,6 +303,7 @@
}
\renewcommand{\questionshook}{%
+\setlength{\itemsep}{14pt}%
\edef\mytemp{{\inDoc}}%
\expandafter\ifstrequal\mytemp{secB}{\addtocounter{question}{100}}{}%
}
@@ -311,8 +316,21 @@
}
\newcommand{\be at adduppoints}[1]{%
- \edef\mytemp{{\inDoc}}%
- \expandafter\ifstrequal\mytemp{secA}%
+ \ifnumcomp{\value{question}}{=}{\value{lq}}
+ {% Same question
+ \addtocounter{lqp}{#1}%
+ }
+ {% Moved onto next question
+ \be at addpoints{\totalpoints}%
+ \setcounter{lq}{\value{question}}%
+ \setcounter{lqp}{0}%
+ \addtocounter{lqp}{#1}%
+ }%
+}
+
+\newcommand{\be at addpoints}[1]{%
+\edef\mytemp{{\inDoc}}%
+\expandafter\ifstrequal\mytemp{secA}%
{%
\addtocounter{sectiona}{#1}%
\addtocounter{all}{#1}%
@@ -329,7 +347,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%
}%
}%
{}%
@@ -352,7 +373,7 @@
}
\newcommand{\patchqnumaddpoints}{%
-\be at adduppoints{\totalpoints}%
+\be at adduppoints{\@points}%
}
\pointformat{[\thepoints]}
\pointname{\null\patchqnumaddpoints}
@@ -361,6 +382,12 @@
}
+\let\horizontalchoices\oneparchoices
+\let\endhorizontalchoices\endoneparchoices
+\let\horizontalcheckboxes\oneparcheckboxes
+\let\endhorizontalcheckboxes\endoneparcheckboxes
+
+
\AfterEndDocument{%
\edef\mytemp{{\examtype}}%
\expandafter\ifstrequal\mytemp{twofour}%
More information about the tex-live-commits
mailing list