jspsych/plugins/jspsych-video-button-response.js
// function to handle responses by the subject

function to handle responses by the subject
function to handle responses by the subject
function after_response(choice) {
      var end_time = performance.now();
      var rt = end_time - start_time;
      response.button = choice;
      response.rt = rt;
      display_element.querySelector('#jspsych-video-button-response-stimulus').className += ' responded';
      var btns = document.querySelectorAll('.jspsych-video-button-response-button button');
      for(var i=0; i<btns.length; i++){
        btns[i].setAttribute('disabled', 'disabled');
      }
      if (trial.response_ends_trial) {
        end_trial();
      }
    }
function after_response ( choice ) { var end_time = performance . now ( ) ; var rt = end_time - start_time ; response . button = choice ; response . rt = rt ; display_element . querySelector ( '#jspsych-video-button-response-stimulus' ) . className += ' responded' ; var btns = document . querySelectorAll ( '.jspsych-video-button-response-button button' ) ; for ( var i = 0 ; i < btns . length ; i ++ ) { btns [ i ] . setAttribute ( 'disabled' , 'disabled' ) ; } if ( trial . response_ends_trial ) { end_trial ( ) ; } }
function to handle responses by the subject
function to handle responses by the subject
// measure rt
 // after a valid response, the stimulus will have the CSS class 'responded'
 // which can be used to provide visual feedback that a response was recorded
 // disable all the buttons after a response
 //btns[i].removeEventListener('click');
