Demo Scripts

Intermediate Demos

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.


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


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()


Script 8.11. Simple bug catching game

Script 8.11. Simple bug catching game


Pong

Pong