From 71172ff551a5037ac6a22fdd413225415559d573 Mon Sep 17 00:00:00 2001 From: Josh de Leeuw Date: Tue, 2 Jan 2018 22:49:20 -0500 Subject: [PATCH] docs updates --- .../plugins/jspsych-same-different-html.md | 45 ++++------------ .../plugins/jspsych-same-different-image.md | 46 ++++++---------- .../plugins/jspsych-slider-response.md | 52 ------------------- .../plugins/jspsych-visual-search-circle.md | 49 +++-------------- .../plugins/jspsych-vsl-animate-occlusion.md | 21 +++++--- .../plugins/jspsych-vsl-grid-scene.md | 5 +- 6 files changed, 48 insertions(+), 170 deletions(-) delete mode 100644 docs/markdown_docs/plugins/jspsych-slider-response.md diff --git a/docs/markdown_docs/plugins/jspsych-same-different-html.md b/docs/markdown_docs/plugins/jspsych-same-different-html.md index 47687069..c1c0cb26 100644 --- a/docs/markdown_docs/plugins/jspsych-same-different-html.md +++ b/docs/markdown_docs/plugins/jspsych-same-different-html.md @@ -39,42 +39,15 @@ key_press_stim1 | numeric | Indicates which key the subject pressed to continue. ## Examples -#### Presenting two different emotional expressions +#### Basic example ```javascript - var block = { - type: 'same-different', - stimuli: ['

Climbing

y', '

Walking

'], - prompt: "

Press S if the texts imply the same amount of physical exertion. Press D if the texts imply different amount of physical exertion.

", - same_key: 'S', - different_key: 'D', - answer: 'different' - } - - jsPsych.init({ - timeline: [block], - on_finish: function() { - jsPsych.data.displayData(); - } - }); -``` - -#### Presenting the same emotional expression - -```javascript - var block = { - type: 'same-different', - stimuli: ['Running', 'Swimming'], - prompt: "", - same_key: 'S', - different_key: 'D', - answer: 'same' - } - - jsPsych.init({ - timeline: [block], - on_finish: function() { - jsPsych.data.displayData(); - } - }); + var trial = { + type: 'same-different', + stimuli: ['

Climbing

', '

Walking

'], + prompt: "

Press S if the texts imply the same amount of physical exertion. Press D if the texts imply different amount of physical exertion.

", + same_key: 'S', + different_key: 'D', + answer: 'different' + } ``` diff --git a/docs/markdown_docs/plugins/jspsych-same-different-image.md b/docs/markdown_docs/plugins/jspsych-same-different-image.md index 58f726e8..662ad1b1 100644 --- a/docs/markdown_docs/plugins/jspsych-same-different-image.md +++ b/docs/markdown_docs/plugins/jspsych-same-different-image.md @@ -42,39 +42,25 @@ key_press_stim1 | numeric | Indicates which key the subject pressed to continue. #### Presenting two different emotional expressions ```javascript - var block = { - type: 'same-different', - stimuli: ['img/happy_face_1.jpg', 'img/sad_face_3.jpg'], - prompt: "

Press S if the faces had the same emotional expression. Press D if the faces had different emotional expressions.

", - same_key: 'S', - different_key: 'D', - answer: 'different' - } - - jsPsych.init({ - timeline: [block], - on_finish: function() { - jsPsych.data.displayData(); - } - }); +var block = { + type: 'same-different', + stimuli: ['img/happy_face_1.jpg', 'img/sad_face_3.jpg'], + prompt: "

Press S if the faces had the same emotional expression. Press D if the faces had different emotional expressions.

", + same_key: 'S', + different_key: 'D', + answer: 'different' +} ``` #### Presenting the same emotional expression ```javascript - var block = { - type: 'same-different', - stimuli: ['img/happy_face_1.jpg', 'img/happy_face_3.jpg'], - prompt: "

Press S if the faces had the same emotional expression. Press D if the faces had different emotional expressions.

", - same_key: 'S', - different_key: 'D', - answer: 'same' - } - - jsPsych.init({ - timeline: [block], - on_finish: function() { - jsPsych.data.displayData(); - } - }); +var block = { + type: 'same-different', + stimuli: ['img/happy_face_1.jpg', 'img/happy_face_3.jpg'], + prompt: "

Press S if the faces had the same emotional expression. Press D if the faces had different emotional expressions.

", + same_key: 'S', + different_key: 'D', + answer: 'same' +} ``` diff --git a/docs/markdown_docs/plugins/jspsych-slider-response.md b/docs/markdown_docs/plugins/jspsych-slider-response.md deleted file mode 100644 index d1a00543..00000000 --- a/docs/markdown_docs/plugins/jspsych-slider-response.md +++ /dev/null @@ -1,52 +0,0 @@ -# jspsych-slider-response plugin - -This plugin displays an image or HTML-formatted content and allows the subject to respond by pressing a key on the keyboard. The stimulus can be displayed until a response is given, or for a pre-determined amount of time. The trial can be ended automatically if the subject has failed to respond within a fixed length of time. - -Because this plugin can display any HTML content, it is quite versatile. It can be used for any situation in which the response generated by the subject is a single keystroke. - -## 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 -----------|------|---------------|------------ -stimulus | string | *undefined* | The stimulus to display. Either HTML-formatted, or the path to an image. -is_html | boolean | false | If `stimulus` is an HTML-formatted string, this parameter needs to be set to `true`. -min | integer | 0 | The minimum value of the slider scale. -max | integer | 100 | The maximum value of the slider scale. -step | integer | 1 | The step size of the slider scale. -labels | array of strings | *undefined* | A set of labels for the slider scale. They will be automatically distributed so that the first and last labels are centered below the endpoints of the scale. The other labels will be spaced at equal intervals. - -## Data Generated - -In addition to the [default data collected by all plugins](overview#datacollectedbyplugins), this plugin collects the following data for each trial. - -Name | Type | Value ------|------|------ -response | numeric | The numeric value of the slider. -rt | numeric | The time in milliseconds for the subject to make a response. The time is measured from when the stimulus first appears on the screen until the subject's response. - -## Examples - -#### Approximating a smooth continuous scale with the default settings - -```javascript -var trial = { - type: 'slider-response', - stimulus: '

How similar are these pictures?

', - labels: ["Not at all similar", "Identical"], -} -``` - -#### Using min, max, and step to create a discrete scale with labeled options - -```javascript -var trial = { - type: 'slider-response', - stimulus: '

How similar are these pictures?

', - labels: ["Not similar", "Sort of similar", "Very similar"], - min: 0, - max: 2, - step: 1 -} -``` diff --git a/docs/markdown_docs/plugins/jspsych-visual-search-circle.md b/docs/markdown_docs/plugins/jspsych-visual-search-circle.md index d98e9b1f..e1e52425 100644 --- a/docs/markdown_docs/plugins/jspsych-visual-search-circle.md +++ b/docs/markdown_docs/plugins/jspsych-visual-search-circle.md @@ -41,45 +41,12 @@ locations | JSON string | JSON-encoded array where each element of the array is #### Search for the backward N ```javascript - var intro = { - type: 'html-keyboard-response', - stimulus: 'Press J if there is a backwards N. If there is no backwards N press F.' - } - - var trial_1 = { - target_present: true, - set_size: 4 - } - - var trial_2 = { - target_present: true, - set_size: 3 - } - - var trial_3 = { - target_present: false, - set_size: 6 - } - - var trial_4 = { - target_present: false, - foil: ['img/1.gif', 'img/2.gif', 'img/3.gif'], - set_size: 3 - } - - - var trials = { - type: 'visual-search-circle', - target: 'img/backwardN.gif', - foil: 'img/normalN.gif', - fixation_image: 'img/fixation.gif', - timeline: [trial_1, trial_2, trial_3, trial_4] - }; - - jsPsych.init({ - timeline: [intro, trials], - on_finish: function() { - jsPsych.data.displayData(); - } - }); +var trial_1 = { + type: 'visual-search-circle', + target: 'img/backwardN.gif', + foil: 'img/normalN.gif', + fixation_image: 'img/fixation.gif', + target_present: true, + set_size: 4 +} ``` diff --git a/docs/markdown_docs/plugins/jspsych-vsl-animate-occlusion.md b/docs/markdown_docs/plugins/jspsych-vsl-animate-occlusion.md index b9179d94..2f047ace 100644 --- a/docs/markdown_docs/plugins/jspsych-vsl-animate-occlusion.md +++ b/docs/markdown_docs/plugins/jspsych-vsl-animate-occlusion.md @@ -37,12 +37,19 @@ responses | JSON string | A JSON encoded array containing all response informati #### Displaying a simple sequence. ```javascript -var images = ["img/1.gif","img/2.gif","img/3.gif","img/4.gif","img/5.gif","img/6.gif","img/7.gif","img/8.gif","img/9.gif","img/10.gif"]; - - -// create vsl block for jspsych -var vsl_block = { +var trial = { type: 'vsl-animate-occlusion', - stimuli: images -}; + stimuli: [ + "img/1.gif", + "img/2.gif", + "img/3.gif", + "img/4.gif", + "img/5.gif", + "img/6.gif", + "img/7.gif", + "img/8.gif", + "img/9.gif", + "img/10.gif" + ] +} ``` diff --git a/docs/markdown_docs/plugins/jspsych-vsl-grid-scene.md b/docs/markdown_docs/plugins/jspsych-vsl-grid-scene.md index 1b7bffd6..66525971 100644 --- a/docs/markdown_docs/plugins/jspsych-vsl-grid-scene.md +++ b/docs/markdown_docs/plugins/jspsych-vsl-grid-scene.md @@ -4,7 +4,6 @@ The VSL (visual statistical learning) grid scene plugin displays images arranged Fiser, J., & Aslin, R. N. (2001). Unsupervised statistical learning of higher-order spatial structures from visual scenes. *Psychological Science, 12*(6), 499-504. - ## Parameters Parameters with a default value of *undefined* must be specified. Other parameters can be left unspecified if the default value is acceptable. @@ -55,9 +54,7 @@ var scene = [ ["img/5.gif", "img/4.gif", 0] ] - -// create vsl block for jspsych -var vsl_block = { +var trial = { type: 'vsl-grid-scene', stimuli: scene };