mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 08:38:11 +00:00

The `run()` method takes a timeline and returns a promise that is resolved when the experiment finishes. Hence, jsPsych can now be initialized without starting an experiment. This re-enables usage of `jsPsych.timelineVariable()` in timeline definitions and repairs exclusion checks and extension loading.
18 lines
372 B
JavaScript
18 lines
372 B
JavaScript
var calibration = {
|
|
timeline: [
|
|
{
|
|
type: jsPsychHtmlKeyboardResponse,
|
|
stimulus: `<div style="width:200px; height: 200px; background: white;"></div>`,
|
|
trial_duration: 200,
|
|
post_trial_gap: 100,
|
|
},
|
|
],
|
|
loop_function: (data) => {
|
|
if (data.values()[0].response == " ") {
|
|
return false;
|
|
} else {
|
|
return true;
|
|
}
|
|
},
|
|
};
|