texlive[45507] Master/texmf-dist: bangorexam (9oct17)

commits+karl at tug.org commits+karl at tug.org
Tue Oct 10 00:05:14 CEST 2017


Revision: 45507
          http://tug.org/svn/texlive?view=revision&revision=45507
Author:   karl
Date:     2017-10-10 00:05:14 +0200 (Tue, 10 Oct 2017)
Log Message:
-----------
bangorexam (9oct17)

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-10-09 22:05:01 UTC (rev 45506)
+++ trunk/Master/texmf-dist/doc/latex/bangorexam/README.txt	2017-10-09 22:05:14 UTC (rev 45507)
@@ -1,7 +1,7 @@
 Bangor University Computer Science Department
 Exam Document Class
 Cameron Gray <c.gray at bangor.ac.uk>
-March 14, 2017
+October 6, 2017
 
 Abstract
 Starting with the 2016/17 academic year, the Computer Science department at
@@ -16,16 +16,18 @@
 The document class is activated (or loaded) using the usual LATEX command
 \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.
+[ab] - produces a compulsory Section A and an ‘n-from’ Section B exam.  This type defaults to 2 required to match previous behaviour.
 [aonly] - produces a single section, all questions compulsory exam.
-[twofour] - produces a single part ‘two from four’ exam.
+[nfrom] - produces a single part ‘n-from’ exam.
 
 The ‘answers’ option controls the inclusion of solutions as part of the output.
 \documentclass[ab]{bangorexam} - produces the student form of a Section A/B
 exam paper.
-\documentclass[ab,answers]{bangorexam} - produces the examiner form of the
-paper.
 
+\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[nfrom]{bangorexam} - produces the student form of an exam paper with a single section but n-from the total questions. \documentclass[ab,answers]{bangorexam} - produces the examiner form of the paper.
+
 2 Usage - Preamble Macros
 
 The class includes several macros that must be added to the document’s preamble. These
@@ -39,6 +41,8 @@
 
 \timeallowed{hours} The amount of time allowed in hours. This should be the numerical part only, e.g. \timeallowed{1\half} or \timeallowed{3}.
 
+\nfrom{number} The number of compulsory questions from the selection available in the options part of the exam.
+
 3 Usage - Body Macros
 
 Various macros exist to typeset the questions within the exam paper. The macros listed

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-10-09 22:05:01 UTC (rev 45506)
+++ trunk/Master/texmf-dist/source/latex/bangorexam/bangorexam.dtx	2017-10-09 22:05:14 UTC (rev 45507)
@@ -40,7 +40,7 @@
 \end{document}
 %</driver>
 %\fi
-%\CheckSum{589}
+%\CheckSum{627}
 %\RecordChanges
 %\changes{v1.0}{2016/09/26}{Initial version.}
 %\changes{v1.1}{2016/10/17}{Added two from four exam mode.}
@@ -52,10 +52,11 @@
 %\changes{v1.2.0}{2017/03/14}{Added A-Only Exam Type.}
 %\changes{v1.2.1}{2017/04/11}{Corrected a spelling mistake in Welsh.}
 %\changes{v1.2.2}{2017/06/26}{Changed resit description to 'Summer' due to change in regulations.}
+%\changes{v1.3.0}{2017/10/06}{Replaced exam types with generalised n-from forms, with or without a compulsory Section A.}
 %\pagestyle{fancy}
 %\title{Bangor University Computer Science Department\\ Exam Document Class}
 %\author{Cameron Gray \texttt{<c.gray at bangor.ac.uk>}}
-%\date{March 14, 2017}
+%\date{October 6, 2017}
 %\maketitle
 %
 %\begin{abstract}
@@ -74,12 +75,12 @@
 %|\documentclass{bangorexam}|.  The class requires one of the following options
 %to control which `style' of exam paper is produced.
 %
-%\oarg{ab} - produces a compulsory Section A and a `two from three' Section B
-%exam.
+%\oarg{ab} - produces a compulsory Section A and a `n-from' Section B
+%exam.  This type defaults to 2 required to match previous behaviour.
 %
 %\oarg{aonly} - produces a single section, all questions compulsory exam.
 %
-%\oarg{twofour} - produces a single part `two from four' exam.
+%\oarg{nfrom} - produces a single part `n-from' exam.
 %
 %The `answers' option controls the inclusion of solutions as part of the
 %output.
