texlive[43500] Master/texmf-dist: bangorexam (14mar17)

commits+karl at tug.org commits+karl at tug.org
Tue Mar 14 22:52:28 CET 2017


Revision: 43500
          http://tug.org/svn/texlive?view=revision&revision=43500
Author:   karl
Date:     2017-03-14 22:52:28 +0100 (Tue, 14 Mar 2017)
Log Message:
-----------
bangorexam (14mar17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/bangorexam/README.txt
    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/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bangorexam/README.txt	2017-03-14 21:52:14 UTC (rev 43499)
+++ trunk/Master/texmf-dist/doc/latex/bangorexam/README.txt	2017-03-14 21:52:28 UTC (rev 43500)
@@ -1,7 +1,7 @@
 Bangor University Computer Science Department
 Exam Document Class
 Cameron Gray <c.gray at bangor.ac.uk>
-September 26, 2016
+March 14, 2017
 
 Abstract
 Starting with the 2016/17 academic year, the Computer Science department at
@@ -17,6 +17,7 @@
 \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.
+[aonly] - produces a single section, all questions compulsory exam.
 [twofour] - produces a single part ‘two from four’ exam.
 
 The ‘answers’ option controls the inclusion of solutions as part of the output.

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	2017-03-14 21:52:14 UTC (rev 43499)
+++ trunk/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx	2017-03-14 21:52:28 UTC (rev 43500)
@@ -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 at 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,13 +343,19 @@
 \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}}%
@@ -345,7 +362,7 @@
 \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%
+				\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%
-			}%
-            {\relax}%
+        \expandafter\ifstrequal\mytemp{ab}
+    	{%
+	        \ifnumcomp{\value{secb}}{=}{0}%
+	            {%
+					\ClassError{bangorexam}{There is no Section B defined in this exam.}\relax%
+				}%
+	            {\relax}%
+	    }{}%
     }%
 }
 

Modified: trunk/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls	2017-03-14 21:52:14 UTC (rev 43499)
+++ trunk/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls	2017-03-14 21:52:28 UTC (rev 43500)
@@ -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,8 +68,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})}%
 
 
 \DeclareOption{welsh}{%
@@ -76,18 +79,25 @@
 \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}}%
@@ -94,7 +104,7 @@
 \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,6 +265,7 @@
 }
 \vspace*{8mm}
 }{}%
+\ifthenelse{\equal{\examtype}{aonly}}{\sectiona}{}%
 }
 
 \newcounter{seca}
@@ -261,10 +272,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%
@@ -284,10 +295,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%
@@ -359,7 +371,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%
                 }%
         }%
         {}%
@@ -375,7 +387,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%
                 }%
         }%
         {}%
@@ -405,19 +417,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%
+\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}%
+    }{}%
     }%
 }
 



More information about the tex-live-commits mailing list