A simple RT and temporal self-report task

OS : Win10
PsychoPy version : 3
planned to go as an online research

Hey to everyone,

I am very new to psychopy and i am trying to build what is meant to be a very simple temporal task, that is meant to flow like this:

  • Image A appears.
  • participant presses ‘space’ to make image A go away.
  • after ‘space’ is pressed, image B appears after 400/700/1000mls in a randomized and counterbalanced fashion.
  • participant uses number keys to give self-report of how long it took to image B to appear from the moment ‘space’ was pressed.

this is basically all of it, and i tried tutorials for a few days now, and also basic coding but i’m just not getting it right.
any help at all will be very much appreciated… thank you so much in advance for reading.

Please provide more details of exactly what difficulties you are experiencing - we don’t have anything to go on so far.

Thank you for the response, sorry for the lack of information, I’m new to this.

In the end i need the trial to go like:

  • Image A appears.
  • participant presses ‘space’ to make image A go away.
  • after ‘space’ is pressed, image B appears after 400/700/1000mls in a randomized and counterbalanced fashion.
  • participant uses number keys to give self-report of how long it took to image B to appear from the moment ‘space’ was pressed.

I tried a code just for the randomization of Image B timings (30 trials, 10 where B appears 400mls after press,10 where B appears 700mls after press and 10 where B appears 1000mls after press), and B keeps appearing immediately after press with no regard to timing.

the code is:

beginning of experiment:

timing=[0.3999,0.3999,0.3999,0.3999,0.3999,0.3999,0.3999,0.3999,0.3999,0.3999,0.6999,0.6999,0.6999,
0.6999,0.6999,0.6999,0.6999,0.6999,0.6999,0.6999,0.9999,0.9999,0.9999,0.9999
,0.9999,0.9999,0.9999,0.9999,0.9999,0.9999]
shuffle(timing)
experiment_Ts=[]
trial_n=0 

beginning of routine:

trial_timing = timing.pop()
trial_n = trial_n+1

end of routine:

if experiment_Ts == []:
    experiment_Ts = [trial_n,trial_timing];
else:
    experiment_Ts = experiment_Ts.append([trial_n,trial_timing]);

Again, thank you for your help!

Are you currently using a conditions file to specify images A and B?

No, I tried conditioning the image change with a key press like:
$key_resp1==‘space’
And it also didn’t work

That wasn’t my question. How are you specifying what image files appear as image A and B?

Ignore anything about subject responses for the moment.

Ok so,

i’m not using a conditions file. I tried to make the onset of A with “time(s)” and specified “Image” box with: images\finger_raise.jpeg.

i tried to set the offset with: $key_resp1==‘space’, hoping that i could set image B’s onset in the same manner.

OK, having “hardwired” image filenames makes it very easy then. You can do this without any code at all.

Instead create a conditions file (.csv or .xlsx) that looks like this:

trial_timing
0.4
0.7
1.0

Put a loop around your trial routines and connect it to that conditions file, set the loop to be “full random” and to have an nReps value of 10 (to yield 30 trials).

Your trial should consist of two routines. The first will show image A for an unspecified duration, with a keyboard component, also with an unspecified duration, that is set to force the end of the routine upon a single keypress (allow only the 'space' key).

The second routine will have an image component where you specify the start time to be $trial_timing. i.e. the second image will only appear after the space key has been pressed, following the randomised but balanced interstimulus interval. In the “expected start” field, put in a typical value like 0.7. This won’t do anything in the experiment, but does give you a visual indication in the timeline that the image component doesn’t start at time 0.

Does that make sense?

PS Avoid Windows-style path separators (back slashes) in hard-wired file paths. Python can often interpret them in unexpected ways as an escape sequence. Instead use standard forward slashes (/). That also has the advantage that your experiment can be portable between Windows/Mac/Linux.

I did everything as you specified, and the trials indeed run without crashing!

Problem is, it simply switches from image A to B right after space is pressed, without consideration of the timing CSV file. I thought that maybe 0.4/0.7 are too brief and switched to longer than a second, but it still seems to change instantly after the key press.

Any idea what that might be?

Can you post your .psyexp file here?

Gladly.

intentional_binding.psyexp (21.3 KB)