Skip to content

Add trial to timeline at the current position in timeline #1257

Answered by kschuler
nrschoen asked this question in Q&A
Discussion options

You must be logged in to vote

Yes! You can do this, and you don't need to splice the timeline. I'm adapting the face_name_procedure from the docs, in the timeline variable section: https://www.jspsych.org/overview/timeline/#timeline-variables.

Here we are going to see 4 "trials", each one a different face. On each of these trials, the subjects sees a fixation cross '+' for 500ms and then sees the face for 2500ms.

var face_name_procedure = {
    timeline: [
        {
            type: 'html-keyboard-response',
            stimulus: '+',
            choices: jsPsych.NO_KEYS,
            trial_duration: 500
        },
        {
            type: 'image-keyboard-response',
            stimulus: jsPsych.timelineVariable('f…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@nrschoen
Comment options

@becky-gilbert
Comment options

@nrschoen
Comment options

Answer selected by nrschoen
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants