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