mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
small update to info section
This commit is contained in:
parent
af0dad88ec
commit
c156bcc444
@ -69,11 +69,21 @@ If the `default` value is `undefined` then a user must specify a value for this
|
|||||||
|
|
||||||
jsPsych allows most [plugin parameters to be dynamic](/overview/dynamic-parameters.md), which means that the parameter value can be a function that will be evaluated right before the trial starts. However, if you want your plugin to have a parameter that is a function that _shouldn't_ be evaluated before the trial starts, then you should make sure that the parameter type is `'FUNCTION'`. This tells jsPsych not to evaluate the function as it normally does for dynamic parameters. See the `canvas-*` plugins for examples.
|
jsPsych allows most [plugin parameters to be dynamic](/overview/dynamic-parameters.md), which means that the parameter value can be a function that will be evaluated right before the trial starts. However, if you want your plugin to have a parameter that is a function that _shouldn't_ be evaluated before the trial starts, then you should make sure that the parameter type is `'FUNCTION'`. This tells jsPsych not to evaluate the function as it normally does for dynamic parameters. See the `canvas-*` plugins for examples.
|
||||||
|
|
||||||
The `info` object should be a `static` member of the class.
|
The `info` object should be a `static` member of the class, as shown below.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const info = {
|
const info = {
|
||||||
...
|
name: 'my-awesome-plugin',
|
||||||
|
parameters: {
|
||||||
|
image: {
|
||||||
|
type: jspsych.ParameterType.IMAGE,
|
||||||
|
default: undefined
|
||||||
|
},
|
||||||
|
image_duration: {
|
||||||
|
type: jspsych.ParameterType.INT,
|
||||||
|
default: 500
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyAwesomePlugin {
|
class MyAwesomePlugin {
|
||||||
|
Loading…
Reference in New Issue
Block a user