Skip to content
Discussion options

You must be logged in to vote

You could set up a looping timeline with the audio-button-response plugin so that whenever a repeat button is clicked the trial loops and the audio plays again.

This code is edited to reflect the bug that @Marita-K-Everhardt caught below!

var repeat = {
  timeline: [{
    type: 'audio-button-response',
    stimulus: 'sound.mp3',
    choices: ['Play Again', 'Continue'],
  }],
  loop_function: function(data){
    if(data.values[0].button_pressed == 0){
      return true; // loop again!
    } else {
      return false; // continue
    }
  }
}

Replies: 1 comment 4 replies

Comment options

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

@ghost
Comment options

@EceKayaMPI
Comment options

@jodeleeuw
Comment options

Answer selected by jodeleeuw
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
Converted from issue

This discussion was converted from issue #595 on May 11, 2020 21:05.