@@ -90,6 +91,9 @@
 %|\documentclass[aonly]{bangorexam}| - produces the student form of an exam
 %paper where all questions are compulsory.
 %
+%|\documentclass[nfrom]{bangorexam}| - produces the student form of an exam
+%paper with a single section but n-from the total questions.
+%
 %|\documentclass[ab,answers]{bangorexam}| - produces the examiner form of the
 %paper.
 %
@@ -111,7 +115,7 @@
 %
 %\DescribeMacro{\examperiod\marg{resit\textbar{}s1\textbar{}s2}} Specifies
 %the period of the exam, s1 for January/End of Semester 1, s2 for May/End of
-%Semester 2, or resit for Supplementary exams (August Resits).
+%Semester 2, or resit for Supplementary exams (Summer Resits).
 %
 %\ \\
 %
@@ -121,6 +125,11 @@
 %
 %\ \\
 %
+%\DescribeMacro{\nfrom\marg{number}} The number of compulsory questions from
+%the selection available in the options part of the exam.
+%
+%\ \\
+%
 %\section{Usage - Body Macros}
 %Various macros exist to typeset the questions within the exam paper.  The
 %macros listed here are provided to comply with Bangor University's style and
@@ -287,11 +296,11 @@
 %\end{macrocode}
 %\fi
 %\begin{macrocode}
-\def\version{1.2.2 }
+\def\version{1.3.0 }
 
 \NeedsTeXFormat{LaTeX2e}
 
-\ProvidesClass{bangorexam}[2017/04/11 \version C. Gray]
+\ProvidesClass{bangorexam}[2017/10/06 \version C. Gray]
 
 % Based on the Exam document class by Philip S. Hirschhorn
 % Developed/Adapted for Bangor University by C. Gray
@@ -305,6 +314,7 @@
 \RequirePackage{array}
 \RequirePackage{color}
 \RequirePackage{etoolbox}
+\RequirePackage{forloop}
 \RequirePackage{graphicx}
 \RequirePackage{letltxmacro}
 \RequirePackage{newpxtext,newpxmath}
@@ -317,14 +327,14 @@
 % Strings
 % *******************************************************************
 
-\newcommand{\engATypeText}{Answer {\bf Section A} (compulsory) and {\bf any two} questions from {\bf Section B}.}%
-\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{\engATypeText}{Answer {\bf Section A} (compulsory) and {\bf any \arabic{qN}} questions from {\bf Section B}.}%
+\newcommand{\welATypeText}{Atebwch {\bf Adran A} (gorfodol) ac {\bf unrhyw \arabic{qN}} gwestiwn o {\bf Adran B}.}%
+\newcommand{\engBTypeText}{Answer any \textbf{\arabic{qN}} questions.}%
+\newcommand{\welBTypeText}{Atebwch unrhyw \textbf{\arabic{qN}} o'r pedwar cwestiwn.}%
 \newcommand{\engCTypeText}{Answer all questions.}%
 \newcommand{\welCTypeText}{Atebwch bob cwestiwn.}%
 \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{\sectionBHeader}{\textbf{SECTION B} --- Answer any \textbf{\arabic{qN}} questions (\total{sectionb} marks each)}%
 \newcommand{\sectionAOnlyHeader}{Answer \textbf{ALL} questions (Total marks \total{sectiona})}%
 
 % *******************************************************************
@@ -336,11 +346,13 @@
 \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{\sectionBHeader}{\textbf{ADRAN B} --- Atebwch unrhyw \textbf{\arabic{qN}} chwestiwn (\total{sectionb} marc yr un)}%
 	\renewcommand{\sectionAOnlyHeader}{Atebwch \textbf{BOB} cwestiwn (Cyfanswm marciau \total{sectiona})}%
 }%
 % Exam Type
 % -------------------------------------------------------------------
+\newcounter{qN}
+\newcommand{\nfrom}[1]{\setcounter{qN}{#1}}
 \newcommand{\engTypeText}{}
 \newcommand{\welTypeText}{}
 \DeclareOption{ab}{%
@@ -347,24 +359,31 @@
 	\newcommand{\examtype}{ab}%
 	\renewcommand{\engTypeText}{\engATypeText}%
 	\renewcommand{\welTypeText}{\welATypeText}%
+	\nfrom{2}%
 }%
 \DeclareOption{aonly}{%
 	\newcommand{\examtype}{aonly}%
 	\renewcommand{\engTypeText}{\engCTypeText}%
 	\renewcommand{\welTypeText}{\welCTypeText}%
-	\renewcommand{\sectionAHeader}{\sectionAOnlyHeader}
+	\renewcommand{\sectionAHeader}{\sectionAOnlyHeader}%
 }%
 \DeclareOption{twofour}{%
-	\newcommand{\examtype}{twofour}%
+	\newcommand{\examtype}{nfrom}%
 	\renewcommand{\engTypeText}{\engBTypeText}%
 	\renewcommand{\welTypeText}{\welBTypeText}%
+	\nfrom{2}%
 }%
+\DeclareOption{nfrom}{%
+	\newcommand{\examtype}{nfrom}%
+	\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, aonly, or twofour in the class options.}%
+	\ClassError{bangorexam}{An exam type option has not been defined; use ab, aonly, or nfrom in the class options.}%
 \fi%
 
 \LoadClass[a4paper,twoside,11pt,addpoints]{exam}%
@@ -398,7 +417,9 @@
 \newcounter{lq}
 \newcounter{lqp}
 \setcounter{lq}{-1}
+\newcounter{loopnu}
 
+
 \newcommand{\school}[2] {%
 	\def \engSchool {\expandafter\MakeUppercase\expandafter{#1}}%
 	\def \welSchool {\expandafter\MakeUppercase\expandafter{#2}}%
@@ -525,7 +546,7 @@
 	\end{coverpages}
 	\setcounter{page}{2}
 	\pointsinrightmargin
-	\ifthenelse{\equal{\examtype}{twofour}}{
+	\ifthenelse{\equal{\examtype}{nfrom}}{
 		\clearpage
 		{%
 			\LARGE
@@ -547,7 +568,7 @@
 \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}{nfrom}}{\ClassError{bangorexam}{Section A defined in a 'n-from' exam.}\relax}{}%
 	\ifnumcomp{\value{seca}}{>}{0}
 		{
 			\ClassError{bangorexam}{There is already a Section A in this exam.}\relax%
@@ -570,7 +591,7 @@
 }
 
 \newcommand{\sectionb}{%
-\ifthenelse{\equal{\examtype}{twofour}}{\ClassError{bangorexam}{Section B defined in a 'two from four' exam.}\relax}{}
+\ifthenelse{\equal{\examtype}{nfrom}}{\ClassError{bangorexam}{Section B defined in an 'n-from' exam.}\relax}{}
 \ifthenelse{\equal{\examtype}{aonly}}{\ClassError{bangorexam}{Section B defined in an 'A only' exam.}\relax}{}
 	\ifnumcomp{\value{secb}}{>}{0}
 		{
@@ -640,8 +661,8 @@
             \ifnumcomp{\value{sectionb}}{=}{0}%
                 {%
                     \addtocounter{sectionb}{#1}%
-                    \addtocounter{all}{#1}%
-                    \addtocounter{all}{#1}}%
+                    \forloop{loopnu}{0}{\value{loopnu} < \value{qN}}{%
+                    \addtocounter{all}{#1}}}%
                 {}%
             \ifnumcomp{\value{sectionb}}{=}{#1}%
                 {}%
@@ -654,13 +675,13 @@
         }%
         {}%
    	 \edef\mytemp{{\examtype}}%
-     \expandafter\ifstrequal\mytemp{twofour}%
+     \expandafter\ifstrequal\mytemp{nfrom}%
 		{%
             \ifnumcomp{\value{tf}}{=}{0}%
                 {%
                     \addtocounter{tf}{#1}%
-                    \addtocounter{all}{#1}%
-                    \addtocounter{all}{#1}}%
+                    \forloop{loopnu}{0}{\value{loopnu} < \value{qN}}{%
+                    \addtocounter{all}{#1}}}%
                 {}%
             \ifnumcomp{\value{tf}}{=}{#1}%
                 {}%
@@ -695,14 +716,18 @@
 
 \AfterEndDocument{%
 	\edef\mytemp{{\examtype}}%
-    \expandafter\ifstrequal\mytemp{twofour}%
+    \expandafter\ifstrequal\mytemp{nfrom}%
     {%
         \edef\mytmp{\numquestions}%
-		\expandafter\ifstrequal\mytmp{4}%
-			{\relax}%
-			{%
-				\ClassError{bangorexam}{There is/are only (\numquestions) question(s) defined, there should be four.}\relax%
-			}%
+		\expandafter\ifnum\value{numquestions}>\value{qN}%
+			\relax%
+			\else%
+				\ifnum\value{numquestions}=\value{qN}%
+				\relax%
+				\else%
+				\ClassError{bangorexam}{There is/are only (\numquestions) question(s) defined, there should be at least \arabic{qN}.}\relax%
+				\fi
+			\fi%
     }{%
         \ifnumcomp{\value{seca}}{=}{0}%
             {%

Modified: trunk/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls	2017-10-09 22:05:01 UTC (rev 45506)
+++ trunk/Master/texmf-dist/tex/latex/bangorexam/bangorexam.cls	2017-10-09 22:05:14 UTC (rev 45507)
@@ -39,11 +39,11 @@
 %%   Right bracket \] Circumflex\^ Underscore\_
 %%   Grave accent  \` Left brace\{ Vertical bar  \|
 %%   Right brace   \} Tilde \~}
-\def\version{1.2.2 }
+\def\version{1.3.0 }
 
 \NeedsTeXFormat{LaTeX2e}
 
-\ProvidesClass{bangorexam}[2017/04/11 \version C. Gray]
+\ProvidesClass{bangorexam}[2017/10/06 \version C. Gray]
 
 
 \RequirePackage[dvipsnames]{xcolor}
@@ -55,6 +55,7 @@
 \RequirePackage{array}
 \RequirePackage{color}
 \RequirePackage{etoolbox}
+\RequirePackage{forloop}
 \RequirePackage{graphicx}
 \RequirePackage{letltxmacro}
 \RequirePackage{newpxtext,newpxmath}
@@ -64,14 +65,14 @@
 \RequirePackage{courier}
 
 
-\newcommand{\engATypeText}{Answer {\bf Section A} (compulsory) and {\bf any two} questions from {\bf Section B}.}%
-\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{\engATypeText}{Answer {\bf Section A} (compulsory) and {\bf any \arabic{qN}} questions from {\bf Section B}.}%
+\newcommand{\welATypeText}{Atebwch {\bf Adran A} (gorfodol) ac {\bf unrhyw \arabic{qN}} gwestiwn o {\bf Adran B}.}%
+\newcommand{\engBTypeText}{Answer any \textbf{\arabic{qN}} questions.}%
+\newcommand{\welBTypeText}{Atebwch unrhyw \textbf{\arabic{qN}} o'r pedwar cwestiwn.}%
 \newcommand{\engCTypeText}{Answer all questions.}%
 \newcommand{\welCTypeText}{Atebwch bob cwestiwn.}%
 \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{\sectionBHeader}{\textbf{SECTION B} --- Answer any \textbf{\arabic{qN}} questions (\total{sectionb} marks each)}%
 \newcommand{\sectionAOnlyHeader}{Answer \textbf{ALL} questions (Total marks \total{sectiona})}%
 
 
@@ -78,9 +79,11 @@
 \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{\sectionBHeader}{\textbf{ADRAN B} --- Atebwch unrhyw \textbf{\arabic{qN}} chwestiwn (\total{sectionb} marc yr un)}%
 \renewcommand{\sectionAOnlyHeader}{Atebwch \textbf{BOB} cwestiwn (Cyfanswm marciau \total{sectiona})}%
 }%
+\newcounter{qN}
+\newcommand{\nfrom}[1]{\setcounter{qN}{#1}}
 \newcommand{\engTypeText}{}
 \newcommand{\welTypeText}{}
 \DeclareOption{ab}{%
@@ -87,24 +90,31 @@
 \newcommand{\examtype}{ab}%
 \renewcommand{\engTypeText}{\engATypeText}%
 \renewcommand{\welTypeText}{\welATypeText}%
+\nfrom{2}%
 }%
 \DeclareOption{aonly}{%
 \newcommand{\examtype}{aonly}%
 \renewcommand{\engTypeText}{\engCTypeText}%
 \renewcommand{\welTypeText}{\welCTypeText}%
-\renewcommand{\sectionAHeader}{\sectionAOnlyHeader}
+\renewcommand{\sectionAHeader}{\sectionAOnlyHeader}%
 }%
 \DeclareOption{twofour}{%
-\newcommand{\examtype}{twofour}%
+\newcommand{\examtype}{nfrom}%
 \renewcommand{\engTypeText}{\engBTypeText}%
 \renewcommand{\welTypeText}{\welBTypeText}%
+\nfrom{2}%
 }%
+\DeclareOption{nfrom}{%
+\newcommand{\examtype}{nfrom}%
+\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, aonly, or twofour in the class options.}%
+\ClassError{bangorexam}{An exam type option has not been defined; use ab, aonly, or nfrom in the class options.}%
 \fi%
 
 \LoadClass[a4paper,twoside,11pt,addpoints]{exam}%
@@ -129,6 +139,7 @@
 \newcounter{lq}
 \newcounter{lqp}
 \setcounter{lq}{-1}
+\newcounter{loopnu}
 
 \newcommand{\school}[2] {%
 \def \engSchool {\expandafter\MakeUppercase\expandafter{#1}}%
@@ -253,7 +264,7 @@
 \end{coverpages}
 \setcounter{page}{2}
 \pointsinrightmargin
-\ifthenelse{\equal{\examtype}{twofour}}{
+\ifthenelse{\equal{\examtype}{nfrom}}{
 \clearpage
 {%
 \LARGE
@@ -272,7 +283,7 @@
 \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}{nfrom}}{\ClassError{bangorexam}{Section A defined in a 'n-from' exam.}\relax}{}%
 \ifnumcomp{\value{seca}}{>}{0}
 {
 \ClassError{bangorexam}{There is already a Section A in this exam.}\relax%
@@ -295,7 +306,7 @@
 }
 
 \newcommand{\sectionb}{%
-\ifthenelse{\equal{\examtype}{twofour}}{\ClassError{bangorexam}{Section B defined in a 'two from four' exam.}\relax}{}
+\ifthenelse{\equal{\examtype}{nfrom}}{\ClassError{bangorexam}{Section B defined in an 'n-from' exam.}\relax}{}
 \ifthenelse{\equal{\examtype}{aonly}}{\ClassError{bangorexam}{Section B defined in an 'A only' exam.}\relax}{}
 \ifnumcomp{\value{secb}}{>}{0}
 {
@@ -362,8 +373,8 @@
             \ifnumcomp{\value{sectionb}}{=}{0}%
                 {%
                     \addtocounter{sectionb}{#1}%
-                    \addtocounter{all}{#1}%
-                    \addtocounter{all}{#1}}%
+                    \forloop{loopnu}{0}{\value{loopnu} < \value{qN}}{%
+                    \addtocounter{all}{#1}}}%
                 {}%
             \ifnumcomp{\value{sectionb}}{=}{#1}%
                 {}%
@@ -376,13 +387,13 @@
         }%
         {}%
      \edef\mytemp{{\examtype}}%
-     \expandafter\ifstrequal\mytemp{twofour}%
+     \expandafter\ifstrequal\mytemp{nfrom}%
 {%
             \ifnumcomp{\value{tf}}{=}{0}%
                 {%
                     \addtocounter{tf}{#1}%
-                    \addtocounter{all}{#1}%
-                    \addtocounter{all}{#1}}%
+                    \forloop{loopnu}{0}{\value{loopnu} < \value{qN}}{%
+                    \addtocounter{all}{#1}}}%
                 {}%
             \ifnumcomp{\value{tf}}{=}{#1}%
                 {}%
@@ -411,14 +422,18 @@
 
 \AfterEndDocument{%
 \edef\mytemp{{\examtype}}%
-    \expandafter\ifstrequal\mytemp{twofour}%
+    \expandafter\ifstrequal\mytemp{nfrom}%
     {%
         \edef\mytmp{\numquestions}%
-\expandafter\ifstrequal\mytmp{4}%
-{\relax}%
-{%
-\ClassError{bangorexam}{There is/are only (\numquestions) question(s) defined, there should be four.}\relax%
-}%
+\expandafter\ifnum\value{numquestions}>\value{qN}%
+\relax%
+\else%
+\ifnum\value{numquestions}=\value{qN}%
+\relax%
+\else%
+\ClassError{bangorexam}{There is/are only (\numquestions) question(s) defined, there should be at least \arabic{qN}.}\relax%
+\fi
+\fi%
     }{%
         \ifnumcomp{\value{seca}}{=}{0}%
             {%



More information about the tex-live-commits mailing list