Why is the (C) popping up instead of (D). (D) should be the right solution. Code copy/pasted from xsim manual.
\NewTasksEnvironment[label=(\Alph*),label-width=15pt]{choices}[\choice]
\newcommand*\correct{\thetask\expanded{\SetExerciseProperty{choice}{\thetask}}}
\begin{exercise}
The system of units that is based on the powers of 10 is called
\begin{choices}(1)
\choice US System of Units
\choice EU System of Units
\choice Imperial System
\choice[\correct] The Metric System
\end{choices}
\end{exercise}
\begin{solution}
\GetExerciseProperty{choice}
\end{solution}
\begin{document}
and\end{document}
tags?xsim-issue-49.tex
included in thexsim
package also produce the incorrect output. I'll file a bug pointing it to this question.