Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grading table with collections #85

Closed
ParticuleAlpha opened this issue Mar 10, 2021 · 3 comments
Closed

Grading table with collections #85

ParticuleAlpha opened this issue Mar 10, 2021 · 3 comments

Comments

@ParticuleAlpha
Copy link

Hi!
I've updated the package this morning as I was working on building a new document I've noticed that the grading table does not work properly with collections since then.

Here is a minimal (non-)working example (that I got from issue #40 ):

\documentclass{article}
\usepackage{xsim}

\DeclareExerciseCollection{test}
\xsimsetup{print-solutions/headings=false}

\begin{filecontents*}{testproblems.tex}
\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}
\end{filecontents*}

\begin{document}

\gradingtable

\collectexercises{test}
  \input{testproblems.tex}
\collectexercisesstop{test}

\printexercise{exercise}{one,three}

\end{document}

And here is the result I have:
image

It looks kind of like it does not "see" the exercises.

Can you help me figuring out what I'm doing wrong?

PS: when exercises are included directly in the document body, without using collections, it works perfectly fine.

@cgnieder
Copy link
Owner

I suggest to read the current manual carefully again. The long announced changed to the collection mechanism finally took place with version 0.20 and is documented. This version works:

\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}

\end{document}

image

@ParticuleAlpha
Copy link
Author

Thank you very much for your answer, I somehow managed to totally miss it in the manual even if I read it more than once, sorry about that!

I have a supplementary question about it. If you add the second exercise in the printed exercises ( using \printexercise{exercise}{one,three,two} in your MWE), it gives you a grading table with numbers ordered by id instead of by counter (as it should per the definition of functions in the grading table template) and exercise 2 is at the end of the table instead of being between exercise 1 and exercise 3.

image

I've tried to change the grading table template without success so far. Is there a build-in (or an easy) way to do so that I overlooked?

@cgnieder
Copy link
Owner

@cgnieder cgnieder reopened this Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants