cgnieder/xsim

Suggestion: Different "points" translation for grading tables or just points-abbr for \points{} command

Sk1nk opened this issue · 2 comments

Sk1nk commented

Would it be possible to insert a new "points"-class for grading tables?

For my german tests, I use

\DeclareExerciseTranslation{German}{point}{BE} \DeclareExerciseTranslation{German}{points}{BE} \DeclareExerciseTranslation{German}{point-abbr}{BE}

I want the sum of the points within an exercise on the right next to the "exercise" label.
I want subexercises (created with a simple enumerate) to have their points after the item token, e.g.
a) (3 BE) ...
b) (1 BE) ...
but if I use \points{} for that, It uses not point-abbr. but point or points, depending on the number. So I changed that as well.
But in my grading table I would like to have it spelled out as "Bewertungseinheiten" ... so either I need a possibility to use point-abbr when using \points{} or the possibility to rename the points used in the grading table separately. I changed it myself, but every time there is an update, It gets written over.

Sk1nk commented

Alternatively, you could make the points name accessible via

\xsimsetup{point/name = Punkt,
points/name = Punkte,
point-abbr/name = P.}

\points is defined as

\NewDocumentCommand\points{m}{%
  \ExerciseGoalValuePrint{#1}{\,\XSIMtranslate{point}}{\,\XSIMtranslate{points}}%
}

You can easily change that definition in your template to suit your needs, for example:

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{xsim}
\RenewDocumentCommand\points{m}{%
  (\ExerciseGoalValuePrint{#1}
    {\,\XSIMtranslate{point-abbr}}
    {\,\XSIMtranslate{point-abbr}})%
}
\DeclareExerciseTranslations{point-abbr}{German=BE}
\DeclareExerciseTranslations{point}{German=Bewertungseinheit}
\DeclareExerciseTranslations{points}{German=Bewertungseinheiten}

\begin{document}

\begin{exercise}[points=5]
  \begin{enumerate}
    \item \points{2} Bla bla…
    \item \points{3} Blubber…
  \end{enumerate}
\end{exercise}

\gradingtable

\end{document}