URL of experiment: https://pavlovia.org/L/cognitiveload_pupil
Description of the problem: Hello there, I have a rather specific problem with an experiment that I would like to run online. In my experiment, I first show a stimulus, then either a mask or nothing and finally a target in which participants are required to give an answer. I am trying to implement the either-or part, that is: either play a movie file of 2 seconds or show a text-component without any text in it for 2 seconds. On my computer, I found two ways to do this, but neither works online.
First one involves the coder where I flip a coin and set the status of the two components accordingly (for example: if coin == 0: movie.status = FINISHED, nothing.status = NOT_STARTED). Here, both the movie and the text component are part of the same routine. I cannot do that in the builder because the status of the components is set after the code from a code-component is inserted, thereby overwriting my changes.
The second solution works in the Builder. The movie and the text component are part of two different routines. Around each of these routines runs a dummy loop. Before the loops start, I flip a coin. According to this coin flip, the nReps of the DummyLoops are set to either 0 or 1 (following this tutorial ).
As mentioned above, both methods work locally (with the first one providing a nicer output-file), but neither works online. As far as I read, it is impossible to have coder-experiments online. As for the second, Builder-centered option: The browser is initialising the experiment forever.
So, here is my question: How could I have the running of a component or routine within a loop in an online experiment depend on a random variable that is set on every trial?
Any help is appreciated!