Help on how to have space bar end a trial (with image stimuli)

Hi everyone! New builder user here so apologizes if this is a simple question. I’m currently working on a task in which participants are asked to “win” certain rewards. The idea is that a particular image will pop up on the screen at random times and participants will press the space bar to collect the “reward”. We are interested in participants reaction time in collecting the reward, which is why I do not want to program the image to disappear on it’s own, and instead I want the image to disappear by them pressing the space bar. Additionally I would like to inform participants that they have won the reward by having “won” in text appear on top of the reward.

I tried creating a reward offset column in excel as following but I was received with an error message (I’m assuming because Psychopy was looking for an actual number for the offset time)

Screen Shot 2020-04-13 at 9.42.53 PM

My two main questions are as follows

  1. How do I get an image to disappear by pressing the space bar?
  2. how do I have text appear every time a participant presses the space bar?

Thanks for your help!

Could you please post a screenshot showing the sequence of each trial? Seems like what you want to do is fairly simple but it would be great if you could provide further details. For example, pressing the space bar ends the trial or not? The image pops up at random times?? What does that mean? At random time within each trial or across trials?

Thanks for your help. I realize my first explanation wasn’t clear so let me elaborate. Essentially there will be a 5 minute test block, and during this test block there will be multiple trials in which I want the reward to show up at the following times: 2,4,6,8,…16 seconds and then repeat this cycle until the test block ends (the excel I posted a screen shot of earlier was just a test I ran to see if it would work before I used the actual times I wanted). The order of the reward display times should also be randomized, across each trial (ex: a participant may see a reward after 16 seconds, then 2 seconds, etc. but this should all happen within the 5 min test block).

I want the participant to have the option to wait for the reward (in which case the image would pop up on the screen and the participant would press space to “collect” it) or skip a trial and move on to the next one, also by pressing space. What I mean by this is let’s say in the current trial a the reward is now set up to arrive at 8 second but the individual decides they don’t want to wait that long so the press the space bar, and then this begins the next trial which is let’s say 6 seconds. This is where the text comes into play because if they do chose to skip a trial I would like to inform them that are now in a different trial by saying “skipped” or “next” or something along those lines.

Since the participant decides if they want to wait for the reward or not, there is not a set amount of trials each participant gets, the only thing that is determined is the test block time (which is 5 minutes).

I currently have a key board response set up as following:

Screen Shot 2020-04-14 at 10.12.54 AM

Hope this is clear! If not I can try again.

Hi there, did you ever find the answer to this? I’m a new coder myself and am struggling with the same problem.
Thanks!