psychopy.org | Reference | Downloads | Github

Presenting two linked stimuli components in one trial

Hello,

I wonder if someone would be able to help. I am building a task on Psychopy on a OS X Mac using v1.84, mainly using the builder mode (inserting some code components where necessary).

For each trial, there is a central fixation and then a number appears center top of the screen (0, 0.5) and participant has to respond Y or N depending on whether it is an odd number. Every 5th trial, there is a distraction, so, the number at the center top is accompanied by another number center bottom (0, -0.5) and this requires a different response from the participant (there is a particular correct response Y or N depending on what that number is at the bottom)

I have specified details about the two numbers that will appear in these two-number trials in an excel file. The top numbers are always black, but sometimes (randomly) the bottom numbers should be white, to signal a change in how the participant should answer the question. Here is an example of my excel file:

number1 number1colour number2 number2colour corrAns
1 black 5 black left
3 black 8 black right
6 black 9 white left

Using the builder, I have two separate text components for my routine; one specifies details about the top number e.g. $number1, $number1colour; the other specifies details about the bottom number e.g. $number2, $number2colour. The problem is, that psychopy seems to be randomly selecting properties about the two numbers, not necessarily taking into account the whole row. for example, sometimes 2 (top) and 2 (bottom) both appear on the screen, even though none of my rows in the excel file specify that 2 can be both the number on top AND the number on the bottom.

The only alternative I can think of is to use image stimuli (which have both the numbers on them), so that only one stimulus component is in the routine. I wondered if there was another way to circumvent the issue without having to use the image stimuli (which I don’t really like, as I have a grey background and would need to match this exactly). Does anyone have any other thoughts?

Thanks!

It’s hard to know what could be going wrong, could you post some screenshots of your settings for these components?

Thanks. Sure.

Here are the two windows for my two text components that both make up routine ‘trial2’.

Nothing there looks strange, anything different in the advanced settings? Is there anything going on in your code component? If it’s short you could include it here, surrounded by three backticks:

```python

# your code

```

Thanks. I haven’t touched the advanced settings on the components at all. I have a code component in that routine, that just tells it to only show one trial with the two numbers, before looping around to the first routine (where there are 5 trials of only one number). Here it is…

in Begin routine:

myCount = 0

and in End routine:

myCount = myCount +1
if myCount > 0:
    Loop1.finished = True

Any other suggestions? I could show you my longer code that comes out of the coder view if that would help? Thanks!

I also can’t imagine how this could happen. Could you upload the conditions file and a stripped-down version of the experiment to demo the problem? ie. just the one routine with a loop around it?

thanks