mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-11 16:18:11 +00:00
fixes #129
This commit is contained in:
parent
744308e763
commit
d95b884c5a
@ -14,7 +14,7 @@ choices | array | *undefined* | Each element of this array is an array. The inne
|
||||
prompt | string | "" | This string can contain HTML markup. Any content here will be displayed below the stimulus. The intention is that it can be used to provide a reminder about the action the subject is supposed to take (e.g. which key to press).
|
||||
timing_stim | array | [1000, 1000, ... , 1000] | Each element of the array is the length of time to display the corresponding stimulus for in milliseconds. The length of this array should match the length of the innermost stimuli arrays. Setting the last value of the array to -1 will cause the last stimulus to display until the subject has generated a response for each response group.
|
||||
timing_response | numeric | -1 | How long to wait for the subject to make all responses before ending the trial in milliseconds. If the subject fails to make a response in a response group before this timer is reached, the the subject's response for that response group will be recorded as -1 for the trial and the trial will end. If the value of this parameter is -1, then the trial will wait for a response indefinitely.
|
||||
continue_after_response | boolean | true | If true, then the trial will end whenever the subject makes a response for each response group (assuming they make their response before the cutoff specified by the `timing_response` parameter). If false, then the trial will continue until the value for `timing_response` is reached. You can use this parameter to force the subject to view a stimulus for a fixed amount of time, even if they respond before the time is complete.
|
||||
response_ends_trial | boolean | true | If true, then the trial will end whenever the subject makes a response for each response group (assuming they make their response before the cutoff specified by the `timing_response` parameter). If false, then the trial will continue until the value for `timing_response` is reached. You can use this parameter to force the subject to view a stimulus for a fixed amount of time, even if they respond before the time is complete.
|
||||
|
||||
## Data Generated
|
||||
|
||||
|
@ -75,7 +75,7 @@ var stim_block = {
|
||||
stimuli: [stimulus],
|
||||
is_html: true,
|
||||
timing_response: 2000,
|
||||
continue_after_response: false
|
||||
response_ends_trial: false
|
||||
}
|
||||
|
||||
var test_block = {
|
||||
|
@ -16,7 +16,7 @@ stimuli | array | *undefined* | Each element of the array is a stimulus. A stimu
|
||||
choices | array | [ ] | This array contains the keys that the subject is allowed to press in order to respond to the stimulus. Keys can be specified as their [numeric key code](http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes) or as characters (e.g. `'a'`, `'q'`). The default value of an empty array means that all keys will be accepted as valid responses.
|
||||
prompt | string | "" | This string can contain HTML markup. Any content here will be displayed on the screen. The intention is that it can be used to provide a reminder about the action the subject is supposed to take (e.g. which key to press).
|
||||
timing_response | numeric | -1 | How long to wait for the subject to make a response before ending the trial in milliseconds. If the subject fails to make a response before this timer is reached, the the subject's response will be recorded as -1 for the trial and the trial will end. If the value of this parameter is -1, then the trial will wait for a response indefinitely.
|
||||
continue_after_response | boolean | true | If true, then the trial will end whenever the subject makes a response (assuming they make their response before the cutoff specified by the `timing_response` parameter). If false, then the trial will continue until the value for `timing_response` is reached. You can use this parameter to force the subject to view a stimulus for a fixed amount of time, even if they respond before the time is complete.
|
||||
response_ends_trial | boolean | true | If true, then the trial will end whenever the subject makes a response (assuming they make their response before the cutoff specified by the `timing_response` parameter). If false, then the trial will continue until the value for `timing_response` is reached. You can use this parameter to force the subject to view a stimulus for a fixed amount of time, even if they respond before the time is complete.
|
||||
|
||||
## Data Generated
|
||||
|
||||
|
@ -16,7 +16,7 @@ choices | array | [ ] | This array contains the keys that the subject is allowed
|
||||
prompt | string | "" | This string can contain HTML markup. Any content here will be displayed below the stimulus. The intention is that it can be used to provide a reminder about the action the subject is supposed to take (e.g. which key to press).
|
||||
timing_stim | numeric | -1 | How long to show the stimulus for in milliseconds. If the value is -1, then the stimulus will be shown until the subject makes a response.
|
||||
timing_response | numeric | -1 | How long to wait for the subject to make a response before ending the trial in milliseconds. If the subject fails to make a response before this timer is reached, the the subject's response will be recorded as -1 for the trial and the trial will end. If the value of this parameter is -1, then the trial will wait for a response indefinitely.
|
||||
continue_after_response | boolean | true | If true, then the trial will end whenever the subject makes a response (assuming they make their response before the cutoff specified by the `timing_response` parameter). If false, then the trial will continue until the value for `timing_response` is reached. You can use this parameter to force the subject to view a stimulus for a fixed amount of time, even if they respond before the time is complete.
|
||||
response_ends_trial | boolean | true | If true, then the trial will end whenever the subject makes a response (assuming they make their response before the cutoff specified by the `timing_response` parameter). If false, then the trial will continue until the value for `timing_response` is reached. You can use this parameter to force the subject to view a stimulus for a fixed amount of time, even if they respond before the time is complete.
|
||||
|
||||
## Data Generated
|
||||
|
||||
@ -59,6 +59,6 @@ var block = {
|
||||
stimuli: ['<p>Radio</p>', '<p>Towel</p>', '<p>Match</p>'],
|
||||
is_html: true,
|
||||
timing_response: 1500,
|
||||
continue_after_response: false
|
||||
response_ends_trial: false
|
||||
}
|
||||
```
|
||||
|
@ -25,7 +25,7 @@
|
||||
// option to show image for fixed time interval, ignoring key responses
|
||||
// true = image will keep displaying after response
|
||||
// false = trial will immediately advance when response is recorded
|
||||
trials[i].continue_after_response = (typeof params.continue_after_response === 'undefined') ? true : params.continue_after_response;
|
||||
trials[i].response_ends_trial = (typeof params.response_ends_trial === 'undefined') ? true : params.response_ends_trial;
|
||||
// timing parameters
|
||||
var default_timing_array = [];
|
||||
for(var j = 0; j < params.stimuli[i].length; j++){
|
||||
@ -140,7 +140,7 @@
|
||||
responseKeys[whichResponse] = info.key;
|
||||
}
|
||||
|
||||
if (trial.continue_after_response) {
|
||||
if (trial.response_ends_trial) {
|
||||
|
||||
if(checkAllResponsesAreValid()){
|
||||
end_trial();
|
||||
|
@ -30,7 +30,7 @@
|
||||
// option to show image for fixed time interval, ignoring key responses
|
||||
// true = image will keep displaying after response
|
||||
// false = trial will immediately advance when response is recorded
|
||||
trials[i].continue_after_response = (typeof params.continue_after_response === 'undefined') ? true : params.continue_after_response;
|
||||
trials[i].response_ends_trial = (typeof params.response_ends_trial === 'undefined') ? true : params.response_ends_trial;
|
||||
// timing parameters
|
||||
// trials[i].timing_stim = params.timing_stim || -1; // if -1, then show indefinitely
|
||||
trials[i].timing_response = params.timing_response || -1; // if -1, then wait for response forever
|
||||
@ -111,7 +111,7 @@
|
||||
response = info;
|
||||
}
|
||||
|
||||
if (trial.continue_after_response) {
|
||||
if (trial.response_ends_trial) {
|
||||
end_trial();
|
||||
}
|
||||
};
|
||||
|
@ -22,10 +22,7 @@
|
||||
trials[i] = {};
|
||||
trials[i].a_path = params.stimuli[i];
|
||||
trials[i].choices = params.choices || [];
|
||||
// option to show image for fixed time interval, ignoring key responses
|
||||
// true = image will keep displaying after response
|
||||
// false = trial will immediately advance when response is recorded
|
||||
trials[i].continue_after_response = (typeof params.continue_after_response === 'undefined') ? true : params.continue_after_response;
|
||||
trials[i].response_ends_trial = (typeof params.response_ends_trial === 'undefined') ? true : params.response_ends_trial;
|
||||
// timing parameters
|
||||
trials[i].timing_stim = params.timing_stim || -1; // if -1, then show indefinitely
|
||||
trials[i].timing_response = params.timing_response || -1; // if -1, then wait for response forever
|
||||
@ -117,7 +114,7 @@
|
||||
response = info;
|
||||
}
|
||||
|
||||
if (trial.continue_after_response) {
|
||||
if (trial.response_ends_trial) {
|
||||
end_trial();
|
||||
}
|
||||
};
|
||||
|
@ -27,7 +27,7 @@
|
||||
stimuli: [stimulus],
|
||||
is_html: true,
|
||||
timing_response: 2000,
|
||||
continue_after_response: false
|
||||
response_ends_trial: false
|
||||
};
|
||||
|
||||
var test_block = {
|
||||
|
Loading…
Reference in New Issue
Block a user