mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
remove uncessary true argument from jsPsych.timelineVariable in examples/tests #883
This commit is contained in:
parent
a496871984
commit
5c653f4bde
@ -67,12 +67,12 @@
|
||||
};
|
||||
|
||||
// to use the canvas stimulus function with timeline variables,
|
||||
// use the jsPsych.timelineVariable() function inside your stimulus function with the second 'true' argument
|
||||
// the jsPsych.timelineVariable() function can be used inside your stimulus function
|
||||
var circle_procedure = {
|
||||
timeline: [{
|
||||
type: 'canvas-button-response',
|
||||
stimulus: function(c) {
|
||||
filledCirc(c, jsPsych.timelineVariable('radius', true), jsPsych.timelineVariable('color', true));
|
||||
filledCirc(c, jsPsych.timelineVariable('radius'), jsPsych.timelineVariable('color'));
|
||||
},
|
||||
choices: ['Red', 'Green', 'Blue'],
|
||||
prompt: '<p>What color is the circle?</p>',
|
||||
|
@ -41,19 +41,19 @@
|
||||
}
|
||||
|
||||
// to use the canvas stimulus function with timeline variables,
|
||||
// use the jsPsych.timelineVariable() function inside your stimulus function with the second 'true' argument
|
||||
// the jsPsych.timelineVariable() function can be used inside your stimulus function
|
||||
var trial_procedure = {
|
||||
timeline: [{
|
||||
type: 'canvas-keyboard-response',
|
||||
stimulus: function(c) {
|
||||
var ctx = c.getContext('2d');
|
||||
ctx.beginPath();
|
||||
ctx.fillStyle = jsPsych.timelineVariable('color', true);
|
||||
ctx.fillStyle = jsPsych.timelineVariable('color');
|
||||
ctx.fillRect(
|
||||
jsPsych.timelineVariable('upper_left_x', true),
|
||||
jsPsych.timelineVariable('upper_left_y', true),
|
||||
jsPsych.timelineVariable('width', true),
|
||||
jsPsych.timelineVariable('height', true)
|
||||
jsPsych.timelineVariable('upper_left_x'),
|
||||
jsPsych.timelineVariable('upper_left_y'),
|
||||
jsPsych.timelineVariable('width'),
|
||||
jsPsych.timelineVariable('height')
|
||||
);
|
||||
ctx.stroke();
|
||||
},
|
||||
|
@ -79,7 +79,7 @@
|
||||
},
|
||||
{
|
||||
type: 'html-keyboard-response',
|
||||
stimulus: function(){ return "<p class='stimulus'>"+jsPsych.timelineVariable('word', true)+"</p>"; },
|
||||
stimulus: function(){ return "<p class='stimulus'>"+jsPsych.timelineVariable('word')+"</p>"; },
|
||||
choices: ['y','n'],
|
||||
post_trial_gap: 0,
|
||||
data: {
|
||||
|
@ -125,7 +125,7 @@ describe('loop function', function(){
|
||||
stimulus: 'foo'
|
||||
}],
|
||||
loop_function: function(){
|
||||
if(jsPsych.timelineVariable('word', true) == 'b' && counter < 2){
|
||||
if(jsPsych.timelineVariable('word') == 'b' && counter < 2){
|
||||
counter++;
|
||||
return true;
|
||||
} else {
|
||||
@ -283,7 +283,7 @@ describe('conditional function', function(){
|
||||
var innertimeline = {
|
||||
timeline: [trial],
|
||||
conditional_function: function(){
|
||||
if(jsPsych.timelineVariable('word', true) == 'b'){
|
||||
if(jsPsych.timelineVariable('word') == 'b'){
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user