replace trial type and extension strings with plugin/extension classes, remove unnecessary preload scripts, add card image preload to virtual-chinrest demos and use CDN link

This commit is contained in:
Becky Gilbert 2021-09-16 16:22:13 -07:00
parent dbbfd46746
commit 18b536fdf8
77 changed files with 314 additions and 330 deletions

View File

@ -26,17 +26,17 @@
var jsPsych = initJsPsych({ var jsPsych = initJsPsych({
extensions: [ extensions: [
{type: 'webgazer'} {type: jsPsychExtensionWebgazer}
] ]
}); });
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
images: ['img/blue.png'] images: ['img/blue.png']
} }
var camera_instructions = { var camera_instructions = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: ` stimulus: `
<p>In order to participate you must allow the experiment to use your camera.</p> <p>In order to participate you must allow the experiment to use your camera.</p>
<p>You will be prompted to do this on the next screen.</p> <p>You will be prompted to do this on the next screen.</p>
@ -47,11 +47,11 @@
} }
var init_camera = { var init_camera = {
type: 'webgazer-init-camera' type: jsPsychWebgazerInitCamera
} }
var calibration_instructions = { var calibration_instructions = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: ` stimulus: `
<p>Now you'll calibrate the eye tracking, so that the software can use the image of your eyes to predict where you are looking.</p> <p>Now you'll calibrate the eye tracking, so that the software can use the image of your eyes to predict where you are looking.</p>
<p>You'll see a series of dots appear on the screen. Look at each dot and click on it.</p> <p>You'll see a series of dots appear on the screen. Look at each dot and click on it.</p>
@ -60,7 +60,7 @@
} }
var calibration = { var calibration = {
type: 'webgazer-calibrate', type: jsPsychWebgazerCalibrate,
calibration_points: [ calibration_points: [
[25,25],[75,25],[50,50],[25,75],[75,75] [25,25],[75,25],[50,50],[25,75],[75,75]
], ],
@ -69,7 +69,7 @@
} }
var validation_instructions = { var validation_instructions = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: ` stimulus: `
<p>Now we'll measure the accuracy of the calibration.</p> <p>Now we'll measure the accuracy of the calibration.</p>
<p>Look at each dot as it appears on the screen.</p> <p>Look at each dot as it appears on the screen.</p>
@ -80,7 +80,7 @@
} }
var validation = { var validation = {
type: 'webgazer-validate', type: jsPsychWebgazerValidate,
validation_points: [ validation_points: [
[25,25],[75,25],[50,50],[25,75],[75,75] [25,25],[75,25],[50,50],[25,75],[75,75]
], ],
@ -93,7 +93,7 @@
} }
var recalibrate_instructions = { var recalibrate_instructions = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: ` stimulus: `
<p>The accuracy of the calibration is a little lower than we'd like.</p> <p>The accuracy of the calibration is a little lower than we'd like.</p>
<p>Let's try calibrating one more time.</p> <p>Let's try calibrating one more time.</p>
@ -117,7 +117,7 @@
} }
var calibration_done = { var calibration_done = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: ` stimulus: `
<p>Great, we're done with calibration!</p> <p>Great, we're done with calibration!</p>
`, `,
@ -125,7 +125,7 @@
} }
var begin = { var begin = {
type: 'html-keyboard-response', type: jsPsychHtmKeyboardResponse,
stimulus: `<p>The next screen will show an image to demonstrate adding the webgazer extension to a trial.</p> stimulus: `<p>The next screen will show an image to demonstrate adding the webgazer extension to a trial.</p>
<p>Just look at the image while eye tracking data is collected. The trial will end automatically.</p> <p>Just look at the image while eye tracking data is collected. The trial will end automatically.</p>
<p>Press any key to start.</p> <p>Press any key to start.</p>
@ -133,20 +133,20 @@
} }
var trial = { var trial = {
type: 'image-keyboard-response', type: jsPsychImageKeyboardResponse,
stimulus: 'img/blue.png', stimulus: 'img/blue.png',
choices: jsPsych.NO_KEYS, choices: jsPsych.NO_KEYS,
trial_duration: 2000, trial_duration: 2000,
extensions: [ extensions: [
{ {
type: 'webgazer', type: jsPsychExtensionWebgazer,
params: {targets: ['#jspsych-image-keyboard-response-stimulus']} params: {targets: ['#jspsych-image-keyboard-response-stimulus']}
} }
] ]
} }
var show_data = { var show_data = {
type: 'html-keyboard-response', type: jsPsychHtmKeyboardResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -17,18 +17,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload_trial = { var preload_trial = {
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var animation_trial = { var animation_trial = {
type: 'animation', type: jsPsychAnimation,
stimuli: [ stimuli: [
'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/happy_face_1.jpg', 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/happy_face_1.jpg',
'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/happy_face_2.jpg', 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/happy_face_2.jpg',
@ -41,7 +41,7 @@
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -15,12 +15,12 @@
var timeline = []; var timeline = [];
timeline.push({ timeline.push({
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
}); });
timeline.push({ timeline.push({
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
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. '+
'Clicking the button below counts as an interaction.</p><p>Be aware of this when planning audio experiments if '+ 'Clicking the button below counts as an interaction.</p><p>Be aware of this when planning audio experiments if '+
'you want the first trial to include audio.</p></div>', 'you want the first trial to include audio.</p></div>',
@ -28,14 +28,14 @@
}); });
var trial = { var trial = {
type: 'audio-button-response', type: jsPsychAudioButtonResponse,
stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/sound/tone.mp3', stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/sound/tone.mp3',
choices: ['Low', 'High'], choices: ['Low', 'High'],
prompt: "<p>Is the pitch high or low?</p>" prompt: "<p>Is the pitch high or low?</p>"
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -19,13 +19,13 @@
var images = ['img/lion.png', 'img/elephant.png', 'img/monkey.png'] var images = ['img/lion.png', 'img/elephant.png', 'img/monkey.png']
timeline.push({ timeline.push({
type: 'preload', type: jsPsychPreload,
auto_preload: true, auto_preload: true,
images: images images: images
}); });
timeline.push({ timeline.push({
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
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. '+
'Clicking the button below counts as an interaction.</p><p>Be aware of this when planning audio experiments if '+ 'Clicking the button below counts as an interaction.</p><p>Be aware of this when planning audio experiments if '+
'you want the first trial to include audio.</p></div>', 'you want the first trial to include audio.</p></div>',
@ -33,7 +33,7 @@
}); });
var trial = { var trial = {
type: 'audio-button-response', type: jsPsychAudioButtonResponse,
stimulus: 'sound/roar.mp3', stimulus: 'sound/roar.mp3',
choices: images, choices: images,
prompt: "<p>Which animal made the sound?</p>", prompt: "<p>Which animal made the sound?</p>",
@ -41,7 +41,7 @@
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -13,12 +13,12 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
} }
var pre_audio = { var pre_audio = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
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. '+
'Clicking the button below counts as an interaction.</p><p>Be aware of this when planning audio experiments if '+ 'Clicking the button below counts as an interaction.</p><p>Be aware of this when planning audio experiments if '+
'you want the first trial to include audio.</p></div>', 'you want the first trial to include audio.</p></div>',
@ -26,7 +26,7 @@
} }
var trial = { var trial = {
type: 'audio-keyboard-response', type: jsPsychAudioKeyboardResponse,
stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/sound/tone.mp3', stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/sound/tone.mp3',
choices: ['e', 'i'], choices: ['e', 'i'],
prompt: "<p>Is the pitch high or low? Press 'e' for low and 'i' for high.</p>", prompt: "<p>Is the pitch high or low? Press 'e' for low and 'i' for high.</p>",
@ -34,7 +34,7 @@
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -13,12 +13,12 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
} }
var pre_audio = { var pre_audio = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
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. '+
'Clicking the button below counts as an interaction.</p><p>Be aware of this when planning audio experiments if '+ 'Clicking the button below counts as an interaction.</p><p>Be aware of this when planning audio experiments if '+
'you want the first trial to include audio.</p></div>', 'you want the first trial to include audio.</p></div>',
@ -26,14 +26,14 @@
} }
var trial = { var trial = {
type: 'audio-keyboard-response', type: jsPsychAudioKeyboardResponse,
stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/sound/tone.mp3', stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/sound/tone.mp3',
choices: jsPsych.NO_KEYS, choices: jsPsych.NO_KEYS,
trial_ends_after_audio: true trial_ends_after_audio: true
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -13,12 +13,12 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
}; };
var pre_audio = { var pre_audio = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
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. '+
'Clicking the button below counts as an interaction.</p><p>Be aware of this when planning audio experiments if '+ 'Clicking the button below counts as an interaction.</p><p>Be aware of this when planning audio experiments if '+
'you want the first trial to include audio.</p></div>', 'you want the first trial to include audio.</p></div>',
@ -26,14 +26,14 @@
}; };
var trial = { var trial = {
type: 'audio-slider-response', type: jsPsychAudioSliderResponse,
stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/sound/speech_joke.mp3', stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/sound/speech_joke.mp3',
labels: ['Not Funny', 'Funny'], labels: ['Not Funny', 'Funny'],
prompt: '<p>How funny is the joke?</p>' prompt: '<p>How funny is the joke?</p>'
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -13,12 +13,12 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
}; };
var pre_audio = { var pre_audio = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
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. '+
'Clicking the button below counts as an interaction.</p><p>Be aware of this when planning audio experiments if '+ 'Clicking the button below counts as an interaction.</p><p>Be aware of this when planning audio experiments if '+
'you want the first trial to include audio.</p></div>', 'you want the first trial to include audio.</p></div>',
@ -26,7 +26,7 @@
}; };
var trial = { var trial = {
type: 'audio-slider-response', type: jsPsychAudioSliderResponse,
stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/sound/speech_joke.mp3', stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/sound/speech_joke.mp3',
labels: ['Not Funny', 'Funny'], labels: ['Not Funny', 'Funny'],
prompt: '<p>How funny is the joke?</p>', prompt: '<p>How funny is the joke?</p>',
@ -35,7 +35,7 @@
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -15,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -36,7 +36,7 @@
} }
var trial = { var trial = {
type: 'call-function', type: jsPsychCallFunction,
func: myfunc func: myfunc
} }

View File

@ -15,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -41,7 +41,7 @@
} }
var trial = { var trial = {
type: 'call-function', type: jsPsychCallFunction,
func: function(){ myfunc(jsPsych.data.get()) } func: function(){ myfunc(jsPsych.data.get()) }
} }

View File

@ -15,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -32,7 +32,7 @@
}; };
var trial = { var trial = {
type: 'call-function', type: jsPsychCallFunction,
async: true, async: true,
func: function(done){ func: function(done){
// generate a delay between 1500 and 3000 milliseconds to simulate // generate a delay between 1500 and 3000 milliseconds to simulate

View File

@ -15,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var all_trial_data = jsPsych.data.get().filter({trial_type: 'canvas-button-response'}); var all_trial_data = jsPsych.data.get().filter({trial_type: 'canvas-button-response'});
var last_two_data = all_trial_data.last(2).values(); // One block consists of two canvas-button-response trials var last_two_data = all_trial_data.last(2).values(); // One block consists of two canvas-button-response trials
@ -44,7 +44,7 @@
} }
var circle_1 = { var circle_1 = {
type: 'canvas-button-response', type: jsPsychCanvasButtonResponse,
stimulus: function(c) { stimulus: function(c) {
filledCirc(c, 100, 'blue'); filledCirc(c, 100, 'blue');
}, },
@ -55,7 +55,7 @@
}; };
var circle_2 = { var circle_2 = {
type: 'canvas-button-response', type: jsPsychCanvasButtonResponse,
stimulus: function(c) { stimulus: function(c) {
filledCirc(c, 150, 'green'); filledCirc(c, 150, 'green');
}, },

View File

@ -15,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -34,7 +34,7 @@
// write the canvas stimulus drawing function without using a named function // write the canvas stimulus drawing function without using a named function
// the anonymous function must take the canvas as an argument // the anonymous function must take the canvas as an argument
var lines = { var lines = {
type: 'canvas-button-response', type: jsPsychCanvasButtonResponse,
stimulus: function(c) { stimulus: function(c) {
var ctx = c.getContext("2d"); var ctx = c.getContext("2d");
// first line // first line

View File

@ -15,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var all_trial_data = jsPsych.data.get().filter({trial_type: 'canvas-button-response'}); var all_trial_data = jsPsych.data.get().filter({trial_type: 'canvas-button-response'});
var last_three_data = all_trial_data.last(3).values(); // One block consists of three canvas-button-response trials var last_three_data = all_trial_data.last(3).values(); // One block consists of three canvas-button-response trials
@ -45,7 +45,7 @@
// In addition, this code demonstrates how to check whether participants' answers were correct or not. // In addition, this code demonstrates how to check whether participants' answers were correct or not.
var circle_procedure = { var circle_procedure = {
timeline: [{ timeline: [{
type: 'canvas-button-response', type: jsPsychCanvasButtonResponse,
stimulus: function(c) { stimulus: function(c) {
filledCirc(c, jsPsych.timelineVariable('radius'), jsPsych.timelineVariable('color')); filledCirc(c, jsPsych.timelineVariable('radius'), jsPsych.timelineVariable('color'));
}, },

View File

@ -15,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -40,7 +40,7 @@
} }
var trial = { var trial = {
type: 'canvas-keyboard-response', type: jsPsychCanvasKeyboardResponse,
canvas_size: [300, 300], canvas_size: [300, 300],
stimulus: drawRect, stimulus: drawRect,
choices: ['e','i'], choices: ['e','i'],

View File

@ -15,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -40,7 +40,7 @@
} }
var trial = { var trial = {
type: 'canvas-keyboard-response', type: jsPsychCanvasKeyboardResponse,
canvas_size: [300, 300], canvas_size: [300, 300],
stimulus: drawCirc, stimulus: drawCirc,
prompt: '<p>No key response is allowed.</p><p>The stimulus disappears after 3 seconds.</p>', prompt: '<p>No key response is allowed.</p><p>The stimulus disappears after 3 seconds.</p>',

View File

@ -15,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -44,7 +44,7 @@
} }
var trial = { var trial = {
type: 'canvas-slider-response', type: jsPsychCanvasSliderResponse,
stimulus: twoSquares, stimulus: twoSquares,
labels: ['0','10'], labels: ['0','10'],
canvas_size: [150, 500], canvas_size: [150, 500],

View File

@ -15,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -44,7 +44,7 @@
} }
var trial = { var trial = {
type: 'canvas-slider-response', type: jsPsychCanvasSliderResponse,
stimulus: function(c) { stimulus: function(c) {
colors = ['darkred', 'cyan']; colors = ['darkred', 'cyan'];
twoSquares(c, colors); twoSquares(c, colors);

View File

@ -17,13 +17,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -34,12 +34,12 @@
}; };
var preload_trial = { var preload_trial = {
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
} }
var animation_trial = { var animation_trial = {
type: 'categorize-animation', type: jsPsychCategorizeAnimation,
stimuli: [ stimuli: [
'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/happy_face_1.jpg', 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/happy_face_1.jpg',
'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/happy_face_2.jpg', 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/happy_face_2.jpg',

View File

@ -17,13 +17,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -34,7 +34,7 @@
}; };
var preload_trial = { var preload_trial = {
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
} }
@ -46,7 +46,7 @@
]; ];
var animation_trial = { var animation_trial = {
type: 'categorize-animation', type: jsPsychCategorizeAnimation,
stimuli: images, stimuli: images,
choices: ['p', 'q'], choices: ['p', 'q'],
prompt: `Press the P or Q key.`, prompt: `Press the P or Q key.`,

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-categorize-html.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-categorize-html.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css">
@ -16,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
}; };
var categorization_trial = { var categorization_trial = {
type: 'categorize-html', type: jsPsychCategorizeHtml,
stimulus: '<p>B</p>', stimulus: '<p>B</p>',
key_answer: 'p', key_answer: 'p',
text_answer: 'letter', text_answer: 'letter',

View File

@ -16,13 +16,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,12 +33,12 @@
}; };
var preload_trial = { var preload_trial = {
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
} }
var categorization_trial = { var categorization_trial = {
type: 'categorize-image', type: jsPsychCategorizeImage,
stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/blue.png', stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/blue.png',
key_answer: 'b', key_answer: 'b',
text_answer: 'Blue', text_answer: 'Blue',

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-cloze.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-cloze.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css">
@ -16,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
}; };
var cloze_trial = { var cloze_trial = {
type: 'cloze', type: jsPsychCloze,
text: 'The %% is the largest terrestrial mammal. It lives in both %% and %%.' text: 'The %% is the largest terrestrial mammal. It lives in both %% and %%.'
}; };

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-cloze.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-cloze.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css">
@ -16,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
}; };
var cloze_trial = { var cloze_trial = {
type: 'cloze', type: jsPsychCloze,
text: 'A rectangle has % 4 % corners and a triangle has % 3 %.', text: 'A rectangle has % 4 % corners and a triangle has % 3 %.',
check_answers: true, check_answers: true,
button_text: 'Next', button_text: 'Next',

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-external-html.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-external-html.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css">
@ -16,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -47,7 +46,7 @@
// declare the block. // declare the block.
var trial = { var trial = {
type:'external-html', type: jsPsychExternalHtml,
url: "external_page.html", url: "external_page.html",
cont_btn: "start", cont_btn: "start",
check_fn: check_consent check_fn: check_consent

View File

@ -16,13 +16,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -40,12 +40,12 @@
] ]
var preload_trial = { var preload_trial = {
type: 'preload', type: jsPsychPreload,
images: sorting_stimuli images: sorting_stimuli
} }
var sort_trial = { var sort_trial = {
type: 'free-sort', type: jsPsychFreeSort,
stimuli: sorting_stimuli, stimuli: sorting_stimuli,
stim_width: 80, stim_width: 80,
stim_height: 60, stim_height: 60,

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-fullscreen.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-fullscreen.js"></script>
<link <link
@ -22,13 +21,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -39,24 +38,24 @@
}; };
var enter_fullscreen = { var enter_fullscreen = {
type: 'fullscreen', type: jsPsychFullscreen,
fullscreen_mode: true fullscreen_mode: true
} }
var trial_in_fullscreen = { var trial_in_fullscreen = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: 'This trial will be in fullscreen mode.', stimulus: 'This trial will be in fullscreen mode.',
choices: ['Continue'] choices: ['Continue']
} }
var exit_fullscreen = { var exit_fullscreen = {
type: 'fullscreen', type: jsPsychFullscreen,
fullscreen_mode: false, fullscreen_mode: false,
delay_after: 0 delay_after: 0
} }
var trial_after_fullscreen = { var trial_after_fullscreen = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: 'This trial will NOT be in fullscreen mode.', stimulus: 'This trial will NOT be in fullscreen mode.',
choices: ['Continue'] choices: ['Continue']
} }

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css">
<style> <style>
@ -15,13 +14,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -32,7 +31,7 @@
}; };
var trial = { var trial = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '<p>Running</p>', stimulus: '<p>Running</p>',
choices: ['Healthy', 'Unhealthy'], choices: ['Healthy', 'Unhealthy'],
prompt: "<p>Is this activity healthy or unhealthy?</p>" prompt: "<p>Is this activity healthy or unhealthy?</p>"

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-keyboard-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-keyboard-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css">
@ -16,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
}; };
var trial = { var trial = {
type: 'html-keyboard-response', type: jsPsychHtmKeyboardResponse,
stimulus: '<p>Running</p>', stimulus: '<p>Running</p>',
choices: ['e', 'i'], choices: ['e', 'i'],
prompt: "<p>Is this activity healthy or unhealthy?</p><p>Press 'e' for healthy and 'i' for unhealthy.</p>" prompt: "<p>Is this activity healthy or unhealthy?</p><p>Press 'e' for healthy and 'i' for unhealthy.</p>"

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-keyboard-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-keyboard-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css">
@ -16,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
}; };
var trial = { var trial = {
type: 'html-keyboard-response', type: jsPsychHtmKeyboardResponse,
stimulus: '<p style="font-size: 48px;">+</p>', stimulus: '<p style="font-size: 48px;">+</p>',
choices: jsPsych.NO_KEYS, choices: jsPsych.NO_KEYS,
trial_duration: 1000, trial_duration: 1000,

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-slider-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-slider-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css">
@ -16,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
}; };
var trial = { var trial = {
type: 'html-slider-response', type: jsPsychHtmSliderResponse,
stimulus: '<p>Running</p>', stimulus: '<p>Running</p>',
require_movement: true, require_movement: true,
labels: ['healthy', 'unhealthy'], labels: ['healthy', 'unhealthy'],

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-iat-html.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-iat-html.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css">
@ -16,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
}; };
var trial = { var trial = {
type: 'iat-html', type: jsPsychIatHtml,
stimulus: 'Golf', stimulus: 'Golf',
stim_key_association: 'left', stim_key_association: 'left',
html_when_wrong: '<span style="color: red; font-size: 80px">X</span>', html_when_wrong: '<span style="color: red; font-size: 80px">X</span>',

View File

@ -16,18 +16,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload_trial = { var preload_trial = {
type: 'preload', type: jsPsychPreloadeload,
auto_preload: true auto_preload: true
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -39,7 +39,7 @@
var trial = { var trial = {
type: 'iat-image', type: jsPsychIatImage,
stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/blue.png', stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/blue.png',
stim_key_association: 'left', stim_key_association: 'left',
html_when_wrong: '<span style="color: red; font-size: 80px">X</span>', html_when_wrong: '<span style="color: red; font-size: 80px">X</span>',

View File

@ -16,18 +16,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload_trial = { var preload_trial = {
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -39,7 +39,7 @@
var trial = { var trial = {
type: 'image-button-response', type: jsPsychImageButtonResponse,
stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/happy_face_1.jpg', stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/happy_face_1.jpg',
choices: ['Happy', 'Sad'], choices: ['Happy', 'Sad'],
prompt: "<p>Is this person happy or sad?</p>" prompt: "<p>Is this person happy or sad?</p>"

View File

@ -16,18 +16,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload_trial = { var preload_trial = {
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -39,7 +39,7 @@
var trial = { var trial = {
type: 'image-keyboard-response', type: jsPsychImageKeyboardResponse,
stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/happy_face_1.jpg', stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/happy_face_1.jpg',
choices: ['e', 'i'], choices: ['e', 'i'],
prompt: "<p>Is this person happy or sad? Press 'e' for happy and 'i' for sad.</p>", prompt: "<p>Is this person happy or sad? Press 'e' for happy and 'i' for sad.</p>",

View File

@ -16,18 +16,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload_trial = { var preload_trial = {
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -38,7 +38,7 @@
}; };
var trial = { var trial = {
type: 'image-keyboard-response', type: jsPsychImageKeyboardResponse,
stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/happy_face_1.jpg', stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/happy_face_1.jpg',
choices: jsPsych.NO_KEYS, choices: jsPsych.NO_KEYS,
prompt: "<p>Study this face for 5 seconds.</p>", prompt: "<p>Study this face for 5 seconds.</p>",

View File

@ -16,18 +16,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload_trial = { var preload_trial = {
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -38,7 +38,7 @@
}; };
var trial = { var trial = {
type: 'image-slider-response', type: jsPsychImageSliderResponse,
stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/happy_face_1.jpg', stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/happy_face_1.jpg',
labels: ['happy', 'sad'], labels: ['happy', 'sad'],
prompt: "<p>How happy/sad is this person?</p>", prompt: "<p>How happy/sad is this person?</p>",

View File

@ -16,18 +16,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload_trial = { var preload_trial = {
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var demo_trial = { var demo_trial = {
type: 'instructions', type: jsPsychInstructions,
pages: [ pages: [
'Welcome to the experiment. Click next to begin.', 'Welcome to the experiment. Click next to begin.',
'This is the second page of instructions.', 'This is the second page of instructions.',
@ -37,7 +37,7 @@
} }
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -16,18 +16,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload_trial = { var preload_trial = {
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var demo_trial = { var demo_trial = {
type: 'instructions', type: jsPsychInstructions,
pages: [ pages: [
'Welcome to the experiment. Click next to begin.', 'Welcome to the experiment. Click next to begin.',
'You will be looking at images of arrows: ' + 'You will be looking at images of arrows: ' +
@ -38,7 +38,7 @@
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -16,18 +16,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload_trial = { var preload_trial = {
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var demo_trial = { var demo_trial = {
type: 'instructions', type: jsPsychInstructions,
pages: [ pages: [
'Welcome to the experiment. Click next to begin.', 'Welcome to the experiment. Click next to begin.',
'This is the second page of instructions.', 'This is the second page of instructions.',
@ -39,7 +39,7 @@
} }
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-maxdiff.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-maxdiff.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css">
@ -16,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
}; };
var trial = { var trial = {
type: 'maxdiff', type: jsPsychMaxdiff,
alternatives: ['apple', 'orange', 'pear', 'banana'], alternatives: ['apple', 'orange', 'pear', 'banana'],
labels: ['Most Preferred', 'Least Preferred'], labels: ['Most Preferred', 'Least Preferred'],
preamble: '<p> Please select your <b>most preferred</b> and <b>least preferred</b> fruits. </p>' preamble: '<p> Please select your <b>most preferred</b> and <b>least preferred</b> fruits. </p>'

View File

@ -21,13 +21,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.get().filter({trial_type: 'preload'}).last(1).values(); var trial_data = jsPsych.data.get().filter({trial_type: 'preload'}).last(1).values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -38,24 +38,24 @@
}; };
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
auto_preload: true auto_preload: true
} }
var trial_1 = { var trial_1 = {
type: 'image-button-response', type: jsPsychImageButtonResponse,
stimulus: 'img/happy_face_1.jpg', stimulus: 'img/happy_face_1.jpg',
choices: ['Next'] choices: ['Next']
} }
var trial_2 = { var trial_2 = {
type: 'image-button-response', type: jsPsychImageButtonResponse,
stimulus: 'img/happy_face_2.jpg', stimulus: 'img/happy_face_2.jpg',
choices: ['Next'] choices: ['Next']
} }
var trial_3 = { var trial_3 = {
type: 'image-button-response', type: jsPsychImageButtonResponse,
stimulus: 'img/happy_face_3.jpg', stimulus: 'img/happy_face_3.jpg',
choices: ['Next'] choices: ['Next']
} }

View File

@ -21,13 +21,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.get().filter({trial_type: 'preload'}).last(1).values(); var trial_data = jsPsych.data.get().filter({trial_type: 'preload'}).last(1).values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -38,12 +38,12 @@
}; };
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
images: ['img/sad_face_1.jpg'] images: ['img/sad_face_1.jpg']
} }
var trial_1 = { var trial_1 = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: ` stimulus: `
<p>Study this face</p> <p>Study this face</p>
<img src="img/sad_face_1.jpg"></img> <img src="img/sad_face_1.jpg"></img>

View File

@ -21,13 +21,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.get().filter({trial_type: 'preload'}).last(2).values(); var trial_data = jsPsych.data.get().filter({trial_type: 'preload'}).last(2).values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -38,19 +38,19 @@
}; };
var trial_1 = { var trial_1 = {
type: 'image-button-response', type: jsPsychImageButtonResponse,
stimulus: 'img/happy_face_1.jpg', stimulus: 'img/happy_face_1.jpg',
choices: ['Next'] choices: ['Next']
} }
var trial_2 = { var trial_2 = {
type: 'image-button-response', type: jsPsychImageButtonResponse,
stimulus: 'img/happy_face_2.jpg', stimulus: 'img/happy_face_2.jpg',
choices: ['Next'] choices: ['Next']
} }
var trial_3 = { var trial_3 = {
type: 'image-button-response', type: jsPsychImageButtonResponse,
stimulus: 'img/happy_face_3.jpg', stimulus: 'img/happy_face_3.jpg',
choices: ['Next'] choices: ['Next']
} }
@ -60,19 +60,19 @@
} }
var trial_4 = { var trial_4 = {
type: 'image-button-response', type: jsPsychImageButtonResponse,
stimulus: 'img/sad_face_1.jpg', stimulus: 'img/sad_face_1.jpg',
choices: ['Next'] choices: ['Next']
} }
var trial_5 = { var trial_5 = {
type: 'image-button-response', type: jsPsychImageButtonResponse,
stimulus: 'img/sad_face_2.jpg', stimulus: 'img/sad_face_2.jpg',
choices: ['Next'] choices: ['Next']
} }
var trial_6 = { var trial_6 = {
type: 'image-button-response', type: jsPsychImageButtonResponse,
stimulus: 'img/sad_face_3.jpg', stimulus: 'img/sad_face_3.jpg',
choices: ['Next'] choices: ['Next']
} }
@ -82,12 +82,12 @@
} }
var preload_block_1 = { var preload_block_1 = {
type: 'preload', type: jsPsychPreload,
trials: [block_1] trials: [block_1]
} }
var preload_block_2 = { var preload_block_2 = {
type: 'preload', type: jsPsychPreload,
trials: [block_2] trials: [block_2]
} }

View File

@ -21,13 +21,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.get().filter({trial_type: 'preload'}).last(1).values(); var trial_data = jsPsych.data.get().filter({trial_type: 'preload'}).last(1).values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -38,7 +38,7 @@
}; };
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
images: ['img/bad_file_path.png'], images: ['img/bad_file_path.png'],
show_detailed_errors: true show_detailed_errors: true
} }

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-rdk.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-rdk.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css">
@ -16,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
}; };
var trial = { var trial = {
type: "rdk", type: jsPsychRdk,
coherent_direction: 0, coherent_direction: 0,
correct_choice: "p" correct_choice: "p"
}; };

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-rdk.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-rdk.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css">
@ -16,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
}; };
var trial = { var trial = {
type: "rdk", type: jsPsychRdk,
post_trial_gap: 0, post_trial_gap: 0,
number_of_dots: 200, number_of_dots: 200,
RDK_type: 3, RDK_type: 3,

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-rdk.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-rdk.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css">
@ -16,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
}; };
var trial = { var trial = {
type: "rdk", type: jsPsychRdk,
number_of_apertures: 3, //This needs to be set if more than one aperture number_of_apertures: 3, //This needs to be set if more than one aperture
trial_duration: 10000, trial_duration: 10000,
correct_choice: "a", correct_choice: "a",

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-keyboard-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-keyboard-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-reconstruction.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-reconstruction.js"></script>
@ -17,13 +16,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -43,7 +42,7 @@
} }
var match_item = { var match_item = {
type: 'html-keyboard-response', type: jsPsychHtmKeyboardResponse,
stimulus: '<div style="display: block; margin: auto; height: 300px; width: 300px; position: relative;">'+ stimulus: '<div style="display: block; margin: auto; height: 300px; width: 300px; position: relative;">'+
'<div style="display: block; position: absolute; top: '+(150 - 210/2)+'px; left:'+(150 - 210/2)+'px; background-color: #000000; '+ '<div style="display: block; position: absolute; top: '+(150 - 210/2)+'px; left:'+(150 - 210/2)+'px; background-color: #000000; '+
'width: 210px; height: 210px;"></div></div>', 'width: 210px; height: 210px;"></div></div>',
@ -53,7 +52,7 @@
} }
var reconstruction = { var reconstruction = {
type: 'reconstruction', type: jsPsychReconstruction,
stim_function: sample_function, stim_function: sample_function,
starting_value: 0.5, starting_value: 0.5,
} }

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-resize.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-resize.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/css/jspsych.css">
@ -16,13 +15,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
}; };
var trial = { var trial = {
type: 'resize', type: jsPsychResize,
item_width: 3 + 3/8, item_width: 3 + 3/8,
item_height: 2 + 1/8, item_height: 2 + 1/8,
prompt: "<p>Click and drag the lower right corner of the box until the box is the same size as a credit card held up to the screen.</p>", prompt: "<p>Click and drag the lower right corner of the box until the box is the same size as a credit card held up to the screen.</p>",

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-same-different-html.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-same-different-html.js"></script>
<link <link
@ -21,13 +20,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -38,7 +37,7 @@
}; };
var trial = { var trial = {
type: 'same-different-html', type: jsPsychSameDifferentHtml,
stimuli: [ stimuli: [
'<p style="font-size:30px;">Climbing</p>', '<p style="font-size:30px;">Climbing</p>',
'<p style="font-size:30px;">Walking</p>' '<p style="font-size:30px;">Walking</p>'

View File

@ -21,7 +21,7 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
images: [ images: [
'img/happy_face_1.jpg', 'img/happy_face_1.jpg',
'img/sad_face_3.jpg' 'img/sad_face_3.jpg'
@ -29,13 +29,13 @@
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -46,7 +46,7 @@
}; };
var trial = { var trial = {
type: 'same-different-image', type: jsPsychSameDifferentImage,
stimuli: [ stimuli: [
'img/happy_face_1.jpg', 'img/happy_face_1.jpg',
'img/sad_face_3.jpg' 'img/sad_face_3.jpg'

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-serial-reaction-time.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-serial-reaction-time.js"></script>
<link <link
@ -21,13 +20,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.get().last(4).values(); var trial_data = jsPsych.data.get().last(4).values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -38,7 +37,7 @@
}; };
var instructions = { var instructions = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '<p>Use the S, F, H, and K keys to respond.</p>', stimulus: '<p>Use the S, F, H, and K keys to respond.</p>',
choices: ['Continue'] choices: ['Continue']
} }
@ -52,25 +51,25 @@
] ]
var trial_1 = { var trial_1 = {
type: 'serial-reaction-time', type: jsPsychSerialReactionTime,
grid: grid, grid: grid,
choices: response_map, choices: response_map,
target: [0,0] target: [0,0]
} }
var trial_2 = { var trial_2 = {
type: 'serial-reaction-time', type: jsPsychSerialReactionTime,
grid: grid, grid: grid,
choices: response_map, choices: response_map,
target: [0,1] target: [0,1]
} }
var trial_3 = { var trial_3 = {
type: 'serial-reaction-time', type: jsPsychSerialReactionTime,
grid: grid, grid: grid,
choices: response_map, choices: response_map,
target: [0,2] target: [0,2]
} }
var trial_4 = { var trial_4 = {
type: 'serial-reaction-time', type: jsPsychSerialReactionTime,
grid: grid, grid: grid,
choices: response_map, choices: response_map,
target: [0,3] target: [0,3]

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-serial-reaction-time.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-serial-reaction-time.js"></script>
<link <link
@ -21,13 +20,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.get().last(4).values(); var trial_data = jsPsych.data.get().last(4).values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -38,7 +37,7 @@
}; };
var instructions = { var instructions = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '<p>Use the R, I, V, and M keys to respond.</p>', stimulus: '<p>Use the R, I, V, and M keys to respond.</p>',
choices: ['Continue'] choices: ['Continue']
} }
@ -54,7 +53,7 @@
] ]
var trial_1 = { var trial_1 = {
type: 'serial-reaction-time', type: jsPsychSerialReactionTime,
grid: grid, grid: grid,
choices: response_map, choices: response_map,
target: [0,0], target: [0,0],
@ -62,7 +61,7 @@
feedback_duration: 500 feedback_duration: 500
} }
var trial_2 = { var trial_2 = {
type: 'serial-reaction-time', type: jsPsychSerialReactionTime,
grid: grid, grid: grid,
choices: response_map, choices: response_map,
target: [0,1], target: [0,1],
@ -70,7 +69,7 @@
feedback_duration: 500 feedback_duration: 500
} }
var trial_3 = { var trial_3 = {
type: 'serial-reaction-time', type: jsPsychSerialReactionTime,
grid: grid, grid: grid,
choices: response_map, choices: response_map,
target: [1,1], target: [1,1],
@ -78,7 +77,7 @@
feedback_duration: 500 feedback_duration: 500
} }
var trial_4 = { var trial_4 = {
type: 'serial-reaction-time', type: jsPsychSerialReactionTime,
grid: grid, grid: grid,
choices: response_map, choices: response_map,
target: [1,0], target: [1,0],

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-serial-reaction-time-mouse.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-serial-reaction-time-mouse.js"></script>
<link <link
@ -21,13 +20,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.get().last(4).values(); var trial_data = jsPsych.data.get().last(4).values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -42,22 +41,22 @@
] ]
var trial_1 = { var trial_1 = {
type: 'serial-reaction-time-mouse', type: jsPsychSerialReactionTimeMouse,
grid: grid, grid: grid,
target: [0,0] target: [0,0]
} }
var trial_2 = { var trial_2 = {
type: 'serial-reaction-time-mouse', type: jsPsychSerialReactionTimeMouse,
grid: grid, grid: grid,
target: [0,1] target: [0,1]
} }
var trial_3 = { var trial_3 = {
type: 'serial-reaction-time-mouse', type: jsPsychSerialReactionTimeMouse,
grid: grid, grid: grid,
target: [0,2] target: [0,2]
} }
var trial_4 = { var trial_4 = {
type: 'serial-reaction-time-mouse', type: jsPsychSerialReactionTimeMouse,
grid: grid, grid: grid,
target: [0,3] target: [0,3]
} }

View File

@ -2,7 +2,6 @@
<html> <html>
<head> <head>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/jspsych.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-preload.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-html-button-response.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-serial-reaction-time-mouse.js"></script> <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/plugins/jspsych-serial-reaction-time-mouse.js"></script>
<link <link
@ -21,13 +20,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.get().last(4).values(); var trial_data = jsPsych.data.get().last(4).values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -44,25 +43,25 @@
] ]
var trial_1 = { var trial_1 = {
type: 'serial-reaction-time-mouse', type: jsPsychSerialReactionTimeMouse,
grid: grid, grid: grid,
target: [0,0], target: [0,0],
target_color: '#006738' target_color: '#006738'
} }
var trial_2 = { var trial_2 = {
type: 'serial-reaction-time-mouse', type: jsPsychSerialReactionTimeMouse,
grid: grid, grid: grid,
target: [0,2], target: [0,2],
target_color: '#F78F1E' target_color: '#F78F1E'
} }
var trial_3 = { var trial_3 = {
type: 'serial-reaction-time-mouse', type: jsPsychSerialReactionTimeMouse,
grid: grid, grid: grid,
target: [2,2], target: [2,2],
target_color: '#13B24B' target_color: '#13B24B'
} }
var trial_4 = { var trial_4 = {
type: 'serial-reaction-time-mouse', type: jsPsychSerialReactionTimeMouse,
grid: grid, grid: grid,
target: [2,0], target: [2,0],
target_color: '#E74921' target_color: '#E74921'

View File

@ -20,13 +20,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -37,7 +37,7 @@
}; };
var trial = { var trial = {
type: 'survey-html-form', type: jsPsychSurveyHtmlForm,
preamble: '<p>How are you feeling <b>right now?</b></p>', preamble: '<p>How are you feeling <b>right now?</b></p>',
html: '<p> I am feeling <input name="first" type="text" />, <input name="second" type="text" />, and <input name="third" type="text" />.</p>' html: '<p> I am feeling <input name="first" type="text" />, <input name="second" type="text" />, and <input name="third" type="text" />.</p>'
}; };

View File

@ -20,13 +20,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -37,7 +37,7 @@
}; };
var trial = { var trial = {
type: 'survey-html-form', type: jsPsychSurveyHtmlForm,
preamble: '<p>What is your favorite bird?</p>', preamble: '<p>What is your favorite bird?</p>',
html: '<p>My favorite bird is <input type="text" id="test-resp-box" name="response" size="10" /></p>', html: '<p>My favorite bird is <input type="text" id="test-resp-box" name="response" size="10" /></p>',
autofocus: 'test-resp-box' autofocus: 'test-resp-box'

View File

@ -20,13 +20,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -37,7 +37,7 @@
}; };
var trial = { var trial = {
type: 'survey-likert', type: jsPsychSurveyLIkert,
questions: [ questions: [
{ {
prompt: "I like vegetables.", prompt: "I like vegetables.",

View File

@ -20,13 +20,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -45,7 +45,7 @@
]; ];
var trial = { var trial = {
type: 'survey-likert', type: jsPsychSurveyLIkert,
questions: [ questions: [
{prompt: "I like vegetables.", name: 'Vegetables', labels: likert_scale}, {prompt: "I like vegetables.", name: 'Vegetables', labels: likert_scale},
{prompt: "I like fruit.", name: 'Fruit', labels: likert_scale}, {prompt: "I like fruit.", name: 'Fruit', labels: likert_scale},

View File

@ -20,13 +20,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -37,7 +37,7 @@
}; };
var trial = { var trial = {
type: 'survey-multi-choice', type: jsPsychSurveyMultiChoice,
questions: [ questions: [
{ {
prompt: "Which of the following do you like the most?", prompt: "Which of the following do you like the most?",

View File

@ -20,13 +20,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -37,7 +37,7 @@
}; };
var trial = { var trial = {
type: 'survey-multi-choice', type: jsPsychSurveyMultiChoice,
questions: [ questions: [
{ {
prompt: "Which of the following do you like the most?", prompt: "Which of the following do you like the most?",

View File

@ -20,13 +20,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -37,7 +37,7 @@
}; };
var trial = { var trial = {
type: 'survey-multi-select', type: jsPsychSurveyMultiSelect,
questions: [ questions: [
{ {
prompt: "Which of these colors do you like?", prompt: "Which of these colors do you like?",

View File

@ -20,13 +20,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -37,7 +37,7 @@
}; };
var trial = { var trial = {
type: 'survey-text', type: jsPsychSurveyText,
questions: [ questions: [
{prompt: 'How old are you?'} {prompt: 'How old are you?'}
] ]

View File

@ -20,13 +20,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -37,7 +37,7 @@
}; };
var trial = { var trial = {
type: 'survey-text', type: jsPsychSurveyText,
questions: [ questions: [
{prompt: 'What is your date of birth?', placeholder: 'mm/dd/yyyy', required: true}, {prompt: 'What is your date of birth?', placeholder: 'mm/dd/yyyy', required: true},
{prompt: 'What country do you currently live in?'} {prompt: 'What country do you currently live in?'}

View File

@ -20,13 +20,13 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -37,7 +37,7 @@
}; };
var trial = { var trial = {
type: 'survey-text', type: jsPsychSurveyText,
questions: [ questions: [
{prompt: 'What did you eat for breakfast?', name: 'Breakfast'}, {prompt: 'What did you eat for breakfast?', name: 'Breakfast'},
{prompt: 'What did you eat for lunch?', name: 'Lunch'} {prompt: 'What did you eat for lunch?', name: 'Lunch'}

View File

@ -21,18 +21,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
images: ['img/navarro_burst_03.jpg'] images: ['img/navarro_burst_03.jpg']
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -43,7 +43,7 @@
}; };
var trial = { var trial = {
type: 'survey-text', type: jsPsychSurveyText,
preamble: `<img src="img/navarro_burst_03.jpg" style="width:400px;"></img>`, preamble: `<img src="img/navarro_burst_03.jpg" style="width:400px;"></img>`,
questions: [ questions: [
{prompt: 'Describe your reaction to the image above', rows: 5} {prompt: 'Describe your reaction to the image above', rows: 5}

View File

@ -16,18 +16,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
video: 'video/fish.mp4' video: 'video/fish.mp4'
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -38,7 +38,7 @@
}; };
var trial = { var trial = {
type: 'video-button-response', type: jsPsychVideoButtonResponse,
stimulus: [ stimulus: [
'video/fish.mp4' 'video/fish.mp4'
], ],

View File

@ -16,18 +16,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
video: 'video/fish.mp4' video: 'video/fish.mp4'
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -38,7 +38,7 @@
}; };
var trial = { var trial = {
type: 'video-keyboard-response', type: jsPsychVideoKeyboardResponse,
stimulus: [ stimulus: [
'video/fish.mp4' 'video/fish.mp4'
], ],

View File

@ -16,18 +16,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
video: 'video/fish.mp4' video: 'video/fish.mp4'
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -38,7 +38,7 @@
}; };
var trial = { var trial = {
type: 'video-slider-response', type: jsPsychVideoSliderResponse,
stimulus: [ stimulus: [
'video/fish.mp4' 'video/fish.mp4'
], ],

View File

@ -16,14 +16,19 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload = {
type: jsPsychPreload,
images: ['https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/card.png']
};
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -34,7 +39,7 @@
}; };
var trial = { var trial = {
type: 'virtual-chinrest', type: jsPsychVirtualChinrest,
blindspot_reps: 3, blindspot_reps: 3,
resize_units: "none" resize_units: "none"
}; };

View File

@ -17,18 +17,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
images: ['img/card.png'] images: ['https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/card.png']
} };
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.get().filter({trial_type: 'virtual-chinrest'}).last(1).values(); var trial_data = jsPsych.data.get().filter({trial_type: 'virtual-chinrest'}).last(1).values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -39,14 +39,14 @@
}; };
var trial = { var trial = {
type: 'virtual-chinrest', type: jsPsychVirtualChinrest,
blindspot_reps: 3, blindspot_reps: 3,
resize_units: "cm", resize_units: "cm",
pixels_per_unit: 50 pixels_per_unit: 50
}; };
var resized_stimulus = { var resized_stimulus = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: ` stimulus: `
<p>If the measurements were done correctly, the square below should be 10 cm x 10 cm.</p> <p>If the measurements were done correctly, the square below should be 10 cm x 10 cm.</p>
<div style="background-color: black; width: 500px; height: 500px; margin: 20px auto;"></div> <div style="background-color: black; width: 500px; height: 500px; margin: 20px auto;"></div>

View File

@ -17,18 +17,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
images: ['img/card.png'] images: ['https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/card.png']
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.get().filter({trial_type: 'virtual-chinrest'}).last(1).values(); var trial_data = jsPsych.data.get().filter({trial_type: 'virtual-chinrest'}).last(1).values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -39,14 +39,14 @@
}; };
var trial = { var trial = {
type: 'virtual-chinrest', type: jsPsychVirtualChinrest,
blindspot_reps: 3, blindspot_reps: 3,
resize_units: "deg", resize_units: "deg",
pixels_per_unit: 50 pixels_per_unit: 50
}; };
var resized_stimulus = { var resized_stimulus = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: ` stimulus: `
<p>If the measurements were done correctly, the square below should take up about 10 degrees of visual angle.</p> <p>If the measurements were done correctly, the square below should take up about 10 degrees of visual angle.</p>
<div style="background-color: black; width: 500px; height: 500px; margin: 20px auto;"></div> <div style="background-color: black; width: 500px; height: 500px; margin: 20px auto;"></div>

View File

@ -21,18 +21,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
images: ['img/backwardN.gif', 'img/normalN.gif', 'img/fixation.gif'] images: ['img/backwardN.gif', 'img/normalN.gif', 'img/fixation.gif']
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -43,14 +43,14 @@
}; };
var instructions = { var instructions = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: `<p>Press J if there is a backwards N.</p> stimulus: `<p>Press J if there is a backwards N.</p>
<p>Press F if all the Ns are in the normal orientation.</p>`, <p>Press F if all the Ns are in the normal orientation.</p>`,
choices: ['Continue'] choices: ['Continue']
} }
var trial = { var trial = {
type: 'visual-search-circle', type: jsPsychVisualSearchCircle,
target: 'img/backwardN.gif', target: 'img/backwardN.gif',
foil: 'img/normalN.gif', foil: 'img/normalN.gif',
fixation_image: 'img/fixation.gif', fixation_image: 'img/fixation.gif',

View File

@ -21,18 +21,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
images: ['img/elephant.png', 'img/lion.png', 'img/monkey.png'] images: ['img/elephant.png', 'img/lion.png', 'img/monkey.png']
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -43,14 +43,14 @@
}; };
var instructions = { var instructions = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: `<p>Press E if there is an elephant in the group.</p> stimulus: `<p>Press E if there is an elephant in the group.</p>
<p>Press N if there is no elephant in the group.</p>`, <p>Press N if there is no elephant in the group.</p>`,
choices: ['Continue'] choices: ['Continue']
} }
var trial = { var trial = {
type: 'visual-search-circle', type: jsPsychVisualSearchCircle,
target: 'img/elephant.png', target: 'img/elephant.png',
foil: ['img/lion.png', 'img/monkey.png'], foil: ['img/lion.png', 'img/monkey.png'],
fixation_image: 'img/fixation.gif', fixation_image: 'img/fixation.gif',

View File

@ -22,18 +22,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
images: ['img/1.gif', 'img/2.gif', 'img/3.gif', 'img/4.gif'] images: ['img/1.gif', 'img/2.gif', 'img/3.gif', 'img/4.gif']
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -44,7 +44,7 @@
}; };
var trial = { var trial = {
type: 'vsl-animate-occlusion', type: jsPsychVslAnimateOcclusion,
stimuli: [ stimuli: [
"img/1.gif", "img/1.gif",
"img/2.gif", "img/2.gif",

View File

@ -21,18 +21,18 @@
var jsPsych = initJsPsych(); var jsPsych = initJsPsych();
var preload = { var preload = {
type: 'preload', type: jsPsychPreload,
images: ['img/1.gif', 'img/2.gif', 'img/3.gif', 'img/4.gif', 'img/5.gif'] images: ['img/1.gif', 'img/2.gif', 'img/3.gif', 'img/4.gif', 'img/5.gif']
} }
var start = { var start = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: '', stimulus: '',
choices: ['Run demo'] choices: ['Run demo']
}; };
var show_data = { var show_data = {
type: 'html-button-response', type: jsPsychHtmlButtonResponse,
stimulus: function() { stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values(); var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2); var trial_json = JSON.stringify(trial_data, null, 2);
@ -49,7 +49,7 @@
] ]
var trial = { var trial = {
type: 'vsl-grid-scene', type: jsPsychVslGridScene,
stimuli: scene, stimuli: scene,
trial_duration: 1500 trial_duration: 1500
}; };