mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
features -> overview
This commit is contained in:
parent
d65bbe0ffe
commit
bdffecf038
@ -294,7 +294,7 @@ The settings object can contain several parameters. The only *required* paramete
|
|||||||
|
|
||||||
Parameter | Type | Description
|
Parameter | Type | Description
|
||||||
--------- | ---- | -----------
|
--------- | ---- | -----------
|
||||||
timeline | array | An array containing the objects that describe the experiment timeline. See [Creating an Experiment: The Timeline](../features/timeline.md).
|
timeline | array | An array containing the objects that describe the experiment timeline. See [Creating an Experiment: The Timeline](../overview/timeline.md).
|
||||||
display_element | string | The ID of an HTML element to display the experiment in. If left blank, then jsPsych will use the `<body>` element to display content (creating it if necessary). You can override this parameter at the trial level as well by specifying a display_element property on any timeline.
|
display_element | string | The ID of an HTML element to display the experiment in. If left blank, then jsPsych will use the `<body>` element to display content (creating it if necessary). You can override this parameter at the trial level as well by specifying a display_element property on any timeline.
|
||||||
on_finish | function | Function to execute when the experiment ends.
|
on_finish | function | Function to execute when the experiment ends.
|
||||||
on_trial_start | function | Function to execute when a new trial begins.
|
on_trial_start | function | Function to execute when a new trial begins.
|
||||||
@ -302,7 +302,7 @@ on_trial_finish | function | Function to execute when a trial ends.
|
|||||||
on_data_update | function | Function to execute every time data is stored using the `jsPsych.data.write` method. All plugins use this method to save data (via a call to `jsPsych.finishTrial`, so this function runs every time a plugin stores new data.
|
on_data_update | function | Function to execute every time data is stored using the `jsPsych.data.write` method. All plugins use this method to save data (via a call to `jsPsych.finishTrial`, so this function runs every time a plugin stores new data.
|
||||||
on_interaction_data_update | function | Function to execute every time a new interaction event occurs. Interaction events include clicking on a different window (blur), returning to the experiment window (focus), entering full screen mode (fullscreenenter), and exiting full screen mode (fullscreenexit).
|
on_interaction_data_update | function | Function to execute every time a new interaction event occurs. Interaction events include clicking on a different window (blur), returning to the experiment window (focus), entering full screen mode (fullscreenenter), and exiting full screen mode (fullscreenexit).
|
||||||
exclusions | object | Specifies restrictions on the browser the subject can use to complete the experiment. See list of options below.
|
exclusions | object | Specifies restrictions on the browser the subject can use to complete the experiment. See list of options below.
|
||||||
show_progress_bar | boolean | If true, then [a progress bar](../features/progress-bar.md) is shown at the top of the page.
|
show_progress_bar | boolean | If true, then [a progress bar](../overview/progress-bar.md) is shown at the top of the page.
|
||||||
auto_update_progress_bar | boolean | If true, then the progress bar at the top of the page will automatically update as every top-level timeline or trial is completed.
|
auto_update_progress_bar | boolean | If true, then the progress bar at the top of the page will automatically update as every top-level timeline or trial is completed.
|
||||||
show_preload_progress_bar | boolean | If true, then a progress bar is displayed while media files are automatically preloaded.
|
show_preload_progress_bar | boolean | If true, then a progress bar is displayed while media files are automatically preloaded.
|
||||||
preload_audio | array | An array of audio files to preload before starting the experiment.
|
preload_audio | array | An array of audio files to preload before starting the experiment.
|
||||||
|
@ -325,7 +325,7 @@ Returns nothing.
|
|||||||
|
|
||||||
### Description
|
### Description
|
||||||
|
|
||||||
Use this function to preload audio files that are not part of a plugin with automatic preloading. Audio files in official plugins will automatically preload. See [Media Preloading](../features/media-preloading.md) for more information.
|
Use this function to preload audio files that are not part of a plugin with automatic preloading. Audio files in official plugins will automatically preload. See [Media Preloading](../overview/media-preloading.md) for more information.
|
||||||
|
|
||||||
It is possible to run this function without specifying a callback function. However, in this case the code will continue executing while the files are loaded. Thus, it is possible that an audio file would be required for playing before it is done preloading. The `callback_complete` function will only execute after all the audio files are loaded, and can be used to control the flow of the experiment (e.g., by starting the experiment in the `callback_complete` function).
|
It is possible to run this function without specifying a callback function. However, in this case the code will continue executing while the files are loaded. Thus, it is possible that an audio file would be required for playing before it is done preloading. The `callback_complete` function will only execute after all the audio files are loaded, and can be used to control the flow of the experiment (e.g., by starting the experiment in the `callback_complete` function).
|
||||||
|
|
||||||
@ -392,7 +392,7 @@ Returns nothing.
|
|||||||
|
|
||||||
### Description
|
### Description
|
||||||
|
|
||||||
Use this function to preload image files that are not part of a plugin with automatic preloading. Image files in official plugins will automatically preload. See [Media Preloading](../features/media-preloading.md) for more information.
|
Use this function to preload image files that are not part of a plugin with automatic preloading. Image files in official plugins will automatically preload. See [Media Preloading](../overview/media-preloading.md) for more information.
|
||||||
|
|
||||||
It is possible to run this function without specifying a callback function. However, in this case the code will continue executing while the images are loaded. Thus, it is possible that an image would be required for display before it is done preloading. The `callback_complete` function will only execute after all the images are loaded, and can be used to control the flow of the experiment (e.g., by starting the experiment in the `callback_complete` function).
|
It is possible to run this function without specifying a callback function. However, in this case the code will continue executing while the images are loaded. Thus, it is possible that an image would be required for display before it is done preloading. The `callback_complete` function will only execute after all the images are loaded, and can be used to control the flow of the experiment (e.g., by starting the experiment in the `callback_complete` function).
|
||||||
|
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
|
|
||||||
jsPsych is a JavaScript library for running behavioral experiments in a web browser. The library provides a flexible framework for building a wide range of laboratory-like experiments that can be run online.
|
jsPsych is a JavaScript library for running behavioral experiments in a web browser. The library provides a flexible framework for building a wide range of laboratory-like experiments that can be run online.
|
||||||
|
|
||||||
To use jsPsych, you provide a description of the experiment in the form of [a timeline](features/timeline.md). jsPsych handles things like determining which trial to run next, storing data, and randomization. jsPsych uses *plugins* to define what to do at each point on the timeline. Plugins are ready-made templates for simple experimental tasks like displaying instructions or displaying a stimulus and collecting a keyboard response. Plugins are very flexible to support a wide variety of experiments. It is easy to create your own plugin if you have experience with JavaScript programming.
|
To use jsPsych, you provide a description of the experiment in the form of [a timeline](overview/timeline.md). jsPsych handles things like determining which trial to run next, storing data, and randomization. jsPsych uses *plugins* to define what to do at each point on the timeline. Plugins are ready-made templates for simple experimental tasks like displaying instructions or displaying a stimulus and collecting a keyboard response. Plugins are very flexible to support a wide variety of experiments. It is easy to create your own plugin if you have experience with JavaScript programming.
|
||||||
|
|
||||||
[The page on timelines](features/timeline.md) is a good place to start learning about jsPsych. From there, you might want to complete the [Hello World! tutorial](tutorials/hello-world.md) and the [reaction time experiment tutorial](tutorials/rt-task.md).
|
[The page on timelines](overview/timeline.md) is a good place to start learning about jsPsych. From there, you might want to complete the [Hello World! tutorial](tutorials/hello-world.md) and the [reaction time experiment tutorial](tutorials/rt-task.md).
|
||||||
|
@ -42,8 +42,8 @@ In addition, there is a set of parameters that can be specified for any plugin.
|
|||||||
Parameter | Type | Default Value | Description
|
Parameter | Type | Default Value | Description
|
||||||
----------|------|---------------|------------
|
----------|------|---------------|------------
|
||||||
post_trial_gap | numeric | 1000 | Sets the time, in milliseconds, between the current trial and the next trial.
|
post_trial_gap | numeric | 1000 | Sets the time, in milliseconds, between the current trial and the next trial.
|
||||||
on_finish | function | *undefined* | A callback function to execute when the trial finishes. See [this page](../features/callbacks.md) for more details.
|
on_finish | function | *undefined* | A callback function to execute when the trial finishes. See [this page](../overview/callbacks.md) for more details.
|
||||||
data | object | *undefined* | An object containing additional data to store for the trial. See [this page](../features/data.md) for more details.
|
data | object | *undefined* | An object containing additional data to store for the trial. See [this page](../overview/data.md) for more details.
|
||||||
|
|
||||||
## Data collected by plugins
|
## Data collected by plugins
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ In the code above, we replaced the `trial_duration: 1000` parameter in `fixation
|
|||||||
|
|
||||||
We have created a complete, if simple, experiment at this point, so let's take a look at the data being generated. jsPsych has a built-in [function called `jsPsych.data.displayData()`](../core_library/jspsych-data.md#jspsychdatadisplaydata) that is useful for debugging your experiment. It will remove all of the information on the screen and replace it with the raw data collected so far. This isn't terribly useful when you are actually running an experiment, but it's nice for checking the data during development.
|
We have created a complete, if simple, experiment at this point, so let's take a look at the data being generated. jsPsych has a built-in [function called `jsPsych.data.displayData()`](../core_library/jspsych-data.md#jspsychdatadisplaydata) that is useful for debugging your experiment. It will remove all of the information on the screen and replace it with the raw data collected so far. This isn't terribly useful when you are actually running an experiment, but it's nice for checking the data during development.
|
||||||
|
|
||||||
We need the `displayData` function to execute when the experiment ends. One way to do this is to use the [`on_finish` callback function](../features/callbacks.md#on_finish-experiment). This function will automatically execute once all the trials in the experiment are finished. We can specify a function to call in the `init` method.
|
We need the `displayData` function to execute when the experiment ends. One way to do this is to use the [`on_finish` callback function](../overview/callbacks.md#on_finish-experiment). This function will automatically execute once all the trials in the experiment are finished. We can specify a function to call in the `init` method.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
jsPsych.init({
|
jsPsych.init({
|
||||||
|
20
mkdocs.yml
20
mkdocs.yml
@ -23,16 +23,16 @@ pages:
|
|||||||
- 'The Basics: Hello World': 'tutorials/hello-world.md'
|
- 'The Basics: Hello World': 'tutorials/hello-world.md'
|
||||||
- 'Demo Experiment: Simple Reaction Time Task': 'tutorials/rt-task.md'
|
- 'Demo Experiment: Simple Reaction Time Task': 'tutorials/rt-task.md'
|
||||||
- Overview:
|
- Overview:
|
||||||
- 'Creating an Experiment: The Timeline': 'features/timeline.md'
|
- 'Creating an Experiment: The Timeline': 'overview/timeline.md'
|
||||||
- 'Advanced Options for Trials': 'features/trial.md'
|
- 'Advanced Options for Trials': 'overview/trial.md'
|
||||||
- 'Data Storage, Aggregation, and Manipulation': 'features/data.md'
|
- 'Data Storage, Aggregation, and Manipulation': 'overview/data.md'
|
||||||
- 'Event-related Callback Functions': 'features/callbacks.md'
|
- 'Event-related Callback Functions': 'overview/callbacks.md'
|
||||||
- 'Record Browser Interactions': 'features/record-browser-interactions.md'
|
- 'Record Browser Interactions': 'overview/record-browser-interactions.md'
|
||||||
- 'Media Preloading': 'features/media-preloading.md'
|
- 'Media Preloading': 'overview/media-preloading.md'
|
||||||
- 'Fullscreen Experiments': 'features/fullscreen.md'
|
- 'Fullscreen Experiments': 'overview/fullscreen.md'
|
||||||
- 'Exclude Participants Based on Browser Features': 'features/exclude-browser.md'
|
- 'Exclude Participants Based on Browser Features': 'overview/exclude-browser.md'
|
||||||
- 'Automatic Progress Bar': 'features/progress-bar.md'
|
- 'Automatic Progress Bar': 'overview/progress-bar.md'
|
||||||
- 'Integrating with Mechanical Turk': 'features/mturk.md'
|
- 'Integrating with Mechanical Turk': 'overview/mturk.md'
|
||||||
- Core Library API:
|
- Core Library API:
|
||||||
- 'jsPsych': 'core_library/jspsych-core.md'
|
- 'jsPsych': 'core_library/jspsych-core.md'
|
||||||
- 'jsPsych.data': 'core_library/jspsych-data.md'
|
- 'jsPsych.data': 'core_library/jspsych-data.md'
|
||||||
|
Loading…
Reference in New Issue
Block a user