Using participant colour response in multiple different conditions

Hi there, I am looking for some coding and conceptual understanding help.

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 2021.2.3

What are you trying to achieve?:
I am trying to code/build an experiment which contains 4 parts:

  1. first the participants sees a face with an emotion and then chooses a specific colour in hsv color space
  2. participants chooses preference facial emotions (e.g. anger vs fear) repeatedly for many emotion combination
  3. participants chooses preference colours (e.g. custom colour (yellow) vs custom colour (brown) repeatedly for many custom colour combination
  4. two colours are displayed and an facial emotion in four conditions in random order:
    1. one custom colour matching the emotion, one custom colour that does not
    2. one custom colour that does not matches, one randomly selected colour
    3. one custom colour that matches the emotion, one randomly selected colour
    4. two randomly selected colours

What did you try to make it work?:
I started of trying to save the custom color (hsv_colour), so it is now in the data frame, and
seeing whether I could recall it in another polygon

My request is to get a workflow, where I can do the four conditions mentioned above. Because I can really grasp how to do this.
** I have tried** this:

## each frame
h = hueSlider.getRating() or 0
s = satSlider.getRating() or 0
v = valSlider.getRating() or 0

## end routine
#save final colour into data frame
hsv_colour = [hueSlider.getRating(),satSlider.getRating(),valSlider.getRating()]

#into data frame for each trial
trials.addData('hsv.colour', hsv_colour)

What specifically went wrong when you tried that?:
Include pasted full error message if possible. “That didn’t work” is not enough information.
But I get this error when trying:


You do not show how and when you get the slider response, so I am not sure was causes the error. I am also not quite sure but why do you use

in each frame? Wouldn’t it be sufficient to get the rating at the end of the trial?

In addition, given that you “save” the response in the variables h,s,v, you could use

hsv_colour = [h,s,v]

instead of

I think that

should be

thisExp.addData['hsv_colour', hsv_colour]

trials.addData throws an error message for me.

BTW, I have noticed that you store your PsychoPy-experiment in a onedrive-folder. Syncing to a cloud-service interferes with syncing to Pavlovia. If you don’t intend to run the expeiment online, it shouldn’t be a problem. Otherwise store you PsychoPy in a folder which is not synced to a cloud-service.

Best wishes Jens