function DrawScreen() {

      // if the left stimulus is selected, show the appropriate selection box
      if (display.left_box == "selected"){
        _DrawSelectionBox(-trial.stimulus_offset[0], trial.stimulus_offset[1], trial.selection_colour);
      } else if (display.left_box == "reward"){
        var feedback_image = trial.feedback_images[1]
        _DrawSelectionBox(-trial.stimulus_offset[0], trial.stimulus_offset[1], trial.reward_colour);
        _DrawFeedback(feedback_image);
      } else if (display.left_box == "non-reward"){
        var feedback_image = trial.feedback_images[0]
        _DrawSelectionBox(-trial.stimulus_offset[0], trial.stimulus_offset[1], trial.non_reward_colour);
        _DrawFeedback(feedback_image);
      }

      // draw the left stimulus
      if (display.left_stimulus !== null){
        _DrawStimulus(display.left_stimulus, [-trial.stimulus_offset[0], trial.stimulus_offset[1]]);
      } else{
        _DrawBlankStimulus([-trial.stimulus_offset[0], trial.stimulus_offset[1]]);
      }

      // if the right stimulus is selected, show the appropriate selection box
      if (display.right_box == "selected"){
        _DrawSelectionBox(trial.stimulus_offset[0], trial.stimulus_offset[1], trial.selection_colour);
      } else if (display.right_box == "reward"){
        var feedback_image = trial.feedback_images[1]
        _DrawSelectionBox(trial.stimulus_offset[0], trial.stimulus_offset[1], trial.reward_colour);
        _DrawFeedback(feedback_image);
      } else if (display.right_box == "non-reward"){
        var feedback_image = trial.feedback_images[0]
        _DrawSelectionBox(trial.stimulus_offset[0], trial.stimulus_offset[1], trial.non_reward_colour);
        _DrawFeedback(feedback_image);
      }

      // draw the right stimulus
      if (display.right_stimulus !== null){
        _DrawStimulus(display.right_stimulus, [trial.stimulus_offset[0], trial.stimulus_offset[1]]);
      } else{
        _DrawBlankStimulus([trial.stimulus_offset[0], trial.stimulus_offset[1]]);
      }

    }
// function to draw the stimuli to screen flexibly
function to draw the stimuli to screen flexibly
function to draw the stimuli to screen flexibly
function DrawScreen() {
      if (display.left_box == "selected"){
        _DrawSelectionBox(-trial.stimulus_offset[0], trial.stimulus_offset[1], trial.selection_colour);
      } else if (display.left_box == "reward"){
        var feedback_image = trial.feedback_images[1]
        _DrawSelectionBox(-trial.stimulus_offset[0], trial.stimulus_offset[1], trial.reward_colour);
        _DrawFeedback(feedback_image);
      } else if (display.left_box == "non-reward"){
        var feedback_image = trial.feedback_images[0]
        _DrawSelectionBox(-trial.stimulus_offset[0], trial.stimulus_offset[1], trial.non_reward_colour);
        _DrawFeedback(feedback_image);
      }
      if (display.left_stimulus !== null){
        _DrawStimulus(display.left_stimulus, [-trial.stimulus_offset[0], trial.stimulus_offset[1]]);
      } else{
        _DrawBlankStimulus([-trial.stimulus_offset[0], trial.stimulus_offset[1]]);
      }
      if (display.right_box == "selected"){
        _DrawSelectionBox(trial.stimulus_offset[0], trial.stimulus_offset[1], trial.selection_colour);
      } else if (display.right_box == "reward"){
        var feedback_image = trial.feedback_images[1]
        _DrawSelectionBox(trial.stimulus_offset[0], trial.stimulus_offset[1], trial.reward_colour);
        _DrawFeedback(feedback_image);
      } else if (display.right_box == "non-reward"){
        var feedback_image = trial.feedback_images[0]
        _DrawSelectionBox(trial.stimulus_offset[0], trial.stimulus_offset[1], trial.non_reward_colour);
        _DrawFeedback(feedback_image);
      }
      if (display.right_stimulus !== null){
        _DrawStimulus(display.right_stimulus, [trial.stimulus_offset[0], trial.stimulus_offset[1]]);
      } else{
        _DrawBlankStimulus([trial.stimulus_offset[0], trial.stimulus_offset[1]]);
      }
    }
function DrawScreen ( ) { if ( display . left_box == "selected" ) { _DrawSelectionBox ( - trial . stimulus_offset [ 0 ] , trial . stimulus_offset [ 1 ] , trial . selection_colour ) ; } else if ( display . left_box == "reward" ) { var feedback_image = trial . feedback_images [ 1 ] _DrawSelectionBox ( - trial . stimulus_offset [ 0 ] , trial . stimulus_offset [ 1 ] , trial . reward_colour ) ; _DrawFeedback ( feedback_image ) ; } else if ( display . left_box == "non-reward" ) { var feedback_image = trial . feedback_images [ 0 ] _DrawSelectionBox ( - trial . stimulus_offset [ 0 ] , trial . stimulus_offset [ 1 ] , trial . non_reward_colour ) ; _DrawFeedback ( feedback_image ) ; } if ( display . left_stimulus !== null ) { _DrawStimulus ( display . left_stimulus , [ - trial . stimulus_offset [ 0 ] , trial . stimulus_offset [ 1 ] ] ) ; } else { _DrawBlankStimulus ( [ - trial . stimulus_offset [ 0 ] , trial . stimulus_offset [ 1 ] ] ) ; } if ( display . right_box == "selected" ) { _DrawSelectionBox ( trial . stimulus_offset [ 0 ] , trial . stimulus_offset [ 1 ] , trial . selection_colour ) ; } else if ( display . right_box == "reward" ) { var feedback_image = trial . feedback_images [ 1 ] _DrawSelectionBox ( trial . stimulus_offset [ 0 ] , trial . stimulus_offset [ 1 ] , trial . reward_colour ) ; _DrawFeedback ( feedback_image ) ; } else if ( display . right_box == "non-reward" ) { var feedback_image = trial . feedback_images [ 0 ] _DrawSelectionBox ( trial . stimulus_offset [ 0 ] , trial . stimulus_offset [ 1 ] , trial . non_reward_colour ) ; _DrawFeedback ( feedback_image ) ; } if ( display . right_stimulus !== null ) { _DrawStimulus ( display . right_stimulus , [ trial . stimulus_offset [ 0 ] , trial . stimulus_offset [ 1 ] ] ) ; } else { _DrawBlankStimulus ( [ trial . stimulus_offset [ 0 ] , trial . stimulus_offset [ 1 ] ] ) ; } }
function to draw the stimuli to screen flexibly
function to draw the stimuli to screen flexibly
// if the left stimulus is selected, show the appropriate selection box // draw the left stimulus // if the right stimulus is selected, show the appropriate selection box // draw the right stimulus