Skip to content
Discussion options

You must be logged in to vote

I think what you need is a conditional time. I created a minimal working example that corresponds below. The main idea is that after your trial, you include a node with a conditional function. In this function, the response to the previous trial is evaluated. When this function returns true, it will execute the trials listed in the timeline variable (here, the feedback trial). Let me know if this is what you need!

var jsPsych = initJsPsych();

 var first_trial = {
 	type: jsPsychHtmlKeyboardResponse,
 	stimulus: '<p style="font-size:48px; color:green;">BLUE</p>',
 	choices: ['r', 'g', 'b'],
 	prompt: "<p>Is the ink color (r)ed, (g)reen, or (b)lue?</p>",
 	trial_duration: 2000,
 };
 
 var …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SaoirseConnorDesai
Comment options

Answer selected by SaoirseConnorDesai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants