September 25, 2019 at 5:30 pm #4233
I have a script which was working fine until a day or two ago, but when I tested it today before going live I found out that the counter no longer increments when the experiment is called (I’m pretty sure I didn’t change anything in the meantime). I have two lists, A and B, and the following code right at the beginning of my main.js:
PennController.ResetPrefix(null); PennController.DebugOff(); PennController.SetCounter(); PennController.Sequence( "welcome", "practice1", "practice2", "practice3", randomize("experiment"), "goodbye" );
What’s supposed to happen – and what has happened before with this script and with others – is that each time the experiment is launched, the counter increments and the participant is assigned to a different list. But this no longer happens. Instead, the counter is only incremented and the Group is switched only once a participant has finished the experiment, as though the SetCounter() call was never there.
I tried adding some text like “setcounter” as an argument, putting the function call in different parts of the script, and using different operating systems (OS X, Ubuntu), different computers and different browsers. Nothing worked. Any idea what’s going on, or what I might be missing?
ItamarSeptember 25, 2019 at 5:49 pm #4234
When defining a sequence of trials manually (in your case, using the Sequence command) you need to make sure that all your trials are properly labeled for them to be executed in the order you stipulate. The command SetCounter actually creates a trial, which is no exception to this rule.
I think the following should accomplish what you want:
PennController.ResetPrefix(null); PennController.DebugOff(); PennController.SetCounter("increase"); PennController.Sequence( "increase", "welcome", "practice1", "practice2", "practice3", randomize("experiment"), "goodbye" );
If you don’t manually define the sequence of trials (i.e. no Sequence command and no definition of the internal Ibex shuffleSequence variable) then the trials are run in the top-down order in which they appear in your script. In your case, since SetCounter appears at the top of your script, it would be the first trial to be executed (if you had no Sequence command—are you sure this isn’t a recent addition?).
Let me know if that solved your issue and if you have any questions
September 25, 2019 at 5:53 pm #4235
- This reply was modified 9 months, 3 weeks ago by Jeremy. Reason: Added a note about absence of Sequence
I think that did the trick! Thanks again.
You must be logged in to reply to this topic.