mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 19:20:55 +00:00
update documentation for plugin instructions
This commit is contained in:
parent
14fd8573bd
commit
7eac06cb58
@ -8,18 +8,19 @@ This plugin is for showing instructions to the participant. It allows participan
|
|||||||
|
|
||||||
In addition to the [parameters available in all plugins](../overview/plugins.md#parameters-available-in-all-plugins), this plugin accepts the following parameters. Parameters with a default value of *undefined* must be specified. Other parameters can be left unspecified if the default value is acceptable.
|
In addition to the [parameters available in all plugins](../overview/plugins.md#parameters-available-in-all-plugins), this plugin accepts the following parameters. 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 |
|
| Parameter | Type | Default Value | Description |
|
||||||
| --------------------- | ------- | ------------- | ---------------------------------------- |
|
| --------------------- | -------- | ------------- | ---------------------------------------- |
|
||||||
| pages | array | *undefined* | Each element of the array is the content for a single page. Each page should be an HTML-formatted string. |
|
| pages | array | *undefined* | Each element of the array is the content for a single page. Each page should be an HTML-formatted string. |
|
||||||
| key_forward | string | 'ArrowRight' | This is the key that the participant can press in order to advance to the next page. This key should be specified as a string (e.g., `'a'`, `'ArrowLeft'`, `' '`, `'Enter'`). |
|
| key_forward | string | 'ArrowRight' | This is the key that the participant can press in order to advance to the next page. This key should be specified as a string (e.g., `'a'`, `'ArrowLeft'`, `' '`, `'Enter'`). |
|
||||||
| key_backward | string | 'ArrowLeft' | This is the key that the participant can press to return to the previous page. This key should be specified as a string (e.g., `'a'`, `'ArrowLeft'`, `' '`, `'Enter'`). |
|
| key_backward | string | 'ArrowLeft' | This is the key that the participant can press to return to the previous page. This key should be specified as a string (e.g., `'a'`, `'ArrowLeft'`, `' '`, `'Enter'`). |
|
||||||
| allow_backward | boolean | true | If true, the participant can return to previous pages of the instructions. If false, they may only advace to the next page. |
|
| allow_backward | boolean | true | If true, the participant can return to previous pages of the instructions. If false, they may only advace to the next page. |
|
||||||
| allow_keys | boolean | true | If `true`, the participant can use keyboard keys to navigate the pages. If `false`, they may not. |
|
| allow_keys | boolean | true | If `true`, the participant can use keyboard keys to navigate the pages. If `false`, they may not. |
|
||||||
| show_clickable_nav | boolean | false | If true, then a `Previous` and `Next` button will be displayed beneath the instructions. Participants can click the buttons to navigate. |
|
| show_clickable_nav | boolean | false | If true, then a `Previous` and `Next` button will be displayed beneath the instructions. Participants can click the buttons to navigate. |
|
||||||
| button_label_previous | string | 'Previous' | The text that appears on the button to go backwards. |
|
| button_label_previous | string | 'Previous' | The text that appears on the button to go backwards. |
|
||||||
| button_label_next | string | 'Next' | The text that appears on the button to go forwards. |
|
| button_label_next | string | 'Next' | The text that appears on the button to go forwards. |
|
||||||
| show_page_number | boolean | false | If true, and clickable navigation is enabled, then Page x/y will be shown between the nav buttons. |
|
| show_page_number | boolean | false | If true, and clickable navigation is enabled, then Page x/y will be shown between the nav buttons. |
|
||||||
| page_label | string | 'Page' | The text that appears before x/y pages displayed when show_page_number is true. |
|
| page_label | string | 'Page' | The text that appears before x/y pages displayed when show_page_number is true. |
|
||||||
|
| page_change_callback | function | ``function (current_page) {}`` | The function that is called every time the page changes. This function receives a single argument `current_page`, which is the index of the current page **after page change**, and starts at `0`. The function is also called when going forward from the last page, i.e., finishing the trial. |
|
||||||
|
|
||||||
## Data Generated
|
## Data Generated
|
||||||
|
|
||||||
@ -128,4 +129,4 @@ import instructions from '@jspsych/plugin-instructions';
|
|||||||
<iframe src="../../demos/jspsych-instructions-demo-3.html" width="90%;" height="500px;" frameBorder="0"></iframe>
|
<iframe src="../../demos/jspsych-instructions-demo-3.html" width="90%;" height="500px;" frameBorder="0"></iframe>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a target="_blank" rel="noopener noreferrer" href="../../demos/jspsych-instructions-demo-3.html">Open demo in new tab</a>
|
<a target="_blank" rel="noopener noreferrer" href="../../demos/jspsych-instructions-demo-3.html">Open demo in new tab</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user