psychopy.org | Reference | Downloads | Github

Conditional stimulus appears before .status==FINISHED

I’m trying to make a stimulus called “central_fixation_gap” appear once another stimulus offsets (disappears from the screen). To do this, I’ve made the “Start” of the stimulus a condition, where I plug in a “central_gap” parameter in my excel file.

The central_gap parameter looks like this in the excel file:
Screen Shot 2020-06-14 at 7.12.47 PM

Basically, on some trials, the central_fixation_gap stimulus should appear once the fixation_start stimulus disappears, and on other trials, it should appear once the no_go_fixation stimulus disappears.

THE PROBLEM: The central_fixation_gap stimulus appears before either stimulus disappears. What is going wrong?

Thanks in advance.

  • Remove the dollar signs from your conditions file.
  • Try something like this in your start condition field:
$eval(central_gap)

i.e. currently your central_gap variable just contains a string of characters. Python needs to be told to evaluate those characters and interpret them as a code expression. The $ symbol is not valid Python code (it’s just a hint to Builder itself), so that needs to be deleted in your conditions file.

Depending on circumstances, Python can evaluate any non-empty string of characters as True (only an empty string is regarded as False), so that probably explains what you are seeing. i.e. whatever string you provide in your conditions file, the condition evaluates to True, so the stimulus always appears immediately. So you need to get Python to evaluate the actual code expressions contained within your strings.

1 Like