Selecting a stimulus at random from a conds file

Description of the problem:
I have an experiment that I am trying to get to work online. It works locally but I am getting this error when running online.
The principle is the participant sees a shape on screen and one side is coloured red, they identify with z or m.

The next part of the experiment they see a critical trial where there is a shape within a shape and they then have to identify if they saw it, then choose the stimulus they think they saw with either the response 1, 2, 3 or 4.

So I want my loop to choose 1 out of 8 possible conditions (rows) as per choosing a subset of conditions documentation

Now I am fairly sure that this is my problem online, even though it runs happily, locally with the glaring red error on the loop.

This is the error I get from running in Pilot

So I am assuming it doesn’t like *$random(1)8 which I anticipated would be the case, and I will need to ue code for that stimulus on that routine and this isn’t something that can be done in builder without code?

Thanks in advance


Hi Glen,

One of the first principles in writing your experiments for online use is to put all but the simplest code into code components, most of which can be auto translated.

Have a look at my crib sheets for information about random selections online.

One easy way to pick a single trial from your conditions is to select all rows but end the loop at the end of the first iteration (trials_2.finished = True)

Nice one Wakefield! Thank you. I shall give that a shot. The simpler it is the better for me. I’m much better at reading and interpreting code than actually writing it.