psychopy.org | Reference | Downloads | Github

Passing data from one Pavlovia study to another

To run my experiment, participants will actually complete two separate experiments on Pavlovia. The first (Exp1) is a jsPsych experiment and the second (Exp2) was created in PsychoPy builder. At the end of Exp1, participants will be automatically directed to Exp2 and participant number will be passed on.

During Exp1, there will be 2 values defined that need to be used in Exp2. Exp1 will determine the size of participants’ screens and how far they’re sitting from the screen. What is the best way to pass these values into Exp2 so stimuli can be sized based on these factors?

I assume that I will need to create 2 variables in Exp2 (with the same names as those in Exp1?) and then call on those variables when defining image size (width/height).

—OR—

Can I use variables when defining values in monitor center? What I mean by this is can I use the 2 values from Exp1 in monitor center for Exp2? This way things will be sized based on each participant’s monitor size. I’m not sure if this is possible and/or if images will still need to be sized as described above.

Thank you!
Elisabeth

Hi Elisabeth,

I don’t think you’ll be able to pas variables into the monitor center, but I’m not 100% sure about that. Is this help page of any use to you?

Best, Thomas

Hi Thomas,

Yes and no. I know that you can pass variables into the ExpInfo boxes. Is there a way to pass information directly into a variable in the experiment? Or to later retrieve information from the ExpInfo boxes? For example, if I add 2 variables to the ExpInfo boxes (e.g. lpd and distance from my first Exp), can I use those values later in the experiment (i.e. is there a way to call them)?

I’m not sure I need to put variables into monitor center if I can do this, but I’m not positive. I think if the above is possible, it’s going to be a lot of trial and error for me to figure this out.

My only other option (that I know of) is to reprogram my entire experiment in jsPsych so it’s directly compatible with my first experiment. This will be much more work both now and later, when I need to modify the experiment later, so I’m hoping I won’t need to do that.

Elisabeth

You write varName=expInfo[‘varName’] to transfer to a variable

1 Like

@wakecarter I think that’s exactly what I was looking for! I have a couple of questions related to that…do the 2 instances of ‘varName’ have to be the same (e.g. the name of the variable I already have has to be the same as the one I’m creating)? If not, I assume it would be varNameOld=expInfo[‘varNameNew’]

Do I need to define the variables in a code component under the Begin Experiment tab somewhere so they can be used later (such as varName = ’ ') or are they automatically stored somewhere? If they’re automatically stored somewhere, is there a way to ‘print’ them so I can make sure they transferred correctly?

Correctish. varNameNew is the question in the dialogue box. You can access these expInfo variables at an time including using them directly in a component

2 Likes