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({
extensions: [
{type: 'webgazer'}
{type: jsPsychExtensionWebgazer}
]
});
var preload = {
type: 'preload',
type: jsPsychPreload,
images: ['img/blue.png']
}
var camera_instructions = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: `
<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>
@ -47,11 +47,11 @@
}
var init_camera = {
type: 'webgazer-init-camera'
type: jsPsychWebgazerInitCamera
}
var calibration_instructions = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
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>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 = {
type: 'webgazer-calibrate',
type: jsPsychWebgazerCalibrate,
calibration_points: [
[25,25],[75,25],[50,50],[25,75],[75,75]
],
@ -69,7 +69,7 @@
}
var validation_instructions = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: `
<p>Now we'll measure the accuracy of the calibration.</p>
<p>Look at each dot as it appears on the screen.</p>
@ -80,7 +80,7 @@
}
var validation = {
type: 'webgazer-validate',
type: jsPsychWebgazerValidate,
validation_points: [
[25,25],[75,25],[50,50],[25,75],[75,75]
],
@ -93,7 +93,7 @@
}
var recalibrate_instructions = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: `
<p>The accuracy of the calibration is a little lower than we'd like.</p>
<p>Let's try calibrating one more time.</p>
@ -117,7 +117,7 @@
}
var calibration_done = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: `
<p>Great, we're done with calibration!</p>
`,
@ -125,7 +125,7 @@
}
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>
<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>
@ -133,20 +133,20 @@
}
var trial = {
type: 'image-keyboard-response',
type: jsPsychImageKeyboardResponse,
stimulus: 'img/blue.png',
choices: jsPsych.NO_KEYS,
trial_duration: 2000,
extensions: [
{
type: 'webgazer',
type: jsPsychExtensionWebgazer,
params: {targets: ['#jspsych-image-keyboard-response-stimulus']}
}
]
}
var show_data = {
type: 'html-keyboard-response',
type: jsPsychHtmKeyboardResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -17,18 +17,18 @@
var jsPsych = initJsPsych();
var preload_trial = {
type: 'preload',
type: jsPsychPreload,
auto_preload: true
}
var start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var animation_trial = {
type: 'animation',
type: jsPsychAnimation,
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_2.jpg',
@ -41,7 +41,7 @@
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -15,12 +15,12 @@
var timeline = [];
timeline.push({
type: 'preload',
type: jsPsychPreload,
auto_preload: true
});
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. '+
'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>',
@ -28,14 +28,14 @@
});
var trial = {
type: 'audio-button-response',
type: jsPsychAudioButtonResponse,
stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/sound/tone.mp3',
choices: ['Low', 'High'],
prompt: "<p>Is the pitch high or low?</p>"
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
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']
timeline.push({
type: 'preload',
type: jsPsychPreload,
auto_preload: true,
images: images
});
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. '+
'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>',
@ -33,7 +33,7 @@
});
var trial = {
type: 'audio-button-response',
type: jsPsychAudioButtonResponse,
stimulus: 'sound/roar.mp3',
choices: images,
prompt: "<p>Which animal made the sound?</p>",
@ -41,7 +41,7 @@
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -13,12 +13,12 @@
var jsPsych = initJsPsych();
var preload = {
type: 'preload',
type: jsPsychPreload,
auto_preload: true
}
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. '+
'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>',
@ -26,7 +26,7 @@
}
var trial = {
type: 'audio-keyboard-response',
type: jsPsychAudioKeyboardResponse,
stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/sound/tone.mp3',
choices: ['e', 'i'],
prompt: "<p>Is the pitch high or low? Press 'e' for low and 'i' for high.</p>",
@ -34,7 +34,7 @@
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -13,12 +13,12 @@
var jsPsych = initJsPsych();
var preload = {
type: 'preload',
type: jsPsychPreload,
auto_preload: true
}
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. '+
'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>',
@ -26,14 +26,14 @@
}
var trial = {
type: 'audio-keyboard-response',
type: jsPsychAudioKeyboardResponse,
stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/sound/tone.mp3',
choices: jsPsych.NO_KEYS,
trial_ends_after_audio: true
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -13,12 +13,12 @@
var jsPsych = initJsPsych();
var preload = {
type: 'preload',
type: jsPsychPreload,
auto_preload: true
};
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. '+
'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>',
@ -26,14 +26,14 @@
};
var trial = {
type: 'audio-slider-response',
type: jsPsychAudioSliderResponse,
stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/sound/speech_joke.mp3',
labels: ['Not Funny', 'Funny'],
prompt: '<p>How funny is the joke?</p>'
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);

View File

@ -13,12 +13,12 @@
var jsPsych = initJsPsych();
var preload = {
type: 'preload',
type: jsPsychPreload,
auto_preload: true
};
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. '+
'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>',
@ -26,7 +26,7 @@
};
var trial = {
type: 'audio-slider-response',
type: jsPsychAudioSliderResponse,
stimulus: 'https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/sound/speech_joke.mp3',
labels: ['Not Funny', 'Funny'],
prompt: '<p>How funny is the joke?</p>',
@ -35,7 +35,7 @@
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);

View File

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

View File

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

View File

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

View File

@ -15,13 +15,13 @@
var jsPsych = initJsPsych();
var start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
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
@ -44,7 +44,7 @@
}
var circle_1 = {
type: 'canvas-button-response',
type: jsPsychCanvasButtonResponse,
stimulus: function(c) {
filledCirc(c, 100, 'blue');
},
@ -55,7 +55,7 @@
};
var circle_2 = {
type: 'canvas-button-response',
type: jsPsychCanvasButtonResponse,
stimulus: function(c) {
filledCirc(c, 150, 'green');
},

View File

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

View File

@ -15,13 +15,13 @@
var jsPsych = initJsPsych();
var start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
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
@ -45,7 +45,7 @@
// In addition, this code demonstrates how to check whether participants' answers were correct or not.
var circle_procedure = {
timeline: [{
type: 'canvas-button-response',
type: jsPsychCanvasButtonResponse,
stimulus: function(c) {
filledCirc(c, jsPsych.timelineVariable('radius'), jsPsych.timelineVariable('color'));
},

View File

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

View File

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

View File

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

View File

@ -17,13 +17,13 @@
var jsPsych = initJsPsych();
var start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -34,12 +34,12 @@
};
var preload_trial = {
type: 'preload',
type: jsPsychPreload,
auto_preload: true
}
var animation_trial = {
type: 'categorize-animation',
type: jsPsychCategorizeAnimation,
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_2.jpg',

View File

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

View File

@ -2,7 +2,6 @@
<html>
<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/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-html-button-response.js"></script>
<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 start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
};
var categorization_trial = {
type: 'categorize-html',
type: jsPsychCategorizeHtml,
stimulus: '<p>B</p>',
key_answer: 'p',
text_answer: 'letter',

View File

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

View File

@ -2,7 +2,6 @@
<html>
<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/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-html-button-response.js"></script>
<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 start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
};
var cloze_trial = {
type: 'cloze',
type: jsPsychCloze,
text: 'The %% is the largest terrestrial mammal. It lives in both %% and %%.'
};

View File

@ -2,7 +2,6 @@
<html>
<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/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-html-button-response.js"></script>
<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 start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
};
var cloze_trial = {
type: 'cloze',
type: jsPsychCloze,
text: 'A rectangle has % 4 % corners and a triangle has % 3 %.',
check_answers: true,
button_text: 'Next',

View File

@ -2,7 +2,6 @@
<html>
<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/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-html-button-response.js"></script>
<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 start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -47,7 +46,7 @@
// declare the block.
var trial = {
type:'external-html',
type: jsPsychExternalHtml,
url: "external_page.html",
cont_btn: "start",
check_fn: check_consent

View File

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

View File

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

View File

@ -2,7 +2,6 @@
<html>
<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/plugins/jspsych-preload.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">
<style>
@ -15,13 +14,13 @@
var jsPsych = initJsPsych();
var start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -32,7 +31,7 @@
};
var trial = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '<p>Running</p>',
choices: ['Healthy', 'Unhealthy'],
prompt: "<p>Is this activity healthy or unhealthy?</p>"

View File

@ -2,7 +2,6 @@
<html>
<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/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-button-response.js"></script>
<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 start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
};
var trial = {
type: 'html-keyboard-response',
type: jsPsychHtmKeyboardResponse,
stimulus: '<p>Running</p>',
choices: ['e', 'i'],
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>
<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/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-button-response.js"></script>
<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 start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
};
var trial = {
type: 'html-keyboard-response',
type: jsPsychHtmKeyboardResponse,
stimulus: '<p style="font-size: 48px;">+</p>',
choices: jsPsych.NO_KEYS,
trial_duration: 1000,

View File

@ -2,7 +2,6 @@
<html>
<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/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-button-response.js"></script>
<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 start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
};
var trial = {
type: 'html-slider-response',
type: jsPsychHtmSliderResponse,
stimulus: '<p>Running</p>',
require_movement: true,
labels: ['healthy', 'unhealthy'],

View File

@ -2,7 +2,6 @@
<html>
<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/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-iat-html.js"></script>
<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 start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
};
var trial = {
type: 'iat-html',
type: jsPsychIatHtml,
stimulus: 'Golf',
stim_key_association: 'left',
html_when_wrong: '<span style="color: red; font-size: 80px">X</span>',

View File

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

View File

@ -16,18 +16,18 @@
var jsPsych = initJsPsych();
var preload_trial = {
type: 'preload',
type: jsPsychPreload,
auto_preload: true
}
var start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -39,7 +39,7 @@
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',
choices: ['Happy', 'Sad'],
prompt: "<p>Is this person happy or sad?</p>"

View File

@ -16,18 +16,18 @@
var jsPsych = initJsPsych();
var preload_trial = {
type: 'preload',
type: jsPsychPreload,
auto_preload: true
}
var start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -39,7 +39,7 @@
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',
choices: ['e', 'i'],
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 preload_trial = {
type: 'preload',
type: jsPsychPreload,
auto_preload: true
}
var start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -38,7 +38,7 @@
};
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',
choices: jsPsych.NO_KEYS,
prompt: "<p>Study this face for 5 seconds.</p>",

View File

@ -16,18 +16,18 @@
var jsPsych = initJsPsych();
var preload_trial = {
type: 'preload',
type: jsPsychPreload,
auto_preload: true
}
var start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -38,7 +38,7 @@
};
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',
labels: ['happy', 'sad'],
prompt: "<p>How happy/sad is this person?</p>",

View File

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

View File

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

View File

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

View File

@ -2,7 +2,6 @@
<html>
<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/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-maxdiff.js"></script>
<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 start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
};
var trial = {
type: 'maxdiff',
type: jsPsychMaxdiff,
alternatives: ['apple', 'orange', 'pear', 'banana'],
labels: ['Most Preferred', 'Least Preferred'],
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 start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.get().filter({trial_type: 'preload'}).last(1).values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -38,24 +38,24 @@
};
var preload = {
type: 'preload',
type: jsPsychPreload,
auto_preload: true
}
var trial_1 = {
type: 'image-button-response',
type: jsPsychImageButtonResponse,
stimulus: 'img/happy_face_1.jpg',
choices: ['Next']
}
var trial_2 = {
type: 'image-button-response',
type: jsPsychImageButtonResponse,
stimulus: 'img/happy_face_2.jpg',
choices: ['Next']
}
var trial_3 = {
type: 'image-button-response',
type: jsPsychImageButtonResponse,
stimulus: 'img/happy_face_3.jpg',
choices: ['Next']
}

View File

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

View File

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

View File

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

View File

@ -2,7 +2,6 @@
<html>
<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/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-rdk.js"></script>
<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 start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
};
var trial = {
type: "rdk",
type: jsPsychRdk,
coherent_direction: 0,
correct_choice: "p"
};

View File

@ -2,7 +2,6 @@
<html>
<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/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-rdk.js"></script>
<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 start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
};
var trial = {
type: "rdk",
type: jsPsychRdk,
post_trial_gap: 0,
number_of_dots: 200,
RDK_type: 3,

View File

@ -2,7 +2,6 @@
<html>
<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/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-rdk.js"></script>
<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 start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
};
var trial = {
type: "rdk",
type: jsPsychRdk,
number_of_apertures: 3, //This needs to be set if more than one aperture
trial_duration: 10000,
correct_choice: "a",

View File

@ -2,7 +2,6 @@
<html>
<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/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-keyboard-response.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 start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -43,7 +42,7 @@
}
var match_item = {
type: 'html-keyboard-response',
type: jsPsychHtmKeyboardResponse,
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; '+
'width: 210px; height: 210px;"></div></div>',
@ -53,7 +52,7 @@
}
var reconstruction = {
type: 'reconstruction',
type: jsPsychReconstruction,
stim_function: sample_function,
starting_value: 0.5,
}

View File

@ -2,7 +2,6 @@
<html>
<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/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-resize.js"></script>
<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 start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -33,7 +32,7 @@
};
var trial = {
type: 'resize',
type: jsPsychResize,
item_width: 3 + 3/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>",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -20,13 +20,13 @@
var jsPsych = initJsPsych();
var start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -37,7 +37,7 @@
};
var trial = {
type: 'survey-html-form',
type: jsPsychSurveyHtmlForm,
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>'
};

View File

@ -20,13 +20,13 @@
var jsPsych = initJsPsych();
var start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -37,7 +37,7 @@
};
var trial = {
type: 'survey-html-form',
type: jsPsychSurveyHtmlForm,
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>',
autofocus: 'test-resp-box'

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -17,18 +17,18 @@
var jsPsych = initJsPsych();
var preload = {
type: 'preload',
images: ['img/card.png']
}
type: jsPsychPreload,
images: ['https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/card.png']
};
var start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.get().filter({trial_type: 'virtual-chinrest'}).last(1).values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -39,14 +39,14 @@
};
var trial = {
type: 'virtual-chinrest',
type: jsPsychVirtualChinrest,
blindspot_reps: 3,
resize_units: "cm",
pixels_per_unit: 50
};
var resized_stimulus = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: `
<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>

View File

@ -17,18 +17,18 @@
var jsPsych = initJsPsych();
var preload = {
type: 'preload',
images: ['img/card.png']
type: jsPsychPreload,
images: ['https://cdn.jsdelivr.net/gh/jspsych/jsPsych@6.3.1/examples/img/card.png']
}
var start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.get().filter({trial_type: 'virtual-chinrest'}).last(1).values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -39,14 +39,14 @@
};
var trial = {
type: 'virtual-chinrest',
type: jsPsychVirtualChinrest,
blindspot_reps: 3,
resize_units: "deg",
pixels_per_unit: 50
};
var resized_stimulus = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: `
<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>

View File

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

View File

@ -21,18 +21,18 @@
var jsPsych = initJsPsych();
var preload = {
type: 'preload',
type: jsPsychPreload,
images: ['img/elephant.png', 'img/lion.png', 'img/monkey.png']
}
var start = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var show_data = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
stimulus: function() {
var trial_data = jsPsych.data.getLastTrialData().values();
var trial_json = JSON.stringify(trial_data, null, 2);
@ -43,14 +43,14 @@
};
var instructions = {
type: 'html-button-response',
type: jsPsychHtmlButtonResponse,
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>`,
choices: ['Continue']
}
var trial = {
type: 'visual-search-circle',
type: jsPsychVisualSearchCircle,
target: 'img/elephant.png',
foil: ['img/lion.png', 'img/monkey.png'],
fixation_image: 'img/fixation.gif',

View File

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

View File

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