diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-08-01 16:18:15 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-08-01 16:18:15 +0200 |
| commit | b4db5ea03dd236bfcf23dd6335ccd00ed8498575 (patch) | |
| tree | 047523d9df5bd8b4b334fbf824a4ea7eaaae4833 /latex | |
| parent | 56c60918d71a2e4e8ee558fd0d1fcd77ad3bdac9 (diff) | |
| download | unterricht-b4db5ea03dd236bfcf23dd6335ccd00ed8498575.tar.gz unterricht-b4db5ea03dd236bfcf23dd6335ccd00ed8498575.zip | |
detect if the point distribution and the points in the solution differ
Diffstat (limited to 'latex')
| -rw-r--r-- | latex/common.tex | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/latex/common.tex b/latex/common.tex index 87ede1c4..288d03f9 100644 --- a/latex/common.tex +++ b/latex/common.tex @@ -32,9 +32,12 @@ \newenvironment{Aufg}[1][]{ \refstepcounter{Aufg}% \noindent\textbf{Aufgabe \theAufg\ifstrempty{#1}{}{\ #1}:% -\ifdefempty{\Verteilung}{}{\ \Verteilung} \hfill {/}\ref{a:\theAufg} \ BE}% +\ifdefempty{\Verteilung}{}{\ \Verteilung{} BE} \hfill {/}\ref{a:\theAufg} \ BE}% \newline }{% +\ifdefempty{\Verteilung}% + {\setcounter{distSum}{-1}}% + {\setcounter{distSum}{\fpeval{\Verteilung}}}% \renewcommand{\Verteilung}{}% reset the distribution after each exercise \global\let\Verteilung\Verteilung% } @@ -45,6 +48,9 @@ \newcounter{beAManuell} % Counter to manually override the points in the current exercise \setcounter{beAManuell}{-1} +\newcounter{distSum} % Counter to check the sum of the point distribution +\setcounter{distSum}{-1} + \newcommand{\BE}[1]{% \iftoggle{erwartungshorizont}{% Typeset the points only if we are creating a horizon of expectation #1 BE}{}% TODO: better typesetting @@ -78,6 +84,11 @@ \addtocounter{beA}{-1}% decrement beA count because refstepcounter will increment it \refstepcounter{beA}% make the beA available for the ref and label mechanisms \expandafter\label{a:\theAufg}% create a label for this exercise +\ifnumgreater{\thedistSum}{-1}{% + \ifnumequal{\thedistSum}{\thebeA}{}{% + \errmessage{Aufg \theAufg: \noexpand\Verteilung (\thedistSum) and point count (\thebeA) are not equal}% + }%ifnumequal +}{}%ifnumfreater } \newtheoremstyle{Bearbeitung}% name of the style to be used |
