Using userinput from the beginning in experiment

Hello everybody,

I am building an experiment where I show the participant some information about a fictional person (name, birth date, name of mother and name of father) which they need to remember.

Each trial consists of showing the participant a target word and the participant has to press right if the target word that is presented is part of the information about the fictional person shown at the beginning and left if its not.

Now there is one difficulty in building that experiment. At the beginning I am asking the participant about some personal information (their name, birth date and name of their parents).
I want to use these information then in my trial so that they can be displayed as a target word. (the goal is to see if those personal information (relevant items) take longer time to process than some other irrelevant items.)

It would be optimally to have a .csv file with my date. For the fictional items and the irrelevant items that is not a problem because they are always the same but how do I get the personal information from the participant in thistle? Is that even possible?

Or is there a different way how I can achieve what I need?
I hope someone here can help me, because I am really lost with this!

Thank you so much in advance!!
Best wishes,
Sarah

Hi Sarah,

The user input can be accessed using expInfo[‘favourite colour’] etc

Best wishes

Wakefield

Thank you so much Wakefield.

So I just write that into my excel file or do I need to use a code component for that??

Code component or straight into your text component or whatever

Bildschirmfoto 2020-08-04 um 08.41.18

This is how my experiment looks right now. In my excel file I have one row called item with all the items and I repeat this excel file 3 times (random). Now I want the participants name, birthday, name of mom and name of dad to also get displayed as targetWords and also want them the be repeated 3 times within my trial (also randomly).

Where excactly do I have to do it? A code component but what kind of code do I right to integrate it into my loop??

What I would do is create placeholders in the Excel file, such as NAME, BIRTHDAY, MOM, DAD.

Then, in the Begin Routine tab of a code component above targetText add the following code:

if item == 'NAME':
     displayItem=expInfo['Your name']
elif item =='BIRTHDAY':
     displayItem=expInfo['Your birthday']
elif item =='MOM':
     displayItem=expInfo['Your mom\'s name'];
elif item =='DAD':
     displayItem=expInfo['Your dad\'s name'];
else:
     displayItem=item

Then use $displayItem in the text component.

Ahh perfect that worked! Thank you so much!