mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-11 16:18:11 +00:00
docs updates
This commit is contained in:
parent
71d4ea8a50
commit
71172ff551
@ -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: ['<p>Climbing</p>y', '<p>Walking</p>'],
|
||||
prompt: "<p>Press S if the texts imply the same amount of physical exertion. Press D if the texts imply different amount of physical exertion.</p>",
|
||||
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: "<pPress S if the texts imply the same amount of physical exertion. Press D if the texts imply different amount of physical exertion.</p>",
|
||||
same_key: 'S',
|
||||
different_key: 'D',
|
||||
answer: 'same'
|
||||
}
|
||||
|
||||
jsPsych.init({
|
||||
timeline: [block],
|
||||
on_finish: function() {
|
||||
jsPsych.data.displayData();
|
||||
}
|
||||
});
|
||||
var trial = {
|
||||
type: 'same-different',
|
||||
stimuli: ['<p>Climbing</p>', '<p>Walking</p>'],
|
||||
prompt: "<p>Press S if the texts imply the same amount of physical exertion. Press D if the texts imply different amount of physical exertion.</p>",
|
||||
same_key: 'S',
|
||||
different_key: 'D',
|
||||
answer: 'different'
|
||||
}
|
||||
```
|
||||
|
@ -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: "<p>Press S if the faces had the same emotional expression. Press D if the faces had different emotional expressions.</p>",
|
||||
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: "<p>Press S if the faces had the same emotional expression. Press D if the faces had different emotional expressions.</p>",
|
||||
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: "<p>Press S if the faces had the same emotional expression. Press D if the faces had different emotional expressions.</p>",
|
||||
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: "<p>Press S if the faces had the same emotional expression. Press D if the faces had different emotional expressions.</p>",
|
||||
same_key: 'S',
|
||||
different_key: 'D',
|
||||
answer: 'same'
|
||||
}
|
||||
```
|
||||
|
@ -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: '<p>How similar are these pictures?</p><img src="img/happy_face_1.jpg"></img><img src="img/sad_face_1.jpg"></img>',
|
||||
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: '<p>How similar are these pictures?</p><img src="img/happy_face_1.jpg"></img><img src="img/sad_face_1.jpg"></img>',
|
||||
labels: ["Not similar", "Sort of similar", "Very similar"],
|
||||
min: 0,
|
||||
max: 2,
|
||||
step: 1
|
||||
}
|
||||
```
|
@ -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
|
||||
}
|
||||
```
|
||||
|
@ -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"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
@ -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
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user