Skip to content
Discussion options

You must be logged in to vote

Hi @ClaraKuper, not sure if this is the best solution, but I think it works:

  var timeline_variables = [
    {ID: 'trial 1'},
    {ID: 'trial 2'},
    {ID: 'trial 3'}
  ];

  var repeat_IDs = []; // holds list of IDs to repeat on the next round

  var first_set = true; // whether or not this is the first presentation of trials

  var trial = {
    type: 'html-keyboard-response',
    stimulus: jsPsych.timelineVariable('ID'),
    choices: jsPsych.ALL_KEYS,
    trial_duration: 2000,
    on_finish: function (data) {
      if (data.response == null) {
        if (!repeat_IDs.includes(jsPsych.timelineVariable('ID'))) {
          repeat_IDs.push(jsPsych.timelineVariable('ID'));
        }
      } 

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ClaraKuper
Comment options

@becky-gilbert
Comment options

@ClaraKuper
Comment options

@becky-gilbert
Comment options

Answer selected by ClaraKuper
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