texlive[68660] Master/texmf-dist: exesheet (26oct23)

commits+karl at tug.org commits+karl at tug.org
Thu Oct 26 21:52:22 CEST 2023


Revision: 68660
          https://tug.org/svn/texlive?view=revision&revision=68660
Author:   karl
Date:     2023-10-26 21:52:22 +0200 (Thu, 26 Oct 2023)
Log Message:
-----------
exesheet (26oct23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/exesheet/exesheet.pdf
    trunk/Master/texmf-dist/source/latex/exesheet/exesheet.dtx
    trunk/Master/texmf-dist/tex/latex/exesheet/exesheet.cls
    trunk/Master/texmf-dist/tex/latex/exesheet/exesheet.sty

Modified: trunk/Master/texmf-dist/doc/latex/exesheet/exesheet.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/exesheet/exesheet.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/exesheet/exesheet.dtx	2023-10-26 19:52:08 UTC (rev 68659)
+++ trunk/Master/texmf-dist/source/latex/exesheet/exesheet.dtx	2023-10-26 19:52:22 UTC (rev 68660)
@@ -23,7 +23,7 @@
 %<class>\ProvidesClass{exesheet}
 %<package>\ProvidesPackage{exesheet}
 %<*class|package>
-[2023/09/05 v2.2 .dtx exesheet file]
+[2023/10/25 v2.3 .dtx exesheet file]
 %</class|package>
 %<*driver>
 \documentclass{ltxdoc}
@@ -83,7 +83,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{1141}
+% \CheckSum{1200}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -149,6 +149,16 @@
 %        tasks environments
 %    - the answerspace option is set to false when answers are displayed}
 %
+% \changes{v2.3}{2023/10/24}{
+%    - new implementation of marking scheme checking:
+%        checking is done in points or totalpoints instead of exercise command,
+%    - correct ref macro for tablenuma using ref implementation in tasks, 
+%        available since 2020/08/19
+%    - new commands question* and answer* for executing code when 
+%        questions are displayed but not answers, or the contrary
+%    - using basic languages (with lower case first letter) instead of aliases
+%        in translations commands}
+%
 % \GetFileInfo{exesheet.dtx}
 %
 % \maketitle
@@ -244,7 +254,7 @@
 % You can redefine it using |\renewcommand|.
 % A better approach is to use macros from the \textsf{translations} 
 % package by Clemens Niederberger (which allows dynamic language switching), \eg 
