This commit is contained in:
Josh de Leeuw 2016-05-21 22:20:04 -04:00
parent 9b2c5d5932
commit 9d4d294bad
2 changed files with 38 additions and 0 deletions

View File

@ -1,5 +1,42 @@
# The jsPsych core library
---
## jsPsych.addNodeToEndOfTimeline
```
jsPsych.addNodeToEndOfTimeline(node_parameters)
```
### Parameters
Parameter | Type | Description
--------- | ---- | -----------
node_parameters | object | An object defining a timeline. It must have, at a minimum, a `timeline` parameter with a valid timeline array as the value for that parameter.
### Return value
None.
### Description
Adds the timeline to the end of the experiment.
### Example
#### End the experiment if a particular response is given
```javascript
var trial = {
type: 'text',
text: 'This is a new trial.'
}
var new_timeline = {
timeline: [trial]
}
jsPsych.addNodeToEndOfTimeline(new_timeline)
```
---
## jsPsych.currentTimelineNodeID

View File

@ -6,6 +6,7 @@ Every jsPsych experiment utilizes the core library (contained in the `jspsych.js
### [Core](jspsych-core.md)
* [jsPsych.addNodeToEndOfTimeline](jspsych-core.md#jspsychaddnodetoendoftimeline)
* [jsPsych.currentTimelineNodeID](jspsych-core.md#jspsychcurrenttimelinenodeid)
* [jsPsych.currentTrial](jspsych-core.md#jspsychcurrenttrial)
* [jsPsych.endCurrentTimeline](jspsych-core.md#jspsychendcurrenttimeline)