add render_on_canvas: false to tests

This commit is contained in:
Becky Gilbert 2020-11-09 14:22:43 -08:00
parent af8d531259
commit e9adaff0e0
5 changed files with 65 additions and 29 deletions

View File

@ -20,7 +20,8 @@ describe('animation plugin', function(){
var trial = { var trial = {
type: 'animation', type: 'animation',
stimuli: animation_sequence stimuli: animation_sequence,
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({

View File

@ -18,7 +18,8 @@ describe('categorize-animation plugin', function(){
var trial = { var trial = {
type: 'categorize-animation', type: 'categorize-animation',
stimuli: ['img/happy_face_1.jpg', 'img/sad_face_1.jpg'], stimuli: ['img/happy_face_1.jpg', 'img/sad_face_1.jpg'],
key_answer: 68 key_answer: 68,
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -37,7 +38,8 @@ describe('categorize-animation plugin', function(){
type: 'categorize-animation', type: 'categorize-animation',
stimuli: ['img/happy_face_1.jpg', 'img/sad_face_1.jpg'], stimuli: ['img/happy_face_1.jpg', 'img/sad_face_1.jpg'],
key_answer: 68, key_answer: 68,
prompt: "<p>Press d if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>" prompt: "<p>Press d if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>",
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -55,7 +57,8 @@ describe('categorize-animation plugin', function(){
stimuli: ['img/happy_face_1.jpg', 'img/sad_face_1.jpg'], stimuli: ['img/happy_face_1.jpg', 'img/sad_face_1.jpg'],
key_answer: 68, key_answer: 68,
choices: [68, 83], choices: [68, 83],
prompt: "<p>Press d if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>" prompt: "<p>Press d if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>",
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -75,7 +78,8 @@ describe('categorize-animation plugin', function(){
stimuli: ['img/happy_face_1.jpg', 'img/sad_face_1.jpg'], stimuli: ['img/happy_face_1.jpg', 'img/sad_face_1.jpg'],
key_answer: 68, key_answer: 68,
choices: [68, 83], choices: [68, 83],
prompt: "<p>Press d if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>" prompt: "<p>Press d if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>",
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -98,7 +102,8 @@ describe('categorize-animation plugin', function(){
text_answer: 'different', text_answer: 'different',
correct_text: "<p>Correct. The faces had %ANS% expressions.</p>", correct_text: "<p>Correct. The faces had %ANS% expressions.</p>",
incorrect_text: "<p>Incorrect. The faces had %ANS% expressions.</p>", incorrect_text: "<p>Incorrect. The faces had %ANS% expressions.</p>",
prompt: "<p>Press D if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>", prompt: "<p>Press D if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>",
render_on_canvas: false
}; };
jsPsych.init({ jsPsych.init({
@ -120,7 +125,8 @@ describe('categorize-animation plugin', function(){
choices: [68, 83], choices: [68, 83],
correct_text: "<p>You pressed the correct key</p>", correct_text: "<p>You pressed the correct key</p>",
incorrect_text: "<p>Incorrect.</p>", incorrect_text: "<p>Incorrect.</p>",
prompt: "<p>Press D if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>", prompt: "<p>Press D if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>",
render_on_canvas: false
}; };
jsPsych.init({ jsPsych.init({
@ -142,7 +148,8 @@ describe('categorize-animation plugin', function(){
choices: [68, 83], choices: [68, 83],
correct_text: "<p>You pressed the correct key</p>", correct_text: "<p>You pressed the correct key</p>",
incorrect_text: "<p>Incorrect. You pressed the wrong key.</p>", incorrect_text: "<p>Incorrect. You pressed the wrong key.</p>",
prompt: "<p>Press D if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>", prompt: "<p>Press D if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>",
render_on_canvas: false
}; };
jsPsych.init({ jsPsych.init({
@ -165,7 +172,8 @@ describe('categorize-animation plugin', function(){
frame_time: 1000, frame_time: 1000,
correct_text: "<p>You pressed the correct key</p>", correct_text: "<p>You pressed the correct key</p>",
incorrect_text: "<p>Incorrect. You pressed the wrong key.</p>", incorrect_text: "<p>Incorrect. You pressed the wrong key.</p>",
prompt: "<p>Press D if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>", prompt: "<p>Press D if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>",
render_on_canvas: false
}; };
jsPsych.init({ jsPsych.init({
@ -191,7 +199,8 @@ describe('categorize-animation plugin', function(){
sequence_reps: 2, sequence_reps: 2,
correct_text: "<p>You pressed the correct key</p>", correct_text: "<p>You pressed the correct key</p>",
incorrect_text: "<p>Incorrect. You pressed the wrong key.</p>", incorrect_text: "<p>Incorrect. You pressed the wrong key.</p>",
prompt: "<p>Press D if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>", prompt: "<p>Press D if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>",
render_on_canvas: false
}; };
jsPsych.init({ jsPsych.init({
@ -220,7 +229,8 @@ describe('categorize-animation plugin', function(){
correct_text: "<p>You pressed the correct key</p>", correct_text: "<p>You pressed the correct key</p>",
incorrect_text: "<p>Incorrect. You pressed the wrong key.</p>", incorrect_text: "<p>Incorrect. You pressed the wrong key.</p>",
prompt: "<p>Press D if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>", prompt: "<p>Press D if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>",
allow_response_before_complete: true, allow_response_before_complete: true,
render_on_canvas: false
}; };
jsPsych.init({ jsPsych.init({
@ -244,7 +254,8 @@ describe('categorize-animation plugin', function(){
feeback_duration: 500, feeback_duration: 500,
correct_text: "<p>You pressed the correct key</p>", correct_text: "<p>You pressed the correct key</p>",
incorrect_text: "<p>Incorrect. You pressed the wrong key.</p>", incorrect_text: "<p>Incorrect. You pressed the wrong key.</p>",
prompt: "<p>Press D if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>", prompt: "<p>Press D if the faces had different emotional expressions. Press S if the faces had the same emotional expression.</p>",
render_on_canvas: false
}; };
jsPsych.init({ jsPsych.init({

View File

@ -18,7 +18,8 @@ describe('image-button-response', function(){
var trial = { var trial = {
type: 'image-button-response', type: 'image-button-response',
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
choices: ['button-choice'] choices: ['button-choice'],
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -33,7 +34,8 @@ describe('image-button-response', function(){
var trial = { var trial = {
type: 'image-button-response', type: 'image-button-response',
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
choices: ['button-choice1', 'button-choice2'] choices: ['button-choice1', 'button-choice2'],
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -51,6 +53,7 @@ describe('image-button-response', function(){
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
choices: ['buttonChoice'], choices: ['buttonChoice'],
button_html: '<button class="jspsych-custom-button">%choice%</button>', button_html: '<button class="jspsych-custom-button">%choice%</button>',
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -65,7 +68,8 @@ describe('image-button-response', function(){
var trial = { var trial = {
type: 'image-button-response', type: 'image-button-response',
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
choices: ['button-choice'], choices: ['button-choice'],
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -85,7 +89,8 @@ describe('image-button-response', function(){
type: 'image-button-response', type: 'image-button-response',
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
choices: ['button-choice'], choices: ['button-choice'],
prompt: '<p>This is a prompt</p>' prompt: '<p>This is a prompt</p>',
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -101,7 +106,8 @@ describe('image-button-response', function(){
type: 'image-button-response', type: 'image-button-response',
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
choices: ['button-choice'], choices: ['button-choice'],
stimulus_duration: 500 stimulus_duration: 500,
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -119,7 +125,8 @@ describe('image-button-response', function(){
type: 'image-button-response', type: 'image-button-response',
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
choices: ['f','j'], choices: ['f','j'],
trial_duration: 500 trial_duration: 500,
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -138,6 +145,7 @@ describe('image-button-response', function(){
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
choices: ['button-choice'], choices: ['button-choice'],
response_ends_trial: true, response_ends_trial: true,
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -160,7 +168,8 @@ describe('image-button-response', function(){
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
choices: ['button-choice'], choices: ['button-choice'],
response_ends_trial: false, response_ends_trial: false,
trial_duration: null trial_duration: null,
render_on_canvas: false
}; };
jsPsych.init({ jsPsych.init({

View File

@ -17,7 +17,8 @@ describe('image-keyboard-response', function(){
test('displays image stimulus', function(){ test('displays image stimulus', function(){
var trial = { var trial = {
type: 'image-keyboard-response', type: 'image-keyboard-response',
stimulus: '../media/blue.png' stimulus: '../media/blue.png',
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -35,6 +36,7 @@ describe('image-keyboard-response', function(){
type: 'image-keyboard-response', type: 'image-keyboard-response',
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
choices: ['f','j'], choices: ['f','j'],
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -54,7 +56,8 @@ describe('image-keyboard-response', function(){
type: 'image-keyboard-response', type: 'image-keyboard-response',
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
choices: ['f','j'], choices: ['f','j'],
prompt: '<div id="foo">this is a prompt</div>' prompt: '<div id="foo">this is a prompt</div>',
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -72,6 +75,7 @@ describe('image-keyboard-response', function(){
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
choices:['f','j'], choices:['f','j'],
stimulus_duration: 500, stimulus_duration: 500,
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -91,7 +95,8 @@ describe('image-keyboard-response', function(){
type: 'image-keyboard-response', type: 'image-keyboard-response',
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
choices: ['f','j'], choices: ['f','j'],
trial_duration: 500 trial_duration: 500,
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -110,6 +115,7 @@ describe('image-keyboard-response', function(){
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
choices: ['f','j'], choices: ['f','j'],
response_ends_trial: true, response_ends_trial: true,
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -133,7 +139,8 @@ describe('image-keyboard-response', function(){
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
choices: ['f','j'], choices: ['f','j'],
response_ends_trial: false, response_ends_trial: false,
trial_duration: null trial_duration: null,
render_on_canvas: false
}; };
jsPsych.init({ jsPsych.init({

View File

@ -20,6 +20,7 @@ describe('image-slider-response', function(){
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
labels: ['left', 'right'], labels: ['left', 'right'],
button_label: 'button', button_label: 'button',
render_on_canvas: false,
on_load: function(){ on_load: function(){
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<div id="jspsych-image-slider-response-stimulus"><img src="../media/blue.png"'); expect(jsPsych.getDisplayElement().innerHTML).toMatch('<div id="jspsych-image-slider-response-stimulus"><img src="../media/blue.png"');
utils.clickTarget(document.querySelector('#jspsych-image-slider-response-next')); utils.clickTarget(document.querySelector('#jspsych-image-slider-response-next'));
@ -38,7 +39,8 @@ describe('image-slider-response', function(){
type: 'image-slider-response', type: 'image-slider-response',
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
labels: ['left', 'right'], labels: ['left', 'right'],
button_label: 'button' button_label: 'button',
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -57,7 +59,8 @@ describe('image-slider-response', function(){
type: 'image-slider-response', type: 'image-slider-response',
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
labels: ['left', 'right'], labels: ['left', 'right'],
button_label: 'button' button_label: 'button',
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -79,6 +82,7 @@ describe('image-slider-response', function(){
min: 2, min: 2,
max: 10, max: 10,
step: 2, step: 2,
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -99,7 +103,8 @@ describe('image-slider-response', function(){
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
labels: ['left', 'right'], labels: ['left', 'right'],
button_label: 'button', button_label: 'button',
prompt: '<p>This is a prompt</p>' prompt: '<p>This is a prompt</p>',
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -118,7 +123,8 @@ describe('image-slider-response', function(){
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
labels: ['left', 'right'], labels: ['left', 'right'],
button_label: 'button', button_label: 'button',
stimulus_duration: 500 stimulus_duration: 500,
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({
@ -138,7 +144,8 @@ describe('image-slider-response', function(){
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
labels: ['left', 'right'], labels: ['left', 'right'],
button_label: 'button', button_label: 'button',
trial_duration: 500 trial_duration: 500,
render_on_canvas: false
} }
@ -158,7 +165,8 @@ describe('image-slider-response', function(){
stimulus: '../media/blue.png', stimulus: '../media/blue.png',
labels: ['left', 'right'], labels: ['left', 'right'],
button_label: 'button', button_label: 'button',
response_ends_trial: true response_ends_trial: true,
render_on_canvas: false
} }
jsPsych.init({ jsPsych.init({