jsPsych/docs/markdown_docs/plugins/jspsych-text.md
2017-06-19 11:03:26 -04:00

2.0 KiB

jspsych-text plugin

This plugin is for showing instructions and other basic HTML content to the subject.

Parameters

This table lists the parameters associated with this plugin. Parameters with a default value of undefined must be specified. Other parameters can be left unspecified if the default value is acceptable.

Parameter Type Default Value Description
text string undefined A string containing HTML formatted text (no HTML code is necessary, but it is allowed).
choices array [ ] This array contains the keys that the subject is allowed to press in order to advance to the next trial. Keys can be specified as their numeric key code or as characters (e.g. 'a', 'q'). The default value of an empty array means that all keys will be accepted as valid responses.
allow_mouse_click boolean false If true, then clicking the mouse will advance to the next trial.

Data Generated

In addition to the default data collected by all plugins, this plugin collects the following data for each trial.

Name Type Value
key_press numeric Indicates which key the subject pressed. The value is the numeric key code corresponding to the subject's response.
rt numeric The response time in milliseconds for the subject to make a response. The time is measured from when the stimulus first appears on the screen until the subject's response.

Example

Showing a welcome message

var block = {
	type: 'text',
	text: 'Welcome to the experiment. Press any key to begin.'
}

User must click mouse to continue

var block = {
	type: 'text',
	text: 'Welcome to the experiment. Click anywhere to begin.'
	choices: jsPsych.NO_KEYS,
	allow_mouse_click: true
}