You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var dev_version = "6.3.1";
var cur_version = jsPsych.version();
if (cur_version != dev_version)
{console.log("Warning! Developed version " + dev_version + " doesn't match running version! " + cur_version)};
var audio = 'P_audio';
if (CONDITION == 2) {
audio = 'P_audio';
};
if (CONDITION == 3) {
audio = 'C_audio';
};
var timeline = [];
var audio_list =
[
'audio/C_TheDolls.mp3',
'audio/C_ThreeDolls.mp3',
'audio/P_TheDolls.mp3',
'audio/P_ThreeDolls.mp3',
];
var stimuli = [
{
"P_audio": "P_TheDolls.mp3",
"C_audio": "C_TheDolls.mp3",
"sentence": "The girl fixed the dolls."
},
{
"P_audio": "P_ThreeDolls.mp3",
"C_audio": "C_ThreeDolls.mp3",
"sentence": "The girl fixed three dolls."
}
]
var preload = {
type: 'preload',
auto_preload: true,
audio: audio_list,
message: "<h2>Preparing your experiment</h2>"
};
timeline.push(preload);
var instructions = {
type: 'instructions',
pages: [
'<p>In this task, you will read a sentence and be asked to judge that sentence on a scale of 1-5.</p>'+
'<p>1 is a sentence that does not sound like a natural sentence you would say.</p>'+
'<p>5 is a sentence that sounds like a perfectly natural thing you would say.</p>'+
'<p>Click the "Next" button to start.</p>'
],
show_clickable_nav: true,
allow_backward: false,
post_trial_gap: 1000
};
timeline.push(instructions);
var judgment_trial = {
type: 'audio-slider-response',
stimulus: jsPsych.timelineVariable(audio), // audio varies by CONDITION
data: {sentence: jsPsych.timelineVariable('sentence'),
},
labels: ['1','','','','5'],
button_label: 'Next',
max: 5,
min: 1,
slider_start: 3,
slider_width: 300,
};
var judgment_task = {
timeline: [judgment_trial],
timeline_variables: stimuli,
randomize_order: true,
};
timeline.push(judgment_task);
var end_task_html = [ '<p>The experiment is over!</p>' +
'<p>Thank you for your participation.</p>'
];
var end_task = {
type: 'instructions',
pages: end_task_html,
show_clickable_nav: true,
button_label_next: 'End',
allow_backward: false,
post_trial_gap: 1000
};
timeline.push(end_task);
jsPsych.init({
timeline: timeline,
override_safe_mode: 'true',
use_webaudio: 'true',
on_finish: function(){jsPsych.data.displayData()}// comment this out when running on server
})
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm having problems getting audio tasks to work properly on Safari. They work fine with Firefox and Chrome on MacOS.
Using Safari on MacOS, the first stimulus doesn't play; subsequent ones do.
Using Safari on iOS, the experiment fails to load at all.
Setting
use_webaudio
to either'true'
or'false'
makes no difference.Link on cognition.run:
Code:
Beta Was this translation helpful? Give feedback.
All reactions