diff options
author | Karl Berry <karl@freefriends.org> | 2021-05-18 20:16:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-05-18 20:16:15 +0000 |
commit | 14d808c4c3b18dee7781b136a6c64aea494425fb (patch) | |
tree | e5516f8984efb90814d480592e199574c9b038b0 /Master/texmf-dist/tex/latex/tuda-ci/tudaexercise.cls | |
parent | 95c07519379ea4d3ce0a74fd686e5f456b2b1840 (diff) |
tuda-ci (18may21)
git-svn-id: svn://tug.org/texlive/trunk@59257 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tuda-ci/tudaexercise.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/tuda-ci/tudaexercise.cls | 84 |
1 files changed, 57 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudaexercise.cls b/Master/texmf-dist/tex/latex/tuda-ci/tudaexercise.cls index 778bbc9508a..b898c90ff35 100644 --- a/Master/texmf-dist/tex/latex/tuda-ci/tudaexercise.cls +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudaexercise.cls @@ -1,4 +1,4 @@ -%% This is file `tudaexercise.cls' version 3.13a (2021/03/19), +%% This is file `tudaexercise.cls' version 3.14 (2021/05/18), %% it is part of %% TUDa-CI -- Corporate Design for TU Darmstadt %% ---------------------------------------------------------------------------- @@ -26,8 +26,8 @@ %% %% ============================================================================ %% -\def\fileversion{3.13a} -\def\filedate{2021/03/19} +\def\fileversion{3.14} +\def\filedate{2021/05/18} \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesExplClass{tudaexercise} @@ -35,6 +35,14 @@ \RequirePackage{l3keys2e} +\msg_new:nnnn {tudaexercise} {outdated-koma-script} { + Your~KOMA-Script~is~outdated.\\ + To~use~the~feature~'#1'~you~will~be~required~to~update. +} { + Please~do~not~use~this~feature~or~update~your~TeX~distribution.\\ + The~feature~requires~KOMA-Script~v#2~or~newer. +} + \str_const:Nn \c__ptxcd_base_str {exercise} \prop_new:N \g_ptxcd_clsopts_prop \prop_new:N \g_ptxcd_unknown_clsopts_prop @@ -278,6 +286,13 @@ \LoadClass{scrartcl} +\bool_if:NT \g__ptxcd_points_bool { + \cs_if_exist:NF \AddtoDoHook{ + \msg_error:nnnn {tudaexercise} {outdated-koma-script} {points=true/auto} {3.27} + \keys_set:nn {ptxcd/exercise} {points=false} + } +} + \RequirePackage{tudarules} %Has to be loaded here due to headwidth options @@ -322,7 +337,7 @@ }} -\usepackage{tudafonts} +\RequirePackage{tudafonts} \dim_new:N \g_ptxcd_innerMargin_dim \dim_new:N \g_ptxcd_outerMargin_dim @@ -774,12 +789,16 @@ \IfNoValueF{#1}{\keys_set:nn {ptxcd/task}{#1}} \@task{#2} \bool_if:NF \l__ptxcd_points_auto_bool { - \prop_gput:Nxx \g__ptxcd_points_collector_prop + \cs_if_exist_use:NF \prop_gput:Nxx + {\exp_args:NNx \prop_gput:Nnx} + \g__ptxcd_points_collector_prop {\thetask} {\fp_to_decimal:N \l_ptxcd_ex_task_points_fp} } }{ - \bool_if:NT \l__ptxcd_points_auto_bool { - \prop_gput:Nxx \g__ptxcd_points_collector_prop + \bool_if:NT \l__ptxcd_points_auto_bool { + \cs_if_exist_use:NF \prop_gput:Nxx + {\exp_args:NNx \prop_gput:Nnx} + \g__ptxcd_points_collector_prop {\thetask} {\fp_to_decimal:N \g__ptxcd_ex_collected_points_fp} \fp_gzero:N \g__ptxcd_ex_collected_points_fp } @@ -886,17 +905,22 @@ \ptxcd_makeheadrule[color=identbarcolor, width=\textwidth]{ptxcd_headrule} % Point referencing -\AddtoDoHook{heading/preinit/subtask}{ - \bool_if:NT \g__ptxcd_points_bool { - \fp_gadd:Nn \g__ptxcd_ex_collected_points_fp {\l_ptxcd_ex_subtask_points_fp} - } -} +\cs_if_exist:NTF \AddtoDoHook { + \AddtoDoHook{heading/preinit/subtask}{ + \bool_if:NT \g__ptxcd_points_bool { + \fp_gadd:Nn \g__ptxcd_ex_collected_points_fp {\l_ptxcd_ex_subtask_points_fp} + } + } -\AddtoDoHook{heading/preinit/task}{ - \fp_gzero:N \g__ptxcd_ex_collected_points_fp + \AddtoDoHook{heading/preinit/task}{ + \fp_gzero:N \g__ptxcd_ex_collected_points_fp + } +} { + \msg_warning:nnnn {tudaexercise} {outdated-koma-script} {point~references} {3.27} } + \msg_new:nnn {tudaexercise} {points-differ} { Value~of~points~changed~for~at~least~one~task.\\ Please~rerun~LaTeX~to~get~correct~references~and~calculations. @@ -949,20 +973,8 @@ \newcommand{\getPointsTotal}{ \fp_use:N \g__ptxcd_points_total_fp } -} { - \newcommand{\getPoints}[1]{ - \msg_error:nnn {tudaexercise} {point-referencing-disabled} {\getPoints} - } - \newcommand{\refPoints}[1]{ - \msg_error:nnn {tudaexercise} {point-referencing-disabled} {\refPoints} - } - \newcommand{\getPointsTotal}[1]{ - \msg_error:nnn {tudaexercise} {point-referencing-disabled} {\getPointsTotal} - } -} -\cs_new:Nn \__ptxcd_map_points_helper:nn {#1-#2} -\NewDocumentCommand{\mapPoints}{sO{1}m}{ + \NewDocumentCommand{\mapPoints}{sO{1}m}{ \cs_gset_nopar:Nn \__ptxcd_map_points_helper:nn {#3} \prop_if_empty:NTF \g__ptxcd_loaded_points_prop { \msg_warning:nn {tudaexercise} {empty-point-mapping} @@ -988,8 +1000,26 @@ \setcounter{task}{\int_use:N \g_ptxcd_tmp_int} \g_ptxcd_tmp_tl } + } + +} { + \newcommand{\getPoints}[1]{ + \msg_error:nnn {tudaexercise} {point-referencing-disabled} {\getPoints} + } + \newcommand{\refPoints}[1]{ + \msg_error:nnn {tudaexercise} {point-referencing-disabled} {\refPoints} + } + \newcommand{\getPointsTotal}[1]{ + \msg_error:nnn {tudaexercise} {point-referencing-disabled} {\getPointsTotal} + } + + \NewDocumentCommand{\mapPoints}{som} { + \msg_error:nnn {tudaexercise} {point-referencing-disabled} {\mapPoints} + } } +\cs_new:Nn \__ptxcd_map_points_helper:nn {#1-#2} + \newcommand*{\ptxcd@LoadPoints}[2][]{ \prop_gset_from_keyval:Nn \g__ptxcd_loaded_points_prop { |