I'm trying to build exam sheets with xsim using collections where exercises doesn't show up in the id order.
The exercises print in the specified order (= counter order) in the exam itself but in the id order in the grading table which can be confusing.
Here is a MWE:
\documentclass{article}
\usepackage{xsim}
\DeclareExerciseCollection{test}
\xsimsetup{
print-solutions/headings=false ,
collect
}
\begin{document}
\gradingtable
\begin{exercise}[ID=one,points=3]
Exercise one.
\end{exercise}
\begin{solution}
Answer one.
\end{solution}
\begin{exercise}[ID=two,points=7]
Exercise two.
\end{exercise}
\begin{solution}
Answer two.
\end{solution}
\begin{exercise}[ID=three,points=1]
Exercise three.
\end{exercise}
\begin{solution}
Answer three.
\end{solution}
\printexercise{exercise}{one,three, two}
\end{document}
Here is what I get:
And here is what I would like to have (exercises 2 and 3 are switched in the grading table):
As far as understood from the manual of the package, xsim only include build-in functions to sort exercises by Type then ID or by ID. I've tried to dig in the source code of the package to build a function to sort exercises by counter but it's beyond my present abilities.
Is there a build-in (or an easy) way to do so that I overlooked? Otherwise, have you an idea of how to get it?


This got me thinking, one way to solve this without changing the core of the package might be to write the grading table as it is now in an auxiliary file and to use this auxiliary file to look for the needed info (exercice name, counter and points) when we need it. It's not pretty nor efficient in compilation time, but it might work.
– ParticuleAlpha Mar 19 '21 at 22:11xsimwrites a number of stuff in an auxilliary file (look for a file with the ending.xsim– cgnieder Mar 20 '21 at 09:31