cgnieder / xsim

eXercise Sheets IMproved
65 stars 20 forks source link

Buffer problem #122

Open Kilgrave37 opened 7 months ago

Kilgrave37 commented 7 months ago

Hello,  Here is the situation.Each week, six of my students have a small exam.For each chapter, I created a file with exercises and solutions. These exercises are tagged for each student (eleve=1, …, eleve=6).Then each week, I create a document with the exercises for the students. Here is a part of the code: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Élève 1 (first student)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \xsimsetup{ solution/print=true, eleve=1} \input{\cheminun/coursColles-\chapun} \input{\chemindeux/coursColles-\chapdeux} \input{\chemintrois/coursColles-\chaptrois}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Élève 2% (second student)%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \xsimsetup{eleve=2} \input{\cheminun/exosColles-\chapun} \input{\chemindeux/exosColles-\chapdeux} \input{\chemintrois/exosColles-\chaptrois}

And so on until the sixth student And then I have a buffer problem. I there are only 3 students, it works fine (but the compilation is very long).I guess it is because each chapter (which contains the tagged exercises) is read six times, and there may be up to 4 chapters (in my example of code, there are 3 chapters). The chapters are external files.I guess I can avoid this buffer problem with collections but I didn’t succeed. What I would like:- each chapter is read only one time- when the chapter is read, the 6 collections are created (a collection for tag « eleve=1 », …, « eleve=6 »)- when I print the exercises and the solutions, the exercises for each student are numbered 1, 2, … and not as they are numbered in each chapter.

I hope I am clear

muzimuzhi commented 7 months ago

And then I have a buffer problem. I there are only 3 students, it works fine (but the compilation is very long).

Sorry I don't get your point. A complete example would be a best description.

Kilgrave37 commented 7 months ago

Thank you for your answer. I will try to be clear (I am French). I created external files, one for each chapter. In theses files, there are exercises (and solutions) and I tag some of the exercices for each students (eleve=1, …, eleve=6,). Each week, six of my students pass an oral exam and I give to each one of them a paper with the exercises (the first student has the exercices tagged « eleve=1 », …) To do that I created a file which gathers the exercises for each student (but this file contains the exercises for all 6 students) Here is a part of the code from this file: Here is a part of the code: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Élève 1 (first student)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \xsimsetup{ solution/print=true, eleve=1} \input{\cheminun/coursColles-\chapun} \input{\chemindeux/coursColles-\chapdeux} \input{\chemintrois/coursColles-\chaptrois}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Élève 2% (second student)%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \xsimsetup{eleve=2} \input{\cheminun/exosColles-\chapun} \input{\chemindeux/exosColles-\chapdeux} \input{\chemintrois/exosColles-\chaptrois}

And so on until the sixth student (In my code there are only 2 students, because the code is exactly the same for the other students, except the tag, of course). In my example, the exercises are gathered from three external files (chapun, chapdeux and chaptrois). The problem is that each chapter is read six times (one time for each student) and there are three chapters. That’s why I have a buffer problem. I don’t want to create a file for each student, I want a single file for all 6 students. If in my file, I put only 3 students instead of 6, I don’t have this buffer problem. I guess I can avoid this buffer problem with collections but I didn’t succeed. What I would like:

I hope I am clear

Kilgrave37 commented 7 months ago

I will try to do it short. I want to create six different collections from an external file. Here is what I am doing: \xsimsetup{eleve=1} \input{\cheminun/exosColles-\chapun} \xsimsetup{eleve=2} \input{\cheminun/exosColles-\chapun} \xsimsetup{eleve=3} \input{\cheminun/exosColles-\chapun} \xsimsetup{eleve=4} \input{\cheminun/exosColles-\chapun} \xsimsetup{eleve=5} \input{\cheminun/exosColles-\chapun} \xsimsetup{eleve=6} \input{\cheminun/exosColles-\chapun}

I think this is not a good way because the external final is input 6 times. I guess there is a way to input the external file only one time and create six collections in the same time (a collection for the tag « eleve=1 », …, a collection for the tag « eleve=6 ») but I don’t know how to do that

Kilgrave37 commented 7 months ago

I guess I am not clear. Never mind