Participant info not saved on filename.csv

Hi,

This has been asked before but there was no solution offered and I just came across the same issue myself (2022.2.1).

The issue is that the value of the variable participant is not saved when this is set in the link. It is saved in the data file as separate column but not in the filename itself.

Also, if in the settings → experiment info dialogue I leave the field for the participant as is i.e. f"{randint(0, 999999):06.0f}", then this will appear in the filename regardless what I set as the participant’s value in the link.

As an example: https://run.pavlovia.org/Yiannis_A/iat/?participant=yiannis1&session=

Given that I have done this dozen of times in the past without issues, I tend to believe this is an issue with Pavlovia. I have also tried it with different exps, OS and computers.

Thanks in advance for any pointers

Yiannis

Hi, does this still happen if you remove f"{randint(0, 999999):06.0f}" from the dialogue box ( and save experiment and resync), and run the task from this example link IAT [PsychoPy] ?

Hi @suelynnmah ,

Thanks for your response. Yes that was the first thing I did actually. I even disabled the dialogue box altogether but had the same behaviour. Of course I synced and cleared cache between different attempts.

Is it something you can replicate from your side? This has now happened in two different task of mine so either there is an issue or I’m doing something wrong myself though I cannot think of any. I’ve done this dozens of times.

Best wishes
Yiannis


So in this task the f"{randint(0, 999999):06.0f}" was left in when synced to pavlovia and when I’m at the run link, I just removed the numbers generated and typed “test” and as you can see in the second screenshot, test is saved within the filename.

Would you mind sharing your task and I can take a closer look at the settings?

Thanks for trying this out.

I attach the two exps for which I cannot save participant info in their filenames - zipped as they contain all files necessary to upload and run it yourself if needed)

Many thanks

OneDrive_1_17-07-2022.zip (168.1 KB)
OneDrive_2_17-07-2022.zip (609.4 KB)

Hi, I’ve synced your task on my end and the filename saves correctly. Can you replicate this same issue if you push a new version to pavlovia?

Hi,

[ I am truly at loss here]

I have pushed a new version but the behaviour is the same. I created another project (minimal example,. just a text and a keyboard component) but still the same.

Just to clarify, if I type something in the participant field in the opening window when I start the exp online, it will accept it in that it will save what I typed in the file name. It is only when I pass this info via the link that it will not save it in the filename.

Also, rather worryingly I just noticed that:

  • when I pass the participant value via the link e.g. https://run.pavlovia.org/Yiannis_A/aa_miinimal/?participant=TEST,
    AND
  • in the settings I leave the participant field pre-populated with f"{randint(0, 999999):06.0f}"

it creates 2 csv datafiles one of which is empty but with a different rand numbers. Below, in the screenshot (I ran it only once) the two csv files are the first two, one of which is empty and the other populated with values. So, not only it ignores the value I set to P via the link but it also creates an extra file.

Knowing nothing about JS, the only thing that raises a flag for me is the inverted single quotes in the second line in the snippet below as found in my JS file.

let expInfo = {
    'participant': `${util.pad(Number.parseFloat(util.randint(0, 999999)).toFixed(0), 6)}`,
    'session': '001',
};

Many thanks for any support

Best wishes,
Yiannis

Hi, I see what you mean now. I’m sorry you’ve been encountering this. This is actually a bug and has been flagged to the dev team.

2 Likes

Many thanks @suelynnmah and I am sort of glad that this is a bug and not me loosing my sanity :slight_smile:

I just encountered this as well using 2022.2.4. It looks like it is also causing a problem with redirecting back to Sona, since its using my default participant ID (101) which isn’t a valid participant ID.

I am trying to edit one of the lines in the javascript from:

let expInfo = {
    'participant': '101',
};

to:
let expInfo = {'participant': ''};
which is how it is in older versions.

I will report back on whether this works.

I can confirm that clearing the initial setting of participant to the default allows the completedURL to refer back to Sona, but the filename is now missing the participant ID. The participant ID from the URL is contained in the datafile so they can still be processed without a problem.

1 Like

Thanks for Checking @Joseph_Orr

It’s just unnecessarily laborious to open tens if not hundreds of files to find the data of specific participants to:

  • cross-examine with data collected using other platforms (not uncommon)
  • provide a copy of the data or delete the data if asked by participants (not uncommon either)

Again thanks for checking, appreciated

BW
Yiannis

You might be able to add a Javascript-only code component as a workaround for this issue. In the Before Experiment section of the code component you can add:

util.addInfoFromUrl(expInfo);

and this seems to force the URL parameters to be read before the participant file is created. I briefly tested this in a minimal example in Version 2022.2.4, but have not tried it in a full experiment yet.

Credit to @young1 for first proposing the workaround.

-shabkr