-% |\DeclareTranslation{Swedish}{exesheet-exercise}{\"Ovning}}|.
+% |\DeclareTranslation{swedish}{exesheet-exercise}{\"Ovning}}|.
 %
 % \smallskip
 % \DescribeMacro{\labelexercise}
@@ -386,7 +396,7 @@
 % \DescribeEnv{enumerate} \DescribeMacro{\item}
 % Enumeration lists are used to represent questions and sub-questions
 % within exercises. To provide clear emphasis,
-% labels are formatted in bold. 
+% labels are typeset in bold. 
 % Additionally, these labels are aligned to the left, positioned at the start of the line
 % without indentation, and the vertical spacing between items
 % is increased compared to standard \LaTeX{} lists.
@@ -423,12 +433,15 @@
 %
 % Lists created with the \texttt{itemize} environment retain their default 
 % configuration
-% \footnote{The \texttt{french} option of the \textsf{babel} package
+% \footnote{However, the \texttt{french} option of the \textsf{babel} package
 % changes the behavior of \texttt{itemize} lists and employs long dashes
 % as labels for each list level.
 % This behavior can cause issues when mathematical content follows the dash
 % symbol, as it might be mistaken for the minus sign.
-% Thus the default \texttt{itemize} list style is reinstated.}.
+% Thus, with the option \texttt{setlist=true}, the default \LaTeX{}
+% \texttt{itemize} list style is 
+% reinstated. The \texttt{\bs frenchsetup} command (from the
+% \textsf{babel-french} package) can achieve several other settings.}.
 %
 % \medskip
 % \DescribeMacro{[setlist=\meta{bool}]}
@@ -751,14 +764,18 @@
 % we can also employ the simpler |\question|\marg{ques} and |\answer|\marg{ans} macros.
 % The visibility of \meta{ques} and \meta{ans} content is  
 % regulated by the same previous \texttt{output=\meta{opt}} key option.
-% This approach might be more fitting for brief questions and answers, such as when
-% you wish to display the answer immediately after each question item.
+% This approach might be more fitting when
+% you wish to display answers immediately after each question item.
 % The title ``\correctionname'' won't appear at the start
 % of each answer with the |\answer| macro. 
 % The answers are also formatted using |\correctionstyle|
 % if \texttt{output=both}.
 % However these commands do not support \texttt{verbatim} text within them,
-% unlike the \texttt{questions} and \texttt{answers} environments which do.
+% unlike the \texttt{questions} and \texttt{answers} environments.
+% 
+% \DescribeMacro{\question*}\DescribeMacro{\answer*}
+% When a code must be executed only when questions are displayed but not
+% answers, or the contrary, you have the starred versions \eg |\question*{\pagebreak}|.
 %
 % \bigskip
 % \DescribeMacro{\answerspace}
@@ -781,7 +798,7 @@
 % Of course the |\answerspace| macro is not meant to be used within \texttt{answers}
 % environments.
 %
-% \section{Marginal notes for marking scheme} 
+% \section{Marking scheme commands} 
 %
 % The \textsf{exesheet} package enables the display of a detailed marking
 % scheme in the margins, along with optional comments and explanations about answers.
@@ -1094,7 +1111,7 @@
 % \DescribeMacro{[checkpts=\meta{bool}]}
 % The marking scheme can be checked out
 % \footnote{Thanks to Denis Bitouzé for his suggestion about this feature.}
-% using the key-val option \texttt{checkpts=true};
+% using the key-val option \texttt{checkpts=true} (or just \texttt{checkpts});
 % the default value is \texttt{false}.
 %
 % \medskip
@@ -1109,20 +1126,21 @@
 % \end{center}
 % Both comma notation (\eg 4,5) and decimal point format (\eg 4.5)
 % may be accepted, depending on your chosen language.
-% The validation occurs at the beginning of the subsequent exercise. 
-% No warning messages will be presented at this level if no points are specified
-% for the questions.
+% The control is made at the beginning of the subsequent exercise,
+% inside |\points|, |\totalexe| or |totalpoints| macros.
+% No deep checking will be processed at this level if no points are displayed
+% for the questions inside the exercise (with \texttt{display=none} option).
 %
 % \medskip
 % \DescribeMacro{\totalsheet}
-% At the end of the sheet, the last exercise is checked, 
+% At the end of the document, the last exercise is checked, 
 % followed by a global examination of the entire sheet. 
-% This last task requires knowledge of the total points for the sheet. To achieve this, use
-% the |\totalsheet|\marg{total} macro in the preamble;
+% This last task requires knowledge of the total points for the sheet, which must be given
+% by the |\totalsheet|\marg{points} macro in the preamble;
 % otherwise, a warning message will be displayed.
-% If subtotals have been assigned to exercises, the overall comparison
+% If subtotals have been assigned to exercises and \emph{displayed}, the overall comparison
 % is made between the sum of these subtotals and the total points recorded
-% using the |\totalsheet| macro.
+% using |\totalsheet|.
 % If not, the evaluation encompasses the sum of points for each individual question.
 % A subsequent warning message indicates the outcome of this last verification.
 % Finally, a message indicates whether all scale controls have been successfully
@@ -1322,7 +1340,7 @@
 \@ifpackageloaded{geometry}{}{\RequirePackage{geometry}}
 \RequirePackage{xcolor}
 \RequirePackage[shortlabels]{enumitem}
-\RequirePackage{tasks}
+\RequirePackage{tasks}[2020/08/19]
 \RequirePackage{versions}
 \RequirePackage{fancybox}
 \RequirePackage{translations}
@@ -1353,65 +1371,65 @@
 \DeclareTranslationFallback{exesheet-pts}{pts}
 \DeclareTranslationFallback{exesheet-pt}{pt}
 
-\DeclareTranslation{English}{exesheet-exercise}{Exercise}
-\DeclareTranslation{English}{exesheet-subpart}{Part}
-\DeclareTranslation{English}{exesheet-annex}{Annex}
-\DeclareTranslation{English}{exesheet-ex}{Ex}
-\DeclareTranslation{English}{exesheet-points}{points}
-\DeclareTranslation{English}{exesheet-point}{point}
-\DeclareTranslation{English}{exesheet-correction}{Correction}
-\DeclareTranslation{English}{exesheet-pts}{pts}
-\DeclareTranslation{English}{exesheet-pt}{pt}
+\DeclareTranslation{english}{exesheet-exercise}{Exercise}
+\DeclareTranslation{english}{exesheet-subpart}{Part}
+\DeclareTranslation{english}{exesheet-annex}{Annex}
+\DeclareTranslation{english}{exesheet-ex}{Ex}
+\DeclareTranslation{english}{exesheet-points}{points}
+\DeclareTranslation{english}{exesheet-point}{point}
+\DeclareTranslation{english}{exesheet-correction}{Correction}
+\DeclareTranslation{english}{exesheet-pts}{pts}
+\DeclareTranslation{english}{exesheet-pt}{pt}
 
-\DeclareTranslation{French}{exesheet-exercise}{Exercice}
-\DeclareTranslation{French}{exesheet-subpart}{Partie}
-\DeclareTranslation{French}{exesheet-annex}{Annexe}
-\DeclareTranslation{French}{exesheet-ex}{Ex}
-\DeclareTranslation{French}{exesheet-points}{points}
-\DeclareTranslation{French}{exesheet-point}{point}
-\DeclareTranslation{French}{exesheet-correction}{Correction}
-\DeclareTranslation{French}{exesheet-pts}{pts}
-\DeclareTranslation{French}{exesheet-pt}{pt}
+\DeclareTranslation{french}{exesheet-exercise}{Exercice}
+\DeclareTranslation{french}{exesheet-subpart}{Partie}
+\DeclareTranslation{french}{exesheet-annex}{Annexe}
+\DeclareTranslation{french}{exesheet-ex}{Ex}
+\DeclareTranslation{french}{exesheet-points}{points}
+\DeclareTranslation{french}{exesheet-point}{point}
+\DeclareTranslation{french}{exesheet-correction}{Correction}
+\DeclareTranslation{french}{exesheet-pts}{pts}
+\DeclareTranslation{french}{exesheet-pt}{pt}
 
-\DeclareTranslation{German}{exesheet-exercise}{\"Ubung}
-\DeclareTranslation{German}{exesheet-subpart}{Teil}
-\DeclareTranslation{German}{exesheet-annex}{Anhang}
-\DeclareTranslation{German}{exesheet-ex}{\"Ub}
-\DeclareTranslation{German}{exesheet-points}{Punkte}
-\DeclareTranslation{German}{exesheet-point}{Punkt}
-\DeclareTranslation{German}{exesheet-correction}{Verbesserung}
-\DeclareTranslation{German}{exesheet-pts}{P.}
-\DeclareTranslation{German}{exesheet-pt}{P.}
+\DeclareTranslation{german}{exesheet-exercise}{\"Ubung}
+\DeclareTranslation{german}{exesheet-subpart}{Teil}
+\DeclareTranslation{german}{exesheet-annex}{Anhang}
+\DeclareTranslation{german}{exesheet-ex}{\"Ub}
+\DeclareTranslation{german}{exesheet-points}{Punkte}
+\DeclareTranslation{german}{exesheet-point}{Punkt}
+\DeclareTranslation{german}{exesheet-correction}{Verbesserung}
+\DeclareTranslation{german}{exesheet-pts}{P.}
+\DeclareTranslation{german}{exesheet-pt}{P.}
 
-\DeclareTranslation{Spanish}{exesheet-exercise}{Ejercicio}
-\DeclareTranslation{Spanish}{exesheet-subpart}{Parte}
-\DeclareTranslation{Spanish}{exesheet-annex}{Anexo}
-\DeclareTranslation{Spanish}{exesheet-ex}{Ej}
-\DeclareTranslation{Spanish}{exesheet-points}{puntos}
-\DeclareTranslation{Spanish}{exesheet-point}{punto}
-\DeclareTranslation{Spanish}{exesheet-correction}{Correcci\'on}
-\DeclareTranslation{Spanish}{exesheet-pts}{ptos}
-\DeclareTranslation{Spanish}{exesheet-pt}{pto}
+\DeclareTranslation{spanish}{exesheet-exercise}{Ejercicio}
+\DeclareTranslation{spanish}{exesheet-subpart}{Parte}
+\DeclareTranslation{spanish}{exesheet-annex}{Anexo}
+\DeclareTranslation{spanish}{exesheet-ex}{Ej}
+\DeclareTranslation{spanish}{exesheet-points}{puntos}
+\DeclareTranslation{spanish}{exesheet-point}{punto}
+\DeclareTranslation{spanish}{exesheet-correction}{Correcci\'on}
+\DeclareTranslation{spanish}{exesheet-pts}{ptos}
+\DeclareTranslation{spanish}{exesheet-pt}{pto}
 
-\DeclareTranslation{Italian}{exesheet-exercise}{Esercizio}
-\DeclareTranslation{Italian}{exesheet-subpart}{Parte}
-\DeclareTranslation{Italian}{exesheet-annex}{Annesso}
-\DeclareTranslation{Italian}{exesheet-ex}{Es}
-\DeclareTranslation{Italian}{exesheet-points}{punti}
-\DeclareTranslation{Italian}{exesheet-point}{punto}
-\DeclareTranslation{Italian}{exesheet-correction}{Correzione}
-\DeclareTranslation{Italian}{exesheet-pts}{pti}
-\DeclareTranslation{Italian}{exesheet-pt}{pt}
+\DeclareTranslation{italian}{exesheet-exercise}{Esercizio}
+\DeclareTranslation{italian}{exesheet-subpart}{Parte}
+\DeclareTranslation{italian}{exesheet-annex}{Annesso}
+\DeclareTranslation{italian}{exesheet-ex}{Es}
+\DeclareTranslation{italian}{exesheet-points}{punti}
+\DeclareTranslation{italian}{exesheet-point}{punto}
+\DeclareTranslation{italian}{exesheet-correction}{Correzione}
+\DeclareTranslation{italian}{exesheet-pts}{pti}
+\DeclareTranslation{italian}{exesheet-pt}{pt}
 
-\DeclareTranslation{Portuges}{exesheet-exercise}{Exerc\'icio}
-\DeclareTranslation{Portuges}{exesheet-subpart}{Parte}
-\DeclareTranslation{Portuges}{exesheet-annex}{Anexo}
-\DeclareTranslation{Portuges}{exesheet-ex}{Ex}
-\DeclareTranslation{Portuges}{exesheet-points}{pontos}
-\DeclareTranslation{Portuges}{exesheet-point}{ponto}
-\DeclareTranslation{Portuges}{exesheet-correction}{Corre\c c\~ao}
-\DeclareTranslation{Portuges}{exesheet-pts}{pts}
-\DeclareTranslation{Portuges}{exesheet-pt}{pt}
+\DeclareTranslation{portuges}{exesheet-exercise}{Exerc\'icio}
+\DeclareTranslation{portuges}{exesheet-subpart}{Parte}
+\DeclareTranslation{portuges}{exesheet-annex}{Anexo}
+\DeclareTranslation{portuges}{exesheet-ex}{Ex}
+\DeclareTranslation{portuges}{exesheet-points}{pontos}
+\DeclareTranslation{portuges}{exesheet-point}{ponto}
+\DeclareTranslation{portuges}{exesheet-correction}{Corre\c c\~ao}
+\DeclareTranslation{portuges}{exesheet-pts}{pts}
+\DeclareTranslation{portuges}{exesheet-pt}{pt}
 
 \newcommand*\exercisename{\GetTranslation{exesheet-exercise}}
 \newcommand*\subpartname{\GetTranslation{exesheet-subpart}}
@@ -1441,8 +1459,8 @@
 % are initially empty, but they allow you to customize the styling. For example:\\
 % |\renewcommand\labelexercisestyle{\sffamily}|.
 %
-% The |\exe at check| macro, responsible for verifying the marking scheme, will be defined
-% in section \ref{MSoptions}.
+% The |\exe at label| macro, which needs the |exe at check| counter, will be used
+% inside warning messages about the marking scheme (see section \ref{MSoptions}).
 %
 % By default, the table of contents includes both exercises and parts titles,
 % as controlled by the boolean |\ifexesheet at exetoc|. 
@@ -1452,25 +1470,28 @@
 % \begin{macro}{\exercise}
 %    \begin{macrocode}
 \newcounter{exercise}
+\newcounter{exe at check}
 
 \newcommand{\labelexercise}{\exercisename\space \theexercise}
 \newcommand{\labelexercisestyle}{}
 \newcommand*{\@exercise}[1][]{%
-    \ifexesheet at checkpts \exe at check{\labelexercise} \fi
-    % curiously, \exe at check must be performed before \refstepcounter
     \refstepcounter{exercise}
     \subsection*{\labelexercisestyle\labelexercise\enskip #1}
     \ifexesheet at exetoc
         \addcontentsline{toc}{subsection}{\labelexercise}
     \fi
+    \ifexesheet at checkpts
+    	\setcounter{exe at check}{\value{exercise}} 
+        \def\exe at label{\exercisename\space\theexe at check} 
+    \fi
 }
 \newcommand*{\@@exercise}[2][]{%
-    \ifexesheet at checkpts \exe at check{#2} \fi
     \subsection*{\labelexercisestyle #2\enskip #1}
     \setcounter{subpart}{0} % resets the parts counter
     \ifexesheet at exetoc
         \addcontentsline{toc}{subsection}{#2}
     \fi
+    \ifexesheet at checkpts \def\exe at label{#2} \fi
 }
 \newcommand{\exercise}{\@ifstar{\@@exercise}{\@exercise}}
 
@@ -1517,8 +1538,16 @@
 \newcommand{\exlabel}{\exname.~\theexercise}
 \newcommand{\exsepmark}{---}
 \newcommand{\@exe}{\bigskip\refstepcounter{exercise}
+    \ifexesheet at checkpts
+        \setcounter{exe at check}{\value{exercise}} 
+        \def\exe at label{\exname\space\theexe at check} 
+    \fi
     \par\noindent\textbf{\exlabel~\exsepmark}~}
 \newcommand{\@@exe}{\bigskip\refstepcounter{exercise}
+    \ifexesheet at checkpts
+        \setcounter{exe at check}{\value{exercise}} 
+        \def\exe at label{\exname\space\theexe at check} 
+    \fi
     \par\noindent\textbf{\exlabel}~}
 \newcommand{\exe}{\@ifstar{\@@exe}{\@exe}}
 
@@ -1558,8 +1587,7 @@
 }
 \ifexesheet at setlist
     \standardfrenchlists 
-    % must be executed here when exesheet is loaded after babel
-    \DisableKeyvalOption[action=warning,package=exesheet]{exesheet}{setlist}
+    % must be executed here (and not at begin doc) if loaded after babel
 \fi
 
 \newcommand\labelenumone{\arabic{task}.}
@@ -1567,7 +1595,7 @@
 
 \def\exs at process@setlist{% must be executed at begin document
   \ifexesheet at setlist
-    \standardfrenchlists % if exesheet is loaded before babel
+    \standardfrenchlists % executed at begin doc if loaded before babel
     \setlist[enumerate]{font=\bfseries}
     \setlist[enumerate,1]{topsep=1.5ex plus 1ex minus 1ex,leftmargin=1.5em}
   \fi
@@ -1586,7 +1614,7 @@
         column-sep=1em,label-align=right,
         item-indent=1.5em,label-width=1em,label-offset=0.5em,
         after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenum1}[\item](2)
-    \NewTasksEnvironment[label=\labelenuma,
+    \NewTasksEnvironment[label=\labelenuma,ref=\alph{task},
         column-sep=1em,label-align=right,
         item-indent=2.15em,label-width=1.6em,label-offset=0.5em,
         after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenuma}[\item](2)
@@ -1595,7 +1623,7 @@
         column-sep=1em,label-align=right,
         label-width=1em,label-offset=0.5em,
         after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenum1}[\item](2)
-    \NewTasksEnvironment[label=\labelenuma,
+    \NewTasksEnvironment[label=\labelenuma,ref=\alph{task},
         column-sep=1em,label-align=right,
         item-indent=2.15em,label-width=1.6em,label-offset=0.5em,
         after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenuma}[\item](2)
@@ -1826,22 +1854,28 @@
 % the preceding vertical space may become too wide.
 % \end{environment}
 %
-% \begin{macro}{\question}
+% \DescribeMacro{\question}\DescribeMacro{\question*}
 %    \begin{macrocode}
-\newcommand{\question}[1]{\ifexesheet at questions #1\fi}
+\newcommand{\@question}[1]{\ifexesheet at questions #1\fi}
+\newcommand{\@@question}[1]{%
+    \ifexesheet at questions\ifexesheet at answers \else #1\fi\fi}
+\newcommand{\question}{\@ifstar{\@@question}{\@question}}
 
 %    \end{macrocode}
-% \end{macro}
-% \begin{macro}{\answer}
+%
+% \DescribeMacro{\answer}\DescribeMacro{\answer*}
 %    \begin{macrocode}
-\newcommand{\answer}[1]{%
+\newcommand{\@answer}[1]{%
     \ifexesheet at answers%
         \ifexesheet at questions {\correctionstyle #1}\else #1\fi
     \fi
 }
+\newcommand{\@@answer}[1]{%
+    \ifexesheet at answers\ifexesheet at questions \else #1\fi\fi}
+\newcommand{\answer}{\@ifstar{\@@answer}{\@answer}}
 
 %    \end{macrocode}
-% \end{macro}
+%
 % \begin{macro}{\answerspace}
 % The |\answerspace| macro was suggested by Maxime Chupin
 % to allow students space for writing their answers on the provided paper.
@@ -1901,8 +1935,8 @@
 \def\exs at process@marginpos{
     \ifthenelse{\equal{\exesheet at marginpos}{left}}{
         \if at twoside%
-            \PackageWarningNoLine{exesheet}{The default `marginpos' option
-                \MessageBreak
+            \PackageWarningNoLine{exesheet}{The default `marginpos'
+                option \MessageBreak
                 for two-sided documents is `outer'.\MessageBreak
                 To change the side, use `inner'}
             \def\exesheet at marginpos{outer}
@@ -1915,8 +1949,8 @@
     }{% else if
     \ifthenelse{\equal{\exesheet at marginpos}{right}}{
         \if at twoside%
-            \PackageWarningNoLine{exesheet}{The default `marginpos' option
-                \MessageBreak
+            \PackageWarningNoLine{exesheet}{The default `marginpos'
+                option \MessageBreak
                 for two-sided documents is `outer'.\MessageBreak
                 To change the side, use `inner'}
             \def\exesheet at marginpos{outer}
@@ -2124,9 +2158,8 @@
 \newlength{\sum at exe}
 \newlength{\exe at total}
 \newlength{\sum at pts}
-\def\exe at label{none}
+\def\exe at currentlabel{none}
 \newboolean{scale at valid}
-\setboolean{scale at valid}{true}
 
 \gdef\gsetlength#1#2{% for obtaining global length values
     \begingroup
@@ -2143,22 +2176,23 @@
     \endgroup
 }
 
-\def\exe at check#1{
-    \ifthenelse{\lengthtest{\sum at pts = 0pt}\or\equal{\exe at label}{none}}{
-    % do not check, no \pts or first exercise begins
+\def\exe at check{ 
+    \ifthenelse{\lengthtest{\sum at pts = 0pt}}{
+    % do not check, no points or first exercise begins
+    \ifthenelse{\equal{\exe at currentlabel}{none}}{}{
+        \PackageWarningNoLine{exesheet}{\exe at currentlabel: 
+            \the\exe at total}}
     }{
         \ifthenelse{\lengthtest{\exe at total = \sum at pts}}{
-            \PackageWarningNoLine{exesheet}{\exe at label:
-                The scale of \the\exe at total\space is valid}
+            \PackageWarningNoLine{exesheet}{\exe at currentlabel:
+                Sum of points \the\exe at total\space is valid}
         }{
-        \PackageWarningNoLine{exesheet}{\exe at label:
-            Sum of points is 
-            \the\sum at pts\space instead of \the\exe at total}
+        \PackageWarningNoLine{exesheet}{\exe at currentlabel:
+            Sum of points is \the\sum at pts\space
+            instead of \the\exe at total}
         \setboolean{scale at valid}{false}
         }
-        \gsetlength{\sum at pts}{0pt}
-    }
-    \def\exe at label{#1} % for the upcoming exercise
+    } 
 }
 
 \def\exs at process@checkpts{
@@ -2173,58 +2207,82 @@
         \gsetlength{\sum at exe}{0pt}
         \gsetlength{\exe at total}{0pt}
         \gsetlength{\sum at pts}{0pt}
-        \AtEndDocument{
-            \ifthenelse{\equal{\exe at label}{none}}{
+        \setboolean{scale at valid}{true}
+        \AtEndDocument{% final checking (global)
+            \ifthenelse{\equal{\exe at currentlabel}{none}}{
+              \ifthenelse{\lengthtest{\sum at pts = 0pt}}{
+                \PackageWarningNoLine{exesheet}{checkpts: No points displayed}
+              }{
                 \ifthenelse{\lengthtest{\sheet at total = \sum at pts}}{
-                    \PackageWarningNoLine{exesheet}{Sum of points
-                        is valid: \the\sheet at total}  
+                    \PackageWarningNoLine{exesheet}{Total:
+                        Sum of points \the\sheet at total\space is valid}
                 }{
-                    \PackageWarningNoLine{exesheet}{Inconsistent 
-                        sum of points: 
-                        \the\sum at pts\space instead of \the\sheet at total}
-                    \setboolean{scale at valid}{false}
-                }
-            }{
-                \exe at check{end}
+                    \PackageWarningNoLine{exesheet}{Total:
+                        Sum of points is \the\sum at pts\space
+                        instead of \the\sheet at total}
+                }}
+            }{% last exercise and final checking
+              \exe at check
+              \ifthenelse{\lengthtest{\sum at exe} = 0pt}{
+                \PackageWarningNoLine{exesheet}{checkpts: No points displayed}
+                }{
                 \ifthenelse{\lengthtest{\sheet at total = \sum at exe}}{
-                    \PackageWarningNoLine{exesheet}{Sum of points
-                        is valid: \the\sheet at total}
+                    \PackageWarningNoLine{exesheet}{Total:
+                        Sum of points \the\sheet at total\space is valid}
                 }{
-                    \PackageWarningNoLine{exesheet}{Inconsistent
-                        sum of points:
-                        \the\sum at exe\space instead of \the\sheet at total}
+                    \PackageWarningNoLine{exesheet}{Total:
+                        Sum of points is \the\sum at exe\space
+                        instead of \the\sheet at total}
                     \setboolean{scale at valid}{false}
                 }
+                \ifthenelse{\boolean{scale at valid}}{
+                    \PackageWarningNoLine{exesheet}{
+                        Marking scheme checked without errors}
+                }{
+                    \PackageWarningNoLine{exesheet}{
+                        Marking scheme checked with ERRORS! See above}
+                }             
+              }  
             }
-            \ifthenelse{\boolean{scale at valid}}{
-                \PackageWarningNoLine{exesheet}{Scale is valid}
-            }{
-                \PackageWarningNoLine{exesheet}{INVALID SCALE! 
-                    Refer to above}
-            }
         }
     \fi
 }
 
 %    \end{macrocode}
-% \end{macro}
 %
-% \subsection{Marginal notes commands}
+% \subsection{Marking scheme commands}
 %
+% The |\check at points| macro, used by |\points| and |\totalexe|, triggers
+% the marking scheme control (with |\exe at check| defined above) and
+% sets label and lengths for the next exercise.
+%    \begin{macrocode}
+\newcommand*{\check at points}[1]{%
+    \ifexesheet at checkpts%
+        \exe at check% checks the previous exercise
+        \gdef\exe at currentlabel{\exe at label}% for the upcoming exercise 
+        \gsetlength{\sum at pts}{0pt}%
+        \gsetlength{\exe at total}{#1pt}%
+        \gaddtolength{\sum at exe}{#1pt}%
+    \fi%        
+}
+
+%    \end{macrocode}
+%
 % \begin{macro}{\points}
 %    \begin{macrocode}
 \definecolor{pointscolor}{named}{red}
 \newcommand{\pointsstyle}{%
     \small\mdseries\sffamily\color{pointscolor}\fbox}
-\newcommand*{\exesheet at points}[1]{\hfill
-    \pointsstyle{#1~%
-        \ifthenelse{\lengthtest{#1pt < 2pt}}{\pointname}{\pointsname}}
-    \ifexesheet at checkpts\gaddtolength{\sum at exe}{#1pt}\fi%
+\newcommand*{\points}[1]{%
+    \ifthenelse{\boolean{exesheet at questions}}{\hfill
+        \pointsstyle{#1~%
+            \ifthenelse{\lengthtest{#1pt < 2pt}}{\pointname}{\pointsname}}        
+        \check at points{#1}
+    }{}
 }
-\newcommand*{\points}[1]{%
-    \ifthenelse{\boolean{exesheet at questions}}{\exesheet at points{#1}}{}}
 
 %    \end{macrocode}
+% \end{macro}
 % To prevent spaces between the |\fbox| and its inner text,
 % percent symbols are necessary.
 % The test |#1 < 2| doesn't work with decimal numbers without |\lengthtest|,
@@ -2268,11 +2326,8 @@
         \mbox{}%
         \marginpar{\hspace{0pt}\markingstyle{\ovalbox{%
             \makebox[\ptsboxlength]{\ptsmark{#1}}}}}%
+        \check at points{#1}%
     \fi%
-    \ifexesheet at checkpts%
-        \gsetlength{\exe at total}{#1pt}%
-        \gaddtolength{\sum at exe}{#1pt}%
-    \fi%
     \ignorespaces
 }
 
@@ -2319,11 +2374,11 @@
                 \noindent\hspace{0pt}\notestyle #2%
             }{}%
         }%
+        \ifexesheet at checkpts%
+            \ifthenelse{\equal{#1}{}}{}{%
+                \gaddtolength{\sum at pts}{#1pt}}%
+        \fi%
     \fi%
-    \ifexesheet at checkpts%
-        \ifthenelse{\equal{#1}{}}{}{%
-            \gaddtolength{\sum at pts}{#1pt}}%
-    \fi%
     \ignorespaces
 }
 \newcommand{\@@note}[1]{%
@@ -2330,10 +2385,10 @@
     \ifexesheet at pts%
         \mbox{}%
         \marginpar{\noindent\hspace{0pt}\markingstyle{#1}}%
+        \ifexesheet at checkpts%
+            \gaddtolength{\sum at pts}{#1pt}%
+        \fi%
     \fi%
-    \ifexesheet at checkpts%
-        \gaddtolength{\sum at pts}{#1pt}%
-    \fi%
     \ignorespaces
 }
 \newcommand{\note}{\@ifstar{\@@note}{\@note}}
@@ -2353,8 +2408,7 @@
 % \begin{macro}{\exs at process@correct}
 %    \begin{macrocode}
 \def\exs at process@correct{     
-    \ifthenelse{\equal{\exesheet at correct}{false}}{
-        % do nothing
+    \ifthenelse{\equal{\exesheet at correct}{false}}{% do nothing    
     }{% else
     \@ifpackageloaded{schooldocs}{
         \ifthenelse{\equal{\exesheet at correct}{true}}{

Modified: trunk/Master/texmf-dist/tex/latex/exesheet/exesheet.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/exesheet/exesheet.cls	2023-10-26 19:52:08 UTC (rev 68659)
+++ trunk/Master/texmf-dist/tex/latex/exesheet/exesheet.cls	2023-10-26 19:52:22 UTC (rev 68660)
@@ -22,7 +22,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
 \ProvidesClass{exesheet}
-[2023/09/05 v2.2 .dtx exesheet file]
+[2023/10/25 v2.3 .dtx exesheet file]
 
 \RequirePackage{kvoptions}
 \DeclareBoolOption[true]{exetoc}

Modified: trunk/Master/texmf-dist/tex/latex/exesheet/exesheet.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/exesheet/exesheet.sty	2023-10-26 19:52:08 UTC (rev 68659)
+++ trunk/Master/texmf-dist/tex/latex/exesheet/exesheet.sty	2023-10-26 19:52:22 UTC (rev 68660)
@@ -22,7 +22,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
 \ProvidesPackage{exesheet}
-[2023/09/05 v2.2 .dtx exesheet file]
+[2023/10/25 v2.3 .dtx exesheet file]
 
 \@ifclassloaded{exesheet}{}{
     \RequirePackage{kvoptions}
@@ -70,7 +70,7 @@
 \@ifpackageloaded{geometry}{}{\RequirePackage{geometry}}
 \RequirePackage{xcolor}
 \RequirePackage[shortlabels]{enumitem}
-\RequirePackage{tasks}
+\RequirePackage{tasks}[2020/08/19]
 \RequirePackage{versions}
 \RequirePackage{fancybox}
 \RequirePackage{translations}
@@ -87,65 +87,65 @@
 \DeclareTranslationFallback{exesheet-pts}{pts}
 \DeclareTranslationFallback{exesheet-pt}{pt}
 
-\DeclareTranslation{English}{exesheet-exercise}{Exercise}
-\DeclareTranslation{English}{exesheet-subpart}{Part}
-\DeclareTranslation{English}{exesheet-annex}{Annex}
-\DeclareTranslation{English}{exesheet-ex}{Ex}
-\DeclareTranslation{English}{exesheet-points}{points}
-\DeclareTranslation{English}{exesheet-point}{point}
-\DeclareTranslation{English}{exesheet-correction}{Correction}
-\DeclareTranslation{English}{exesheet-pts}{pts}
-\DeclareTranslation{English}{exesheet-pt}{pt}
+\DeclareTranslation{english}{exesheet-exercise}{Exercise}
+\DeclareTranslation{english}{exesheet-subpart}{Part}
+\DeclareTranslation{english}{exesheet-annex}{Annex}
+\DeclareTranslation{english}{exesheet-ex}{Ex}
+\DeclareTranslation{english}{exesheet-points}{points}
+\DeclareTranslation{english}{exesheet-point}{point}
+\DeclareTranslation{english}{exesheet-correction}{Correction}
+\DeclareTranslation{english}{exesheet-pts}{pts}
+\DeclareTranslation{english}{exesheet-pt}{pt}
 
-\DeclareTranslation{French}{exesheet-exercise}{Exercice}
-\DeclareTranslation{French}{exesheet-subpart}{Partie}
-\DeclareTranslation{French}{exesheet-annex}{Annexe}
-\DeclareTranslation{French}{exesheet-ex}{Ex}
-\DeclareTranslation{French}{exesheet-points}{points}
-\DeclareTranslation{French}{exesheet-point}{point}
-\DeclareTranslation{French}{exesheet-correction}{Correction}
-\DeclareTranslation{French}{exesheet-pts}{pts}
-\DeclareTranslation{French}{exesheet-pt}{pt}
+\DeclareTranslation{french}{exesheet-exercise}{Exercice}
+\DeclareTranslation{french}{exesheet-subpart}{Partie}
+\DeclareTranslation{french}{exesheet-annex}{Annexe}
+\DeclareTranslation{french}{exesheet-ex}{Ex}
+\DeclareTranslation{french}{exesheet-points}{points}
+\DeclareTranslation{french}{exesheet-point}{point}
+\DeclareTranslation{french}{exesheet-correction}{Correction}
+\DeclareTranslation{french}{exesheet-pts}{pts}
+\DeclareTranslation{french}{exesheet-pt}{pt}
 
-\DeclareTranslation{German}{exesheet-exercise}{\"Ubung}
-\DeclareTranslation{German}{exesheet-subpart}{Teil}
-\DeclareTranslation{German}{exesheet-annex}{Anhang}
-\DeclareTranslation{German}{exesheet-ex}{\"Ub}
-\DeclareTranslation{German}{exesheet-points}{Punkte}
-\DeclareTranslation{German}{exesheet-point}{Punkt}
-\DeclareTranslation{German}{exesheet-correction}{Verbesserung}
-\DeclareTranslation{German}{exesheet-pts}{P.}
-\DeclareTranslation{German}{exesheet-pt}{P.}
+\DeclareTranslation{german}{exesheet-exercise}{\"Ubung}
+\DeclareTranslation{german}{exesheet-subpart}{Teil}
+\DeclareTranslation{german}{exesheet-annex}{Anhang}
+\DeclareTranslation{german}{exesheet-ex}{\"Ub}
+\DeclareTranslation{german}{exesheet-points}{Punkte}
+\DeclareTranslation{german}{exesheet-point}{Punkt}
+\DeclareTranslation{german}{exesheet-correction}{Verbesserung}
+\DeclareTranslation{german}{exesheet-pts}{P.}
+\DeclareTranslation{german}{exesheet-pt}{P.}
 
-\DeclareTranslation{Spanish}{exesheet-exercise}{Ejercicio}
-\DeclareTranslation{Spanish}{exesheet-subpart}{Parte}
-\DeclareTranslation{Spanish}{exesheet-annex}{Anexo}
-\DeclareTranslation{Spanish}{exesheet-ex}{Ej}
-\DeclareTranslation{Spanish}{exesheet-points}{puntos}
-\DeclareTranslation{Spanish}{exesheet-point}{punto}
-\DeclareTranslation{Spanish}{exesheet-correction}{Correcci\'on}
-\DeclareTranslation{Spanish}{exesheet-pts}{ptos}
-\DeclareTranslation{Spanish}{exesheet-pt}{pto}
+\DeclareTranslation{spanish}{exesheet-exercise}{Ejercicio}
+\DeclareTranslation{spanish}{exesheet-subpart}{Parte}
+\DeclareTranslation{spanish}{exesheet-annex}{Anexo}
+\DeclareTranslation{spanish}{exesheet-ex}{Ej}
+\DeclareTranslation{spanish}{exesheet-points}{puntos}
+\DeclareTranslation{spanish}{exesheet-point}{punto}
+\DeclareTranslation{spanish}{exesheet-correction}{Correcci\'on}
+\DeclareTranslation{spanish}{exesheet-pts}{ptos}
+\DeclareTranslation{spanish}{exesheet-pt}{pto}
 
-\DeclareTranslation{Italian}{exesheet-exercise}{Esercizio}
-\DeclareTranslation{Italian}{exesheet-subpart}{Parte}
-\DeclareTranslation{Italian}{exesheet-annex}{Annesso}
-\DeclareTranslation{Italian}{exesheet-ex}{Es}
-\DeclareTranslation{Italian}{exesheet-points}{punti}
-\DeclareTranslation{Italian}{exesheet-point}{punto}
-\DeclareTranslation{Italian}{exesheet-correction}{Correzione}
-\DeclareTranslation{Italian}{exesheet-pts}{pti}
-\DeclareTranslation{Italian}{exesheet-pt}{pt}
+\DeclareTranslation{italian}{exesheet-exercise}{Esercizio}
+\DeclareTranslation{italian}{exesheet-subpart}{Parte}
+\DeclareTranslation{italian}{exesheet-annex}{Annesso}
+\DeclareTranslation{italian}{exesheet-ex}{Es}
+\DeclareTranslation{italian}{exesheet-points}{punti}
+\DeclareTranslation{italian}{exesheet-point}{punto}
+\DeclareTranslation{italian}{exesheet-correction}{Correzione}
+\DeclareTranslation{italian}{exesheet-pts}{pti}
+\DeclareTranslation{italian}{exesheet-pt}{pt}
 
-\DeclareTranslation{Portuges}{exesheet-exercise}{Exerc\'icio}
-\DeclareTranslation{Portuges}{exesheet-subpart}{Parte}
-\DeclareTranslation{Portuges}{exesheet-annex}{Anexo}
-\DeclareTranslation{Portuges}{exesheet-ex}{Ex}
-\DeclareTranslation{Portuges}{exesheet-points}{pontos}
-\DeclareTranslation{Portuges}{exesheet-point}{ponto}
-\DeclareTranslation{Portuges}{exesheet-correction}{Corre\c c\~ao}
-\DeclareTranslation{Portuges}{exesheet-pts}{pts}
-\DeclareTranslation{Portuges}{exesheet-pt}{pt}
+\DeclareTranslation{portuges}{exesheet-exercise}{Exerc\'icio}
+\DeclareTranslation{portuges}{exesheet-subpart}{Parte}
+\DeclareTranslation{portuges}{exesheet-annex}{Anexo}
+\DeclareTranslation{portuges}{exesheet-ex}{Ex}
+\DeclareTranslation{portuges}{exesheet-points}{pontos}
+\DeclareTranslation{portuges}{exesheet-point}{ponto}
+\DeclareTranslation{portuges}{exesheet-correction}{Corre\c c\~ao}
+\DeclareTranslation{portuges}{exesheet-pts}{pts}
+\DeclareTranslation{portuges}{exesheet-pt}{pt}
 
 \newcommand*\exercisename{\GetTranslation{exesheet-exercise}}
 \newcommand*\subpartname{\GetTranslation{exesheet-subpart}}
@@ -158,25 +158,28 @@
 \newcommand*\ptname{\GetTranslation{exesheet-pt}}
 
 \newcounter{exercise}
+\newcounter{exe at check}
 
 \newcommand{\labelexercise}{\exercisename\space \theexercise}
 \newcommand{\labelexercisestyle}{}
 \newcommand*{\@exercise}[1][]{%
-    \ifexesheet at checkpts \exe at check{\labelexercise} \fi
-    % curiously, \exe at check must be performed before \refstepcounter
     \refstepcounter{exercise}
     \subsection*{\labelexercisestyle\labelexercise\enskip #1}
     \ifexesheet at exetoc
         \addcontentsline{toc}{subsection}{\labelexercise}
     \fi
+    \ifexesheet at checkpts
+     \setcounter{exe at check}{\value{exercise}}
+        \def\exe at label{\exercisename\space\theexe at check}
+    \fi
 }
 \newcommand*{\@@exercise}[2][]{%
-    \ifexesheet at checkpts \exe at check{#2} \fi
     \subsection*{\labelexercisestyle #2\enskip #1}
     \setcounter{subpart}{0} % resets the parts counter
     \ifexesheet at exetoc
         \addcontentsline{toc}{subsection}{#2}
     \fi
+    \ifexesheet at checkpts \def\exe at label{#2} \fi
 }
 \newcommand{\exercise}{\@ifstar{\@@exercise}{\@exercise}}
 
@@ -211,8 +214,16 @@
 \newcommand{\exlabel}{\exname.~\theexercise}
 \newcommand{\exsepmark}{---}
 \newcommand{\@exe}{\bigskip\refstepcounter{exercise}
+    \ifexesheet at checkpts
+        \setcounter{exe at check}{\value{exercise}}
+        \def\exe at label{\exname\space\theexe at check}
+    \fi
     \par\noindent\textbf{\exlabel~\exsepmark}~}
 \newcommand{\@@exe}{\bigskip\refstepcounter{exercise}
+    \ifexesheet at checkpts
+        \setcounter{exe at check}{\value{exercise}}
+        \def\exe at label{\exname\space\theexe at check}
+    \fi
     \par\noindent\textbf{\exlabel}~}
 \newcommand{\exe}{\@ifstar{\@@exe}{\@exe}}
 
@@ -232,8 +243,7 @@
 }
 \ifexesheet at setlist
     \standardfrenchlists
-    % must be executed here when exesheet is loaded after babel
-    \DisableKeyvalOption[action=warning,package=exesheet]{exesheet}{setlist}
+    % must be executed here (and not at begin doc) if loaded after babel
 \fi
 
 \newcommand\labelenumone{\arabic{task}.}
@@ -241,7 +251,7 @@
 
 \def\exs at process@setlist{% must be executed at begin document
   \ifexesheet at setlist
-    \standardfrenchlists % if exesheet is loaded before babel
+    \standardfrenchlists % executed at begin doc if loaded before babel
     \setlist[enumerate]{font=\bfseries}
     \setlist[enumerate,1]{topsep=1.5ex plus 1ex minus 1ex,leftmargin=1.5em}
   \fi
@@ -252,7 +262,7 @@
         column-sep=1em,label-align=right,
         item-indent=1.5em,label-width=1em,label-offset=0.5em,
         after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenum1}[\item](2)
-    \NewTasksEnvironment[label=\labelenuma,
+    \NewTasksEnvironment[label=\labelenuma,ref=\alph{task},
         column-sep=1em,label-align=right,
         item-indent=2.15em,label-width=1.6em,label-offset=0.5em,
         after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenuma}[\item](2)
@@ -261,7 +271,7 @@
         column-sep=1em,label-align=right,
         label-width=1em,label-offset=0.5em,
         after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenum1}[\item](2)
-    \NewTasksEnvironment[label=\labelenuma,
+    \NewTasksEnvironment[label=\labelenuma,ref=\alph{task},
         column-sep=1em,label-align=right,
         item-indent=2.15em,label-width=1.6em,label-offset=0.5em,
         after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenuma}[\item](2)
@@ -411,13 +421,19 @@
     \ifthenelse{\boolean{exesheet at answers}}{\correctionstyle}{\comment}
 }{\ifthenelse{\boolean{exesheet at answers}}{}{\endcomment}}
 
-\newcommand{\question}[1]{\ifexesheet at questions #1\fi}
+\newcommand{\@question}[1]{\ifexesheet at questions #1\fi}
+\newcommand{\@@question}[1]{%
+    \ifexesheet at questions\ifexesheet at answers \else #1\fi\fi}
+\newcommand{\question}{\@ifstar{\@@question}{\@question}}
 
-\newcommand{\answer}[1]{%
+\newcommand{\@answer}[1]{%
     \ifexesheet at answers%
         \ifexesheet at questions {\correctionstyle #1}\else #1\fi
     \fi
 }
+\newcommand{\@@answer}[1]{%
+    \ifexesheet at answers\ifexesheet at questions \else #1\fi\fi}
+\newcommand{\answer}{\@ifstar{\@@answer}{\@answer}}
 
 \newcommand\answerspace[1]{
     \ifexesheet at answerspace \par\vspace{#1} \fi}
@@ -448,8 +464,8 @@
 \def\exs at process@marginpos{
     \ifthenelse{\equal{\exesheet at marginpos}{left}}{
         \if at twoside%
-            \PackageWarningNoLine{exesheet}{The default `marginpos' option
-                \MessageBreak
+            \PackageWarningNoLine{exesheet}{The default `marginpos'
+                option \MessageBreak
                 for two-sided documents is `outer'.\MessageBreak
                 To change the side, use `inner'}
             \def\exesheet at marginpos{outer}
@@ -462,8 +478,8 @@
     }{% else if
     \ifthenelse{\equal{\exesheet at marginpos}{right}}{
         \if at twoside%
-            \PackageWarningNoLine{exesheet}{The default `marginpos' option
-                \MessageBreak
+            \PackageWarningNoLine{exesheet}{The default `marginpos'
+                option \MessageBreak
                 for two-sided documents is `outer'.\MessageBreak
                 To change the side, use `inner'}
             \def\exesheet at marginpos{outer}
@@ -615,9 +631,8 @@
 \newlength{\sum at exe}
 \newlength{\exe at total}
 \newlength{\sum at pts}
-\def\exe at label{none}
+\def\exe at currentlabel{none}
 \newboolean{scale at valid}
-\setboolean{scale at valid}{true}
 
 \gdef\gsetlength#1#2{% for obtaining global length values
     \begingroup
@@ -634,22 +649,23 @@
     \endgroup
 }
 
-\def\exe at check#1{
-    \ifthenelse{\lengthtest{\sum at pts = 0pt}\or\equal{\exe at label}{none}}{
-    % do not check, no \pts or first exercise begins
+\def\exe at check{
+    \ifthenelse{\lengthtest{\sum at pts = 0pt}}{
+    % do not check, no points or first exercise begins
+    \ifthenelse{\equal{\exe at currentlabel}{none}}{}{
+        \PackageWarningNoLine{exesheet}{\exe at currentlabel:
+            \the\exe at total}}
     }{
         \ifthenelse{\lengthtest{\exe at total = \sum at pts}}{
-            \PackageWarningNoLine{exesheet}{\exe at label:
-                The scale of \the\exe at total\space is valid}
+            \PackageWarningNoLine{exesheet}{\exe at currentlabel:
+                Sum of points \the\exe at total\space is valid}
         }{
-        \PackageWarningNoLine{exesheet}{\exe at label:
-            Sum of points is
-            \the\sum at pts\space instead of \the\exe at total}
+        \PackageWarningNoLine{exesheet}{\exe at currentlabel:
+            Sum of points is \the\sum at pts\space
+            instead of \the\exe at total}
         \setboolean{scale at valid}{false}
         }
-        \gsetlength{\sum at pts}{0pt}
     }
-    \def\exe at label{#1} % for the upcoming exercise
 }
 
 \def\exs at process@checkpts{
@@ -664,49 +680,67 @@
         \gsetlength{\sum at exe}{0pt}
         \gsetlength{\exe at total}{0pt}
         \gsetlength{\sum at pts}{0pt}
-        \AtEndDocument{
-            \ifthenelse{\equal{\exe at label}{none}}{
+        \setboolean{scale at valid}{true}
+        \AtEndDocument{% final checking (global)
+            \ifthenelse{\equal{\exe at currentlabel}{none}}{
+              \ifthenelse{\lengthtest{\sum at pts = 0pt}}{
+                \PackageWarningNoLine{exesheet}{checkpts: No points displayed}
+              }{
                 \ifthenelse{\lengthtest{\sheet at total = \sum at pts}}{
-                    \PackageWarningNoLine{exesheet}{Sum of points
-                        is valid: \the\sheet at total}
+                    \PackageWarningNoLine{exesheet}{Total:
+                        Sum of points \the\sheet at total\space is valid}
                 }{
-                    \PackageWarningNoLine{exesheet}{Inconsistent
-                        sum of points:
-                        \the\sum at pts\space instead of \the\sheet at total}
-                    \setboolean{scale at valid}{false}
-                }
-            }{
-                \exe at check{end}
+                    \PackageWarningNoLine{exesheet}{Total:
+                        Sum of points is \the\sum at pts\space
+                        instead of \the\sheet at total}
+                }}
+            }{% last exercise and final checking
+              \exe at check
+              \ifthenelse{\lengthtest{\sum at exe} = 0pt}{
+                \PackageWarningNoLine{exesheet}{checkpts: No points displayed}
+                }{
                 \ifthenelse{\lengthtest{\sheet at total = \sum at exe}}{
-                    \PackageWarningNoLine{exesheet}{Sum of points
-                        is valid: \the\sheet at total}
+                    \PackageWarningNoLine{exesheet}{Total:
+                        Sum of points \the\sheet at total\space is valid}
                 }{
-                    \PackageWarningNoLine{exesheet}{Inconsistent
-                        sum of points:
-                        \the\sum at exe\space instead of \the\sheet at total}
+                    \PackageWarningNoLine{exesheet}{Total:
+                        Sum of points is \the\sum at exe\space
+                        instead of \the\sheet at total}
                     \setboolean{scale at valid}{false}
                 }
+                \ifthenelse{\boolean{scale at valid}}{
+                    \PackageWarningNoLine{exesheet}{
+                        Marking scheme checked without errors}
+                }{
+                    \PackageWarningNoLine{exesheet}{
+                        Marking scheme checked with ERRORS! See above}
+                }
+              }
             }
-            \ifthenelse{\boolean{scale at valid}}{
-                \PackageWarningNoLine{exesheet}{Scale is valid}
-            }{
-                \PackageWarningNoLine{exesheet}{INVALID SCALE!
-                    Refer to above}
-            }
         }
     \fi
 }
 
+\newcommand*{\check at points}[1]{%
+    \ifexesheet at checkpts%
+        \exe at check% checks the previous exercise
+        \gdef\exe at currentlabel{\exe at label}% for the upcoming exercise
+        \gsetlength{\sum at pts}{0pt}%
+        \gsetlength{\exe at total}{#1pt}%
+        \gaddtolength{\sum at exe}{#1pt}%
+    \fi%
+}
+
 \definecolor{pointscolor}{named}{red}
 \newcommand{\pointsstyle}{%
     \small\mdseries\sffamily\color{pointscolor}\fbox}
-\newcommand*{\exesheet at points}[1]{\hfill
-    \pointsstyle{#1~%
-        \ifthenelse{\lengthtest{#1pt < 2pt}}{\pointname}{\pointsname}}
-    \ifexesheet at checkpts\gaddtolength{\sum at exe}{#1pt}\fi%
+\newcommand*{\points}[1]{%
+    \ifthenelse{\boolean{exesheet at questions}}{\hfill
+        \pointsstyle{#1~%
+            \ifthenelse{\lengthtest{#1pt < 2pt}}{\pointname}{\pointsname}}
+        \check at points{#1}
+    }{}
 }
-\newcommand*{\points}[1]{%
-    \ifthenelse{\boolean{exesheet at questions}}{\exesheet at points{#1}}{}}
 
 \definecolor{ptscolor}{named}{red}
 \newcommand{\ptsstyle}[1]{%
@@ -736,11 +770,8 @@
         \mbox{}%
         \marginpar{\hspace{0pt}\markingstyle{\ovalbox{%
             \makebox[\ptsboxlength]{\ptsmark{#1}}}}}%
+        \check at points{#1}%
     \fi%
-    \ifexesheet at checkpts%
-        \gsetlength{\exe at total}{#1pt}%
-        \gaddtolength{\sum at exe}{#1pt}%
-    \fi%
     \ignorespaces
 }
 
@@ -767,11 +798,11 @@
                 \noindent\hspace{0pt}\notestyle #2%
             }{}%
         }%
+        \ifexesheet at checkpts%
+            \ifthenelse{\equal{#1}{}}{}{%
+                \gaddtolength{\sum at pts}{#1pt}}%
+        \fi%
     \fi%
-    \ifexesheet at checkpts%
-        \ifthenelse{\equal{#1}{}}{}{%
-            \gaddtolength{\sum at pts}{#1pt}}%
-    \fi%
     \ignorespaces
 }
 \newcommand{\@@note}[1]{%
@@ -778,10 +809,10 @@
     \ifexesheet at pts%
         \mbox{}%
         \marginpar{\noindent\hspace{0pt}\markingstyle{#1}}%
+        \ifexesheet at checkpts%
+            \gaddtolength{\sum at pts}{#1pt}%
+        \fi%
     \fi%
-    \ifexesheet at checkpts%
-        \gaddtolength{\sum at pts}{#1pt}%
-    \fi%
     \ignorespaces
 }
 \newcommand{\note}{\@ifstar{\@@note}{\@note}}
@@ -790,8 +821,7 @@
     \ifthenelse{\boolean{exesheet at pts}}{\totalexe}{\points}}
 
 \def\exs at process@correct{
-    \ifthenelse{\equal{\exesheet at correct}{false}}{
-        % do nothing
+    \ifthenelse{\equal{\exesheet at correct}{false}}{% do nothing
     }{% else
     \@ifpackageloaded{schooldocs}{
         \ifthenelse{\equal{\exesheet at correct}{true}}{



More information about the tex-live-commits mailing list.