PennController for IBEX › Forums › Support › SetCounter() no longer increments the counter
- This topic has 2 replies, 2 voices, and was last updated 5 years ago by itamar.
-
AuthorPosts
-
September 25, 2019 at 5:30 pm #4233itamarParticipant
Hi,
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?
Thanks,
ItamarSeptember 25, 2019 at 5:49 pm #4234JeremyKeymasterHi Itamar,
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
Jeremy
- This reply was modified 5 years ago by Jeremy. Reason: Added a note about absence of Sequence
September 25, 2019 at 5:53 pm #4235itamarParticipantI think that did the trick! Thanks again.
-
AuthorPosts
- You must be logged in to reply to this topic.