Sketchpad duration error
Hello all,
I have an error in my OpenSesame experiment, but I just can’t pinpoint what exactly goes wrong.
I ‘ve attached a short version of the experiment, it recreates the problem that I’m having: I’m running a sequence in a block loop. Each loop starts with a sound (500ms) and is then followed by the presentation of a slider. Once participants click on the slider or once 9s pass, a feedback screen is presented (1s). It’s important that each loop lasts exactly 10s every time, no matter when participants click on the slider or whether they click anything at all (“None” as response). This is why the loop ends with a blank screen, which will be shown for the remaining seconds until it's 10s in total. The duration of this screen is calculated using an inline script within the loop:
if button != None: var.end_timer = clock.time() var.time_left = (10000-(var.end_timer-var.start_timer)) - 1000- 500 # (10s - elapsed time) - (blank/ feedback presentation time) - sound var.slider_percent = round(abs(slider_fill/615)*100,0) # calculate rating based on rectangle fill break
The loops work exactly as they should, with one exception: If there is no click on the slider, then this None response loop works. However, in the loop right afterwards, the blank screen will not be shown for the duration of time_left
when the scale is clicked again, but only for less than a second (very short). In the variable inspector, I can see that the variable time_left
is correctly calculated while running the experiment, but then not properly executed(?) for the sketchpad duration. This only happens for the trial right after no response was given. Does anybody know why this happens and how I could fix it?
Thanks a lot!
Comments
Hi @Franzi,
Very funky code. I like the responsive gauge level controlled with the mouse.- neat!
Regarding your question: I think that the problem is that you use a sketchpad instead of a feedback object for your blank screen. The properties of sketchpads are set before the trial begins, which means that its duration is set before your code calculating it is run. As a result, hat is happening is that your calculation is applied to the next trial instead of the current trial. This is why you get a very short duration after a trial without responding.
Just replace the sketchpad with a feedback object (with the duration set to [
[time_left]
), and it should work fine. The properties of feedback objects can be modified as the trial unravels (sketchpad can't do this).Hope this helps,
Fabrice.
Hi @Fab,
YES this worked perfectly, thank you so much for the quick help!
Cheers,
Franzi