function after_response(choice) {

      // kill any remaining setTimeout handlers
      jsPsych.pluginAPI.clearAllTimeouts();

      // measure response time
      var end_time = performance.now();
      var rt = end_time - start_time;

      // store responses.
      response.rt = rt;
      response.choice = parseInt(choice);
      response.accuracy = (trial.correct == response.choice) ? 1 : 0;

      // end trial
      end_trial();

    }
// 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) {
      jsPsych.pluginAPI.clearAllTimeouts();
      var end_time = performance.now();
      var rt = end_time - start_time;
      response.rt = rt;
      response.choice = parseInt(choice);
      response.accuracy = (trial.correct == response.choice) ? 1 : 0;
      end_trial();
    }
function after_response ( choice ) { jsPsych . pluginAPI . clearAllTimeouts ( ) ; var end_time = performance . now ( ) ; var rt = end_time - start_time ; response . rt = rt ; response . choice = parseInt ( choice ) ; response . accuracy = ( trial . correct == response . choice ) ? 1 : 0 ; end_trial ( ) ; }
function to handle responses by the subject
function to handle responses by the subject
// kill any remaining setTimeout handlers
 // measure response time
 // store responses.
 // end trial
