PennController for IBEX › Forums › Support › Timers
- This topic has 17 replies, 2 voices, and was last updated 2 years, 10 months ago by Jeremy.
-
AuthorPosts
-
January 19, 2022 at 3:58 pm #7687JeremyKeymaster
Hi Elias,
Demonstration links give access to all of the project’s code by a simple click on the “edit” link at the top of the page. If you’re talking about live-sharing, as in Google Docs for example, where one can see someone else’s edits in real time, it’s not currently possible on the PCIbex Farm
Note that, if we’re talking about the project at https://farm.pcibex.net/r/rWbWmp/, you have 3 .js files in the Scripts folder (phase 3.js appears twice, which must be a bug—make sure you save a copy of your code, delete the file and recreate it). All files are executed in an alphanumeric order, so when you run your experiment, Phase 1.js will be executed first, then Phase2.js and finally phase 3.js. By “executed” here I mean that the global commands of each file take effect in that linear order (the commands inside the
newTrial
s will be executed later, when each trial is run—the trials themselves are all created when the files are read)In particular, you have four
SendResults
commands in Phase2.js and anotherSendResults
command in phase 3.js. Because there is noSequence
command anywhere in those js files, the trials are simply run in the order in which they are created, which means: all the trials from Phase 1.js first, all the trials from Phase2.js then, and finally all the trials from phase 3.js. This is something you can confirm by looking up the list of trials in the “Sequence” tab of the debugger when you test your experimentAll that being said, you have an unlabeled trial at the end of Phase2.js which ends with
newButton().wait()
, which means that the experiment will hang there, and never actually run the trials from phase 3.js (even though you can see them in the debugger’s “Sequence” tab starting at trial #66)At the end of the day, what you should remember is that all you js files are executed and their trials created, so if you have a command
Sequence( randomize("experimental-trial") )
in any of those files, your experiment will only run trials labeled “experimental-trial”, but importantly, trials from all three files (because you create trials labeled “experimental-trial” in all three of your files)I hope these comments brought some clarity as to how trials are created and run in PennController
Jeremy
January 27, 2022 at 12:18 am #7701Elias.mohammad2ParticipantHi Jeremy,
Thanks for the great explanation! I have figured that part out; however, I need the consent, questionnaire, and instructions run before all of phases 1,2, and 3. Is there any way that is possible? Those files are resources and not js files.
Elias
January 27, 2022 at 11:46 am #7704JeremyKeymasterHi Elias,
Like I said, in the absence of a
Sequence
command, the trials are run in the order in which they are defined. Most projects use a single .js script file, so that would mean that in the absence of aSequence
command, the trial would be run in the top-down order in which they appear in that single script file. In your case, you happen to have more than one .js script file, but that’s orthogonal to including HTML content in your trialsThe next page of the advanced tutorial which I linked to in my previous message, titled Collecting participant information, illustrates how to inject the content of an HTML file from your project’s Resources folder into a
newTrial
. Then you simply use theSequence
command to control the order in which you trials are runJeremy
-
AuthorPosts
- You must be logged in to reply to this topic.