I want to setup exercises/questions for an exam. Some exercises will have subquestions. When there are no subquestions I can simply specify the "points" property and get that neat space in the right margin to fill in the points. However, I did not find a way to specify subquestions with points and have them correctly printed out. Below is a stitched together MWE, which illustrates the problem: using the \addpoints{} command, the points are added to the exercise, as shown in the total of the grade table, but they do not show up in the entry of the exercise itself or in the margin. How can I get subquestions to work?
Note: I have used the exercise package before, but don't think it provides similar functionality regarding grade tables etc.
\documentclass{article}
\usepackage{xsim}
\xsimsetup{
clear-aux,
solution/print = false,
grading-table/template = default,
grading-table/type = exercise,
exercise/template = mytemp,
}
\DeclareExerciseEnvironmentTemplate{mytemp}{%
\subsection*
{%
\XSIMmixedcase{\GetExerciseName}\nobreakspace
\GetExerciseProperty{counter}%
\IfInsideSolutionF
{%
\GetExercisePropertyT{subtitle}{ {\normalfont\itshape\PropertyValue}}%
}%
}
% \GetExercisePropertyT{points}
% {%
\marginpar
{%
\IfInsideSolutionF{\rule{1.2cm}{1pt}\slash}%
% \printgoal{\PropertyValue}
\GetExerciseProperty{points} % this is the only part I added in, and I commented the GetExercisePropertyT conditional out.
\GetExercisePropertyT{bonus-points}{~(+\printgoal{\PropertyValue})}%
~\XSIMtranslate{point-abbr}%
}%
% }%
}
{}
\begin{document}
\gradingtable
\begin{exercise}
\begin{enumerate}
\item subquestion 1 (\addpoints{5})
\item subquestion 2 (\addpoints{7})
\end{enumerate}
\end{exercise}
\begin{exercise}[points=10]
another exercise
\end{exercise}
\end{document}
\addpoints{}
now works as expected and the workaround described in my answer is no longer needed.