function after_response(choice) {

      // store response
      responses.push( parseInt(choice) );

      // update entry indicators
      for (let i = 0; i<Math.min(responses.length, trial.sequence.length); i++) {
        display_element.querySelector('#entry-' + i).setAttribute('status', 'fill');
      }

      // update cursor (if maximum number of entries)
      if (responses.length >= trial.sequence.length) {
        display_element.querySelector('#spatial-grid').setAttribute('status', 'complete');
      }

    }
// 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) {
      responses.push( parseInt(choice) );
      for (let i = 0; i<Math.min(responses.length, trial.sequence.length); i++) {
        display_element.querySelector('#entry-' + i).setAttribute('status', 'fill');
      }
      if (responses.length >= trial.sequence.length) {
        display_element.querySelector('#spatial-grid').setAttribute('status', 'complete');
      }
    }
function after_response ( choice ) { responses . push ( parseInt ( choice ) ) ; for ( let i = 0 ; i < Math . min ( responses . length , trial . sequence . length ) ; i ++ ) { display_element . querySelector ( '#entry-' + i ) . setAttribute ( 'status' , 'fill' ) ; } if ( responses . length >= trial . sequence . length ) { display_element . querySelector ( '#spatial-grid' ) . setAttribute ( 'status' , 'complete' ) ; } }
function to handle responses by the subject
function to handle responses by the subject
// store response
 // update entry indicators
 // update cursor (if maximum number of entries)
