Random stimulus presentation time
Hello!
I was trying to implement an experiment for the university in OpenSesame and found myself stuck at one moment. I need to create a sketchpad with the fixation dot, which should be shown to the participants for a random period of 0–10,000 ms.
I understand that random timing can be done using an inline script, however, every my attempt to create one ends up with plenty of bugs and experiment not working.
As far as I understand, the code should look somewhat like this and be implemented inside the trial sequence before the sketchpad. The duration
import random
random_time = random.randint(0,10000)
self.experiment.set("random01", random_time)
I just don't understand what exactly I am doing wrong... Would be grateful for any help, thanks!
Comments
Hi @wyeird
You were quite close, except that the
self.experiment.set()function is outdated. It is easier to use thevarobject like so:Make sure to:
inline_scriptitem before thesketchpaditem that you want to determine the duration forI uploaded an example.
Cheers,
Lotje
Did you like my answer? Feel free to
