code typo on jspsych-canvas-button-response page
See original GitHub issueHi gang!
Just wanted to report a typo in the example code on the jspsych-canvas-button-response webpage.
The example code works well there’s just a comma missing at prompt: <p>What color is the circle?</p>
Current code:
function filledCirc(canvas, radius, color){
var ctx = canvas.getContext("2d");
ctx.beginPath();
ctx.arc(250, 250, radius, 0, 2 * Math.PI);
ctx.fillStyle = color;
ctx.fill()
}
var circle_1 = {
type: 'canvas-button-response',
stimulus: function (c) {
filledCirc(c, 100, 'blue');
},
choices: ['Red', 'Green', 'Blue'],
prompt: '<p>What color is the circle?</p>'
data: {color: 'blue', radius: 100}
};
var circle_2 = {
type: 'canvas-button-response',
stimulus: function (c) {
filledCirc(c, 150, 'green');
},
choices: ['Larger', 'Smaller'],
prompt: '<p>Is this circle larger or smaller than the last one?</p>',
data: {color: 'green', radius: 150}
};
Fixed code:
function filledCirc(canvas, radius, color){
var ctx = canvas.getContext("2d");
ctx.beginPath();
ctx.arc(250, 250, radius, 0, 2 * Math.PI);
ctx.fillStyle = color;
ctx.fill()
}
var circle_1 = {
type: 'canvas-button-response',
stimulus: function (c) {
filledCirc(c, 100, 'blue');
},
choices: ['Red', 'Green', 'Blue'],
prompt: '<p>What color is the circle?</p>',
data: {color: 'blue', radius: 100}
};
var circle_2 = {
type: 'canvas-button-response',
stimulus: function (c) {
filledCirc(c, 150, 'green');
},
choices: ['Larger', 'Smaller'],
prompt: '<p>Is this circle larger or smaller than the last one?</p>',
data: {color: 'green', radius: 150}
};
Thanks!
Nathalie
Note: I put this issue in the wrong place, I had it on the discussion board as discussion #1839!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
jspsych-canvas-button-response
This plugin can be used to draw a stimulus on a HTML canvas element, and record a button click response and response time....
Read more >canvas-keyboard-response - jsPsych
This plugin can be used to draw a stimulus on a HTML canvas element and record a keyboard response. The canvas stimulus can...
Read more >jspsych-html-button-response
This plugin displays HTML content and records responses generated by button click. The stimulus can be displayed until a response is given, ...
Read more >html-keyboard-response - jsPsych
This plugin displays HTML content and records responses generated with the keyboard.The stimulus can be displayed until a response is given, ...
Read more >Controlling Visual Appearance - jsPsych
It might also depend on whether you want the style/formatting change(s) to apply to specific trials, to the whole experiment (HTML page), ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This fix should be on the live website now. Thanks again @LMD-nat!
Fixed! Thanks again 😃