Notes
Getting Started with NeuroTask Scripting
1In some case, ambiguities may arise if semi-colons are left out. They also often make it easier to find an error.↩
2It is not necessary to indent the statements in the body, but it makes for more readable code and often helps to prevent errors; it is completely legal to leave out all spaces in this example. This is an example of adding arbitrary white space to make a script more legible to the human eye. If you are used to the programming language Python, you will certainly recognize how valuable indenting can be to keep scripts readable and easy to maintain.↩
3This is borrowed from the programming language C, as is much of JavaScript, such as the for loop and the way values are assigned with the expression i = 0.↩
Capturing Keys and Reaction Times
1Some screens now use a refresh rate of 70, 90, or 120 times per second. Especially phone screens may have higher refresh rates to reflect dragging and other actions better.↩
2This works well on modern Internet browsers but is not reliable on older browsers. The details on this browser technology, based on requestAnimationFrame, are discussed in section 7.2 and chapter 8, as well as in the advanced NeuroTask manual.↩
3Later, we will see a way around this using the waitfor statement, with which you can combine several await() statements.↩
4This means that while the now() timer is extremely precise, it cannot tell you anything about what time of day it was when the subject completed your experiment. It cannot place when the timer was started and stopped within any greater context. Fortunately, date and time are automatically logged by the browser whenever an event occurs and reported in the timestamp property of all NeuroTask events.↩
Screen layout with “Box” and “Block”
1We may add a format that allows scrolling in the future, but at the moment we see no good application for it in experiments.↩
2HTML is the language in which the structure and markup of webpages is specified. At the HTML Dog website (http://htmldog.com/guides/html/beginner/), you can find a good beginner’s guide. For most experiments, you do not need to know HTML, though it may be handy to know a few basics, like how to show a word in bold face or italics.↩
Style
1If you look up some style properties, you will notice that (especially somewhat older) browsers do not support them all in the same way. Therefore, to the extent that it is possible, NeuroTask Scripting relies on the extensive and well-tested Dojo Toolkit to correct cross-browser problems.↩
Survey questions with form controls
1Normally an experiment would include a much longer instruction section, including an information brochure and an informed consent form.↩
Data logging and handling
1RAF is an abbreviation of ‘requestAnimationFrame’, this is a signal that the next screen is about to be generated by the computer, which typically happens exactly 60 times per second though depends on the computer or phone. See the advanced manual for a more in-depth discussion of this.↩
2Many values in JavaScript are considered false, e.g., undefined, null, 0, and the empty string "". We advise not to rely on this except with well-known usage cases, like this.↩
3SPSS output is not supported at the moment, but will be in the future, as will be other formats if there is a demand for it.↩