Display pairwise responses on screen

Hello all,

I am working on an experiment where participants are asked to recall as many items as they can from a given category (e.g., animals).

I’ve successfully made an experiment that allows participants to name as many animals as they can in a given amount of time and record their responses and the time it takes to generate response.

Now, I would like for them to rate the similarity between adjacent items in their response list.

Here is what some sample output data looks like (the first few rows are for a practice trial and can be ignored in this case):

image

Using this data, I would like to create routine that goes through and pairs responses and asks the participant for similarity ratings. For instance, the routine should display dog and cat and ask the participant to rate how similar those two items are, then proceed to cat and bird and provide another similarity rating.

I created a resp_list variable to store all the responses for a given participant by doing adding resp_list= to the Begin Experiment tab and then adding the following to the End Routine tab:

It appears storing the responses in resp_list is working because when I add print(resp_list) it shows the correct responses in a list in the Runner.

My thought was to then iterate through this list using a for loop, but I am a python novice.

Again, my thought was something like:

for x in range(0,len(resp_list)-1)
   word1 = resp_list[x]
   word2 = resp_list[x+1]

And then display/iterate this for the amount of responses a participant provides, but I am uncertain how to display these items or even get the iterative for loop to work.

I’m not sure if I’m even on the right track and any help is greatly appreciated!

Hi @cmagaldi,

I think you are absolutely on the right track, but you basically have to take what you coded as a for-loop and implement it in the loop logic of the builder.

So,

  • create a loop “similarity_rating” (name is arbitrary) around a routine with two text components and a keyboard component
  • set the number of repetitions of the loop to $len(resp_list)-1
  • for one text component set the text to $resp_list[similarity_rating.thisN] and the other to $resp_list[similarity_rating.thisN + 1], both set to “set every repeat”

That should do the trick. Let me know if it works!

Thank you so much ajus!

This appears to be working perfectly!!