mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 19:20:55 +00:00
add preload trial
This commit is contained in:
parent
e0f6f5d0dc
commit
95099d1a46
@ -4,6 +4,7 @@
|
|||||||
<script src="../jspsych.js"></script>
|
<script src="../jspsych.js"></script>
|
||||||
<script src="../plugins/jspsych-audio-button-response.js"></script>
|
<script src="../plugins/jspsych-audio-button-response.js"></script>
|
||||||
<script src="../plugins/jspsych-html-button-response.js"></script>
|
<script src="../plugins/jspsych-html-button-response.js"></script>
|
||||||
|
<script src="../plugins/jspsych-preload.js"></script>
|
||||||
<link rel="stylesheet" href="../css/jspsych.css">
|
<link rel="stylesheet" href="../css/jspsych.css">
|
||||||
</head>
|
</head>
|
||||||
<body></body>
|
<body></body>
|
||||||
@ -11,6 +12,11 @@
|
|||||||
|
|
||||||
var timeline = [];
|
var timeline = [];
|
||||||
|
|
||||||
|
timeline.push({
|
||||||
|
type: 'preload',
|
||||||
|
auto_preload: true
|
||||||
|
});
|
||||||
|
|
||||||
timeline.push({
|
timeline.push({
|
||||||
type: 'html-button-response',
|
type: 'html-button-response',
|
||||||
stimulus: '<div style="max-width:600px;"><p>Some browsers now require the user to interact with a page before it can play audio. '+
|
stimulus: '<div style="max-width:600px;"><p>Some browsers now require the user to interact with a page before it can play audio. '+
|
||||||
|
@ -4,11 +4,17 @@
|
|||||||
<script src="../jspsych.js"></script>
|
<script src="../jspsych.js"></script>
|
||||||
<script src="../plugins/jspsych-audio-keyboard-response.js"></script>
|
<script src="../plugins/jspsych-audio-keyboard-response.js"></script>
|
||||||
<script src="../plugins/jspsych-html-button-response.js"></script>
|
<script src="../plugins/jspsych-html-button-response.js"></script>
|
||||||
|
<script src="../plugins/jspsych-preload.js"></script>
|
||||||
<link rel="stylesheet" href="../css/jspsych.css">
|
<link rel="stylesheet" href="../css/jspsych.css">
|
||||||
</head>
|
</head>
|
||||||
<body></body>
|
<body></body>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
var preload = {
|
||||||
|
type: 'preload',
|
||||||
|
auto_preload: true
|
||||||
|
}
|
||||||
|
|
||||||
var pre_audio = {
|
var pre_audio = {
|
||||||
type: 'html-button-response',
|
type: 'html-button-response',
|
||||||
stimulus: '<div style="max-width:600px;"><p>Some browsers now require the user to interact with a page before it can play audio. '+
|
stimulus: '<div style="max-width:600px;"><p>Some browsers now require the user to interact with a page before it can play audio. '+
|
||||||
@ -51,7 +57,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
jsPsych.init({
|
jsPsych.init({
|
||||||
timeline: [pre_audio, trial_1, trial_2, trial_3, trial_4],
|
timeline: [preload, pre_audio, trial_1, trial_2, trial_3, trial_4],
|
||||||
on_finish: function() {
|
on_finish: function() {
|
||||||
jsPsych.data.displayData();
|
jsPsych.data.displayData();
|
||||||
},
|
},
|
||||||
|
@ -4,11 +4,17 @@
|
|||||||
<script src="../jspsych.js"></script>
|
<script src="../jspsych.js"></script>
|
||||||
<script src="../plugins/jspsych-audio-slider-response.js"></script>
|
<script src="../plugins/jspsych-audio-slider-response.js"></script>
|
||||||
<script src="../plugins/jspsych-html-button-response.js"></script>
|
<script src="../plugins/jspsych-html-button-response.js"></script>
|
||||||
|
<script src="../plugins/jspsych-preload.js"></script>
|
||||||
<link rel="stylesheet" href="../css/jspsych.css">
|
<link rel="stylesheet" href="../css/jspsych.css">
|
||||||
</head>
|
</head>
|
||||||
<body></body>
|
<body></body>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
var preload = {
|
||||||
|
type: 'preload',
|
||||||
|
auto_preload: true
|
||||||
|
}
|
||||||
|
|
||||||
var pre_audio = {
|
var pre_audio = {
|
||||||
type: 'html-button-response',
|
type: 'html-button-response',
|
||||||
stimulus: '<div style="max-width:600px;"><p>Some browsers now require the user to interact with a page before it can play audio. '+
|
stimulus: '<div style="max-width:600px;"><p>Some browsers now require the user to interact with a page before it can play audio. '+
|
||||||
@ -44,7 +50,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
jsPsych.init({
|
jsPsych.init({
|
||||||
timeline: [pre_audio, trial_1, trial_2, trial_3],
|
timeline: [preload, pre_audio, trial_1, trial_2, trial_3],
|
||||||
on_finish: function() {
|
on_finish: function() {
|
||||||
jsPsych.data.displayData();
|
jsPsych.data.displayData();
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user