Hi, I have a Pavlovia experiment which uses 18 condition files, differentiated by the suffix at the end (_l1-_l18). When running the experiment offline, I set this variable (listnum) manually in the experiment info dialogue box. Then, in the initialization routine (which comes after the consent form and Pavlovia demographic survey rountines) I have a code snippet: listnum = str(expInfo[‘listnum’])
Later I define which condition file(s) to call in, in a loop, like this: en_trialfilename = ((((“lists/” + en_blocklist[blockindex]) + “_l”) + listnum) + “.csv”). Later in another large loop: in_trialfile1name = ((((“lists/” + in_blocklist[blockindex]) + “_l”) + listnum) + “.csv”);
Now in the online version this listnum has to be allocated automatically - each list has to be shown to 2 participants.
First I thought I should use the Shelf for this but I got stuck with the “how”. In the 2025.1.1 PsychoPy standalone version there is no “counterbalance routine”, so I can’t rely on the examples and videos that mention this. In addition, most of the examples talk about groups defining which loop to present, which made me wonder whether I can adapt those solutions to my case and it is indeed Shelf what I should use.
Then I read this thread (among many others), offering a potential solution, but I am not sure I understand what I should do: Between-subjects counterbalancing using Pavlovia (assigning different .xlsx conditions files to different participants) - #7 by Denise
It says one should put sth like this in a Begin Experiment tab: useFile = “condition”+str(expInfo[‘participant’]%18)+“.csv”
Do I simply need to write listnum = str(expInfo[‘participant’]%18 in the code or this useFile =… and then put $usefile in the Conditions field of the loops (where I put $en_trialfilename etc. before)?
My participant field looks like this:

Do I need to change it in some way to make this work? I want the first participant who does the experiment to get l1, the second one to get l2 etc.
That solution requires a consecutive participant number, for example by launching via my online app mentioned in the same thread.
This solution will rotate through your lists and will become uneven if you have people who launch and don’t complete. At the moment I still recommend my VESPR Study Portal if this is important to you.
Hi @wakecarter, Thank you for the reply. Do I need to define the conditions file(s) or it is enough to do this with the listnumber (listnum=str(int(expInfo[‘participant’]%18)+1))? Regarding the web app: Do I understand it correctly that the only thing I need to do (after addig the usefile/listnum def to the code) is to give the **https://moryscarter.com/vespr/pavlovia.php?folder =a&experiment=b etc. link to participants (and not the one originally given by Pavlovia (when running the exp)) and add the __pilotToken and __oauthToken to the end of this link when piloting?
Another, related question: I have 4 versions of the exp. Do I have to create different projects for them? Two of them is similar in structure, but would require adding “if version = 1 then…elif version =2” to several code components (the other two differ in structure) If I can counterbalance the 2 versions (that have similar structure) how shall I do it given that there is no counterbalancing routine plus I sue your web app to allocate participants to lists?
You can use participant to define listnum.
Yes, you give the vespr link to participants instead of the Pavlovia one (so the Pavlovia link gets pre-filled with the consecutive participant number).
If you have four experiments which need to be counterbalanced separately then the simple solution would be to have separate studies but an alternative would be to use the VESPR Study Portal (which can assign consecutive participant numbers from separate portals in the free version).
@wakecarter Thank you for your help!