Demo Scripts

Beginner Demos

Set the Font Size for All Controls

Set the Font Size for All Controls

If you are using the standard controls like input(), instruction(), select() the standard font size is usually too large. You can make it smaller as follows with one line: main.setfontsize(70) (for 70% sized font size).

Clearing the Key Buffer

Clearing the Key Buffer

If you use an awaitkey() the subjects's response will 'linger' even after the awaitkey() call and will remain active. E.g., an Enter key stroke will 'linger' and remain active and will 'click' the following OK button. This can easily be prevented by using preventDefault(), a standard JavaScript function. See the code.

White Text on Black

White Text on Black

To achieve white text on a completely black background, you can use a new Box as described in the book but it is usually easier to restyle the main function, because all of the standard controls still work and are easier to use, especially for beginners with NeuroTask Scripting. See the code.

Informed Consent Demo

Informed Consent Demo

Shows how to implement informed consent screens with downloadable PDFs and an ‘Accept’ checkbox.


mailto

mailto

Shows how you can open the subjects’ email program and have them, for example, invite friends in this manner to also take your experiment.


Stroop Task Demo

Stroop Task Demo

Demo of the classic Stroop Task adjusted for the online use.


Combined Logging

Combined Logging

Demonstrates how you can combine the inputs from several controls and log it as a string. It also shows how to check whether a certain word is contained within the subject’s answer.


Likert Scale Demo

Likert Scale Demo

Illustrates the use of scale() to generate a basic Likert scale as explained in Chapter  6 of the Leanpub book.


waitfor or Demo

waitfor or Demo

Illustrates how to use the waitfor ... or statement to wait for several events at once. As soon as one occurs, processing of the script continues. It also illustrates how to style a button.


Select Control - Demo

Select Control - Demo

Illustrates the use of the select() function that generates a select control, as explained in Chapter 6 of the Leanpub book.


Statistics

Statistics

Demo of built-in statistics functions


Redirect Demo

Redirect Demo

Send your subjects to a different website.


Progress Bar

Progress Bar

Shows how to make a simple progress bar by superimposing two blocks and then changing the shape of the upper block.

Script 2.7 - Lexical Decision

Script 2.7 - Lexical Decision


Reaction Time

Reaction Time


Sound 2

Sound 2


Combining Multiple Controls

Combining Multiple Controls

This demo illustrates how you can combine several controls on one page in such a way that they are still processed automatically by the NeuroTask libraries.


Corsi Blocks (Simplified)

Corsi Blocks (Simplified)

Functional Corsi Block Tap test with immediate feedback. Does not store any data. Useful for demonstrations or informal testing.