psychopy.org | Reference | Downloads | Github

How to assign a new ID to each participant?

If you add me (Wake) as a developer to your project I can take a look. However, if you are pressing the sync button and getting a green globe then I’m sure the is file is updating. Perhaps you have have js files in two locations.

Hi @wakecarter and @jon ,

I used jspsych to make my experiment and wakecarter’s generator for my participant ID (https://moryscarter.com/vespr/pavlovia.php?folder=FranckElisabeth&experiment=crm-nback-condition_2/) and it works perfectly for that task. My problem appear when I try to use the id (or researcher) field and it would be very useful for me to send links with id=1, 2 or 3 to select the correct condition.json I made. As explained I needed to add a ‘/’ at the end because I don’t have html directory but when I try to add &id=number in the link, this solution no longer work because it adds the /html/ part in the url. I though “no problem I will make a html repository and place my index.html in there” so I tried. In that case the redirection is okay but now it’s the pavlovia plugin which doesn’t work anymore because the config.json seems not to be in the same folder as my index.html. I tried to deactivate and reactivate my experiment thinking it would generate a new “config.json” but it seems to be more complicated. The only experiments I see with that html folder are the ones made with PsychoPy but I can’t identify what I miss to make it works well.

Can you help me ?

I suspect that you added the / at the end when it needed to be straight after the experiment name

I didn’t realize that the order was important!
As you suspected I tried “https://moryscarter.com/vespr/pavlovia.php?folder=FranckElisabeth&experiment=crm-nback-condition_2&id=2/” whereas I had to do “https://moryscarter.com/vespr/pavlovia.php?folder=FranckElisabeth&id=2&experiment=crm-nback-condition_2/”.

Thank you for this really quick answer, It works perfectly now!

It’s not so much that the order is important, it’s that the slash is part of the experiment name.

Hi @wakecarter,

I’ve added you to the project (online_face_exp). Thank you very much for you help.

Lydia

Did you change the name of your experiment file?

I’d recommend that you delete your local .git folder and resync to a new project.

In my various attempts to make it work I’ve changed the file name, deleted it and started again, deleted the project and made a new one etc.

I’m not sure what a local .git folder is (bit of a newbie to all of this!). I can’t see a file or folder called or ending in git on my laptop. In the pavlovia gitlab project I have a file called .gitignore - is that what I should delete?

On Windows in Windows Explorer you can go to Options → Change folder and search options → View → Show hidden files, folders and drives.

The local .git folder is hidden by default and contains the information about the connection to the project online.

I’m on Mac and found how to show hidden files. I deleted the .git folder and synced and made a new project, but still no .js file created. I added you to the new project too (face_exp_hadhelp).

I downloaded your project and pressed the sync button and now you have a JS file.

Hello,
Thank you so much for that, I can now see there is a js file! I ran the experiment online using http://moryscarter.com/vespr/pavlovia.php?folder=lydiabrown&experiment=face_exp_hadhelp/ and it almost worked. The experiment actually started and ran which is a great step, but the counterbalancing using the participant counter url and the code component didn’t work, it ran both counterbalancing conditions rather than just 1. I also realised it hadn’t created a data folder, so I made one and tried to sync it and it won’t let me, I get the following error message saying the gitlab ID has changed and there is no .js file:

262.7090 WARNING Project lydiabrown/online_face_exp has changed gitlab ID since last use (was 118796 now 125133)
Generating PsychoJS script…

Traceback (most recent call last):
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 772, in findPathsInFile
File “”, line 1, in
NameError: name ‘group’ is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 74, in generateScript
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 245, in compileScript
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 217, in _makeTarget
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 210, in writeScript
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/experiment/flow.py”, line 277, in writeFlowSchedulerJS
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 819, in getResourceFiles
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 781, in findPathsInFile
NotADirectoryError: [Errno 20] Not a directory: ‘/Users/lydiabrown/Documents/local/online_exp_updated.js’

Pulling changes from remote…
Already up to date.
done
Pushing changes from remote…
done
Successful sync at: 11:57:33, took 0.902s508.3961 INFO Successful sync at: 11:57:33, took 0.902s

Hi @wakecarter ,

I think it’s still the same problem that I can’t make changes and update the js file…? I made a little change to the text just to see if I could update it and as shown below it updates the .psyexp file but not the js files.

Check this solution just in case

Just checked, export html is set to “on sync”. I then went file > export html and synced, but it still hasn’t updated the .js file.

When I clicked export html if gave this error message:
Generating PsychoJS script…

Traceback (most recent call last):
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 772, in findPathsInFile
File “”, line 1, in
NameError: name ‘group’ is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 74, in generateScript
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 245, in compileScript
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 217, in _makeTarget
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 210, in writeScript
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/experiment/flow.py”, line 277, in writeFlowSchedulerJS
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 819, in getResourceFiles
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 781, in findPathsInFile
NotADirectoryError: [Errno 20] Not a directory: ‘/Users/lydiabrown/Documents/local/online_exp_updated.js’

then if I press the sync globe button it says this:
Pulling changes from remote…
Already up to date.
done
Pushing changes from remote…
done
Successful sync at: 13:09:41, took 0.933s211.0915 INFO Successful sync at: 13:09:41, took 0.933s

Where do you define group?

BTW, on the original subject of this thread I now have a new web app which assigns new IDs to each participant with additional bells and whistles.

Dear @wakecarter,
stumbled upon your webapp and found what i was searching for - thank you so much!
I’ve had a few testruns with my custom experiment link and it works like a charm.
However, now that i want to start collecting new data from scratch, is there a way to start incrementing participant IDs, beginning from 1 again?
This is the link i’m using:
https://moryscarter.com/vespr/pavlovia.php?folder=rauelias&experiment=tripletvalidation

Thanks in advance,
Elias

Hi Elias,

Since resetting the participant count requires me to go into the database, but isn’t really necessary (participant numbers can start from any figure) I now ask people to “buy me a coffee” if they would like me to reset their counter. Licenced users of my new Study Portal can do this themselves.

Best wishes,

Wakefield

Dear Wakefield,
thanks for your quick reply.
Selection of conditions and shuffled trials depended on participant ID in my experiment, but i changed that now, so no need to reset the counter anymore. I’ll be happy to buy you a coffee anyways.
Enjoy and all the best,
Elias

Thanks for the coffee. I’m very happy to reset your counter if you’d like me to.