after_response = function(info) {

      //console.log('fire');

      var key_i = (typeof trial.key_increase == 'string') ? jsPsych.pluginAPI.convertKeyCharacterToKeyCode(trial.key_increase) : trial.key_increase;
      var key_d = (typeof trial.key_decrease == 'string') ? jsPsych.pluginAPI.convertKeyCharacterToKeyCode(trial.key_decrease) : trial.key_decrease;

      // get new param value
      if (info.key == key_i) {
        param = param + trial.step_size;
      } else if (info.key == key_d) {
        param = param - trial.step_size;
      }
      param = Math.max(Math.min(1, param), 0);

      // refresh the display
      draw(param);
    }
jspsych-reconstruction
a jspsych plugin for a reconstruction task where the subject recreates
a stimulus from memory

Josh de Leeuw

documentation: docs.jspsych.org