Timeline variables #2393
-
Hello, I have a question about timeline variables. I would like to have two different types of trials in my timeline (e.g., Study and Test), and I would like to pull the relevant timelineVariable parameters based on the trial type. I can make both of my trials work separately, but I cannot run both. I guess I don't understand something fundamental about how timeline variables work. (I want to present these trials one after the other (e.g., Study - Test, Study-Test). In my code below, the study stimulus is defined by the function drawSus and the test stimuli by the drawCircS function. When it is a study trial, I want to get the radius and angle from the timeline variables, and when it is a test trial, I want to pull the radii and angles parameters. (Again, both of them work when only one type of trial is included in the timeline, so no bugs there.) Any hints would be much appreciated. Thank you! var trial0 = {
timeline: [
{
type: jsPsychCanvasButtonResponse,
stimulus: function(c){
drawSus(c, jsPsych.timelineVariable('radius'), jsPsych.timelineVariable('angle'));
},
trial_duration: 2000,
post_trial_gap: 750,
choices:[]
},
{
type: jsPsychCanvasButtonResponse,
stimulus: function(c){
drawCircS(c, jsPsych.timelineVariable('radii'), jsPsych.timelineVariable('angles'));
},
trial_duration: 2000,
post_trial_gap: 750,
choices:['1','2','3']
}
],
timeline_variables: [
{radius: suspects.sizes[0], angle: suspects.angles[0]},
{radius: suspects.sizes[1], angle: suspects.angles[1]},
{radii: test_trials.sizes[0], angles: test_trials.angles[0]}
{radii: test_trials.sizes[1], angles: test_trials.angles[1]}
]
}; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Nvm. I see what was wrong about the code above. I should have included parameters for both trial types, all in one object. {radius: suspects.sizes[0], angle: suspects.angles[0], radii: test_trials.sizes[0], angles: test_trials.angles[0] },
{radius: suspects.sizes[1], angle: suspects.angles[1], radii: test_trials.sizes[1], angles: test_trials.angles[1] } |
Beta Was this translation helpful? Give feedback.
Nvm. I see what was wrong about the code above. I should have included parameters for both trial types, all in one object.