blob: 29d7ac0cdc1b1c98b008e418d7d4be7f566f14fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
\documentclass{article}
\usepackage{xsim,lipsum}
\NewDocumentCommand\printcompletepoints{}{%
\TotalExerciseGoals{points + bonus-points}
{\,\XSIMtranslate{point}}
{\,\XSIMtranslate{points}}%
}
\NewDocumentCommand\pointsandbonus{}{%
\TotalExerciseGoal{points}{}{}%
\IfExerciseGoalsSumTF{bonus-points}{=0}
{}
{\,(+\,\TotalExerciseGoal{bonus-points}{}{})}%
\,\XSIMtranslate{points}%
}
\begin{document}
\begin{exercise}[points=3,bonus-points=1]
\lipsum[4]
\end{exercise}
\begin{exercise}[points=8,bonus-points=3]
\lipsum[4]
\end{exercise}
\printtotalpoints\ vs.\@ \printcompletepoints\ vs.\@ \pointsandbonus
\end{document}
|