psychopy.org | Reference | Downloads | Github

Incentive Delay task - Conditional Video Feedback Based on RT

Hi all. I hope this finds you well in these testing and uneasy times.

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): PsychoPy3
Standard Standalone? (y/n) If not then what?: y

What are you trying to achieve?:

I am running a standard incentive delay paradigm with a cue (fixed duration 1500ms), followed by a fixation cross (fixed duration 750ms), followed by a random ISI (random duration, avg 1000ms), followed by a target (fixed duration 1500ms). I have experience coding in other psychology packages (Neurobs Presentation) but am new to PsychoPy. I have been working mainly in the builder function of Psychopy3 and adding code components as required.

I am trying to present different feedback (via .avi files) if the participant responds to the target with the correct response key and within a reaction time threshold (arbitrarily set now as 400ms but this will be updated on a trial-by-trial basis once I have got my head around what is causing this basic issue). The type of video feedback that is shown is dependent on the type of cue (orangebox, bluebox, greenbox) that is shown.

I have attached relevant screenshots and code in case that’s useful.

What did you try to make it work?:

I have followed advice on other threads and in the online tutorials and have created a conditions file which contains all the necessary file information. I have then called on the different stimuli using $x. For the feedback, I have created three different movie stimuli in the builder and then have added the following code to try and show the appropriate feedback:

if  CueType == 'orangebox' and key_resp.corr and key_resp.rt < 0.4:
        RewardVideo
   elif not key_resp.corr:
        RewardNone
   else: ResponseRequired

^ that code is then repeated but with the different CueTypes e.g. ‘bluebox’.

What specifically went wrong when you tried that?:

All of the feedback videos are shown on top of one another - and so my guess is either the key_resp.corr and key_resp.rt isn’t working, or the right video isn’t being called. Please can you give me some advice on what you think might be causing this issue?

I’m sorry if this is a basic question but I hope we can get it resolved easily. Thank you so much.

Luke Waddon

Hi everyone.

I have made some adjustments to the code since my original post, but the main issue (video stimuli presented on top of each other) still remains.

I have checked that task performance is being logged correctly (via the print() function) and so I think the issue is in presenting each of the videos individually. Here’s an example of the code component I am using to log task performance and set the conditions:

reactiontime = key_resp.rt

if CueType == 'orangebox' and reactiontime <= meanRT:
    print("faster than meanRT and so RewardVideo should be presented")
if CueType == 'orangebox' and reactiontime >= meanRT:
    print("slower than meanRT and so RewardNone should be presented")

^ meanRT is set during practise trials.

I had a look around the various forums and it seems like people have tackled this issue before by setting the opacity of the stimuli https://groups.google.com/forum/#!topic/psychopy-users/VLbcwTAaVLs

So I have added the following code component in the Begin Routine tab of the Feedback Routine, and have entered the name (e.g. rewardVisibility) in the opacity field of the movie properties:

if  CueType == 'orangebox' and reactiontime <= meanRT:
    RewardVideo = RewardVideo
    rewardVisibility = 1.0
    nothingVisibility = 0.0

However, that doesn’t seem to have solved the issue. It seems like if the ‘top’ video is set to transparent the other’s remain hidden? But when I set both videos to 0.5 you can see that both are still being presented.

Any ideas or advice you have is much appreciated!