Need stimuli to change based on participant choices

Hi all,

I’m a complete newbie to PsychoPy and experiment building in general (apart from E-prime) so I’m not entirely sure where to start. I’m making my way through the forum trying to find information about experiments similar to mine, but I thought I would post the specifics on here in case anyone can help point me in the right direction. I’m very new to coding so ideally I’m looking for solutions that can be done in the Builder, but I’m aware this might not be possible for what I want to do (so I’m happy for code solutions too).

What I want to do…

I’m planning an experiment which will initially have a large quantity (a few hundred) of dots (or any shape, it doesn’t really matter) on the screen. The dots need to have no fill colour initially, but at least some sort of colour border separating them so that the outline can be seen.

In addition to the dots, there are four response options (A, B, C, D) that participants can select. Each response option will have a different gain or loss value (e.g. -10, +5) on each selection (these values will be stored in an Excel file) and these gains and losses will impact the dots. If the participant gains value on a particular trial, this will be represented by the shapes being filled in a colour (say, blue) and the number of coloured shapes will depend on the gain value (e.g. +5 equals 5 blue coloured shapes). If they lose, they either lose blue colour in the shapes OR gain red ones (as red will symbolize minues values).

So essentially, the dots need to change colour based on the participants choices, and the outcome of their choices is determined by a gain/loss schedule pre-specified by an Excel file.

That’s pretty much it (apart from some minor details which I’ll deal with later). So far, I’ve been looking at the following posts for information:

How to build a grid and show stimuli at random positions

Creating Box Task in builder? (some grey "boxes" - chosen at random - change color when "opened" with a click)

If you know of any other relevant posts that might be useful for me, then I’d really appreciate it!

Hi There,

This is the kind of task that definitely needs a code component. As you are new to PsychoPy (welcome!) I highly recommend unpacking the builder demos (demos>unpack) and then playing with the BART task in this menu, this task uses participant responses to change the size of the baloon (although this task is probably a bit more complicated than what you need, it is a good place to start learning).

For you, you want a code component that will look something like:

if thisGain == 5:
    thisCol = 'blue'
elif thisGain ==10:
    thisCol = 'red'

And you can add more if statements as you go. Importantly, you will need to define ‘thisGain’ (if this is preset, this might be a column header in your conditions file, if this is dependant on response you may need another code component - since the BART task has gains it should be a helpful place to start.

Good luck!
Becca

Wonderful, thank you so much for your help! :slight_smile: