Demo Scripts

Intermediate Demos

Blink Image Demo

Blink Image Demo

Blink demo that you can use to blink an entire block with included image or video.

How to Organize Trials

How to Organize Trials


Timer Demo Function

Timer Demo Function


Timer Demo

Timer Demo


Click on one of four images

Click on one of four images

How do we show four images on the screen and record which one the user has clicked? This situation occurs quite often, for example, in recognition memory experiments where you might ask "Which of these was shown before?".

How to use a token

How to use a token

This one-liner demo shows how you can add a token to the URL and use it in your script.

Test Radio Buttons

Test Radio Buttons

On Firefox for Android (in particular), radio buttons are hard to see. By changing the background to a darker color than white, they become clearly visible again. All official colors are listed in the sidebar, right to the edit window, under Scripting -> Colors. Also note, that the pseudo (unofficial) 'body-background-color' property can be used to easily style the space around the (main) Box.
 
You can also add a line of code to uncheck all options in order to not bias the subject, as is shown in the example.

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.


Demo playwave

Demo playwave

Introduces and defines a new function ‘playwave()’, which can be used to play a simple sound of a certain frequency, duration, loudness, and type (e.g., sine or square wave form) using only the HTML5 audio ‘context’.


Tic Tac Toe

Tic Tac Toe

Tic Tac Toe game demo, used elsewhere in a two-player mode (over Internet). Illustrates how to handle events (clicks) on many different blocks by defining a function that itself returns a function (a so called handler).


logtrial in practice

logtrial in practice

Demo how to use the logtrial() function in a typical reaction time experiment.


Sum Demo

Sum Demo

Show how to write and use a function that sums some values in an array.


Image Demo Keep Constant Height

Image Demo Keep Constant Height

Show image in a block with height at 100% of the block's height, with variable width. Suitable for showing images of printed words of varying width.

Scoring Demo

Scoring Demo


Score Word Responses

Score Word Responses

Function to help you score free recall answers as obtained with the largeinput() function. If you run it, you won't see any output. First open the console window (with F12 on Windows or Cmd + Option + J on a Mac). The output will appear there.

logtrial demo

logtrial demo


Digit Span Task

Digit Span Task

This is a fairly typical implementation of the digit span forward task, similar to what one might encounter in a neuropsychological test battery. The task takes less than 5 min and can be done on a PC with a mouse or on a large touchscreen (tablet or large mobile phone). The digit span is reported at the end of the task.


Lexical Decision Task

Lexical Decision Task

Fairly complete implementation of a typical lexical decision task, which takes about 6 min. It is suitable for use in lectures, where the audience can do the task on a laptop (keyboard). Because keyboard responses are required, the task cannot be taken on a mobile phone. Mean reaction times to words and nonwords are reported at the end with total correct responses. Individual subjects can also download their own data in a format that can be imported into a spreadsheet, like Excel or Google Sheets.


Go/No-Go Task

Go/No-Go Task

This is a fairly typical implementation of the Go/No-Go Task, which takes about 2.5 min. It is suitable for use in lectures, where the audience can take the test on a laptop (keyboard) or mobile phone (touch screen). Feedback is given (including d-prime based on Hits and False Alarms).


Basic 1-Back Task

Basic 1-Back Task

Brief demo of a 1-Back Task to get a feeling for how this task is often implemented. Stimuli are digits 1, 2, and 3 and order is fully random (and may differ per subject). Feedback is given at the end. Runs with keyboard, mouse, and touch screen.


Redirect Demo

Redirect Demo

Send your subjects to a different website.


Box Demo

Box Demo

This script illustrates how you can have a full width layout and still use the main-based convenience functions like text(), instruction(), etc.

Simple Graphics Demo

Simple Graphics Demo


Use of closesession()

Use of closesession()


PowerPoint-like Presentation with Slides

PowerPoint-like Presentation with Slides


Script 8.11. Simple bug catching game

Script 8.11. Simple bug catching game


Pong

Pong