mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
flesh out extension description and fix minor details
This commit is contained in:
parent
96c7092042
commit
8d40c445b4
@ -66,7 +66,7 @@ let trial = {
|
||||
extensions: [
|
||||
{type: myAwesomeExtension, params: {demo: 'value'}}
|
||||
]
|
||||
});
|
||||
};
|
||||
|
||||
//... extension code ...//
|
||||
class MyAwesomeExtension {
|
||||
@ -91,7 +91,7 @@ let trial = {
|
||||
extensions: [
|
||||
{type: myAwesomeExtension, params: {demo: 'value'}}
|
||||
]
|
||||
});
|
||||
};
|
||||
|
||||
//... extension code ...//
|
||||
class MyAwesomeExtension {
|
||||
@ -122,7 +122,7 @@ let trial = {
|
||||
on_finish: (data) => {
|
||||
console.log(data.awesome); // will output 'value'.
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//... extension code ...//
|
||||
class MyAwesomeExtension {
|
||||
@ -168,9 +168,11 @@ The `version` field describes the version of the extension used and then durin t
|
||||
|
||||
The `data` field is an object containing all of the `data` generated for the plugin. Each 'data' object has a `type` and `default` property. Additionally, this should be only used for data you choose to generate. Any jsdoc (comments included in the /** */ tags) you include will be scraped as metadata if you are choosing to generate metadata. This scraped metadata will also be used to create the JsPsych documentation.
|
||||
|
||||
For more information on the various types of parameters one can include in their data field, see [here](./plugin-development.md#parameter-types).
|
||||
|
||||
### Optional methods
|
||||
|
||||
The extension can also include any additional methods that are necessary for interacting with it. See the [webgazer extension](../extensions/webgazer.md) for an example.
|
||||
The extension can also include any additional methods that are necessary for interacting with it. See the [WebGazer extension](../extensions/webgazer.md) for an example.
|
||||
|
||||
## Advice for writing extensions
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Extensions
|
||||
|
||||
Extensions are jsPsych modules that can interface with any plugin to extend the functionality of the plugin. A canonical example of an extension is eye tracking. An eye tracking extension allows a plugin to gather gaze data and add it to the plugin's data object.
|
||||
In jsPsych, extensions allow one to extend the functionality of various plugins, giving individual plugins the ability to collect more data, display additional stimuli, and more. A canonical example of an extension is [eye tracking](../extensions/webgazer.md), which allow plugins to gather gaze data and add it to the their respective data objects. For a full list of extensions directly included in the jsPsych release, see [here](../extensions/list-of-extensions.md).
|
||||
|
||||
## Using an Extension
|
||||
|
||||
@ -31,12 +31,6 @@ var trial = {
|
||||
}
|
||||
```
|
||||
|
||||
## List of Extensions
|
||||
|
||||
Extension | Description
|
||||
------ | -----------
|
||||
[jspsych‑ext‑webgazer.js](../extensions/webgazer.md) | Enables eye tracking using the [WebGazer](https://webgazer.cs.brown.edu/) library.
|
||||
|
||||
## Writing an Extension
|
||||
|
||||
See our [developer's guide for extensions](../developers/extension-development.md) for information about how to create a new extension.
|
Loading…
Reference in New Issue
Block a user