original_string: public function display_instances($instances, $defaultcontent, $cangrade) {
          $return = '';
          if (sizeof($instances)) {
              $return .= html_writer::start_tag('div', array('class' => 'advancedgrade'));
              $idx = 0;
              foreach ($instances as $instance) {
                  $return .= $this->display_instance($instance, $idx++, $cangrade);
              }
              $return .= html_writer::end_tag('div');
          }
          return $return. $defaultcontent;
      }
code: public function display_instances($instances, $defaultcontent, $cangrade) {
          $return = '';
          if (sizeof($instances)) {
              $return .= html_writer::start_tag('div', array('class' => 'advancedgrade'));
              $idx = 0;
              foreach ($instances as $instance) {
                  $return .= $this->display_instance($instance, $idx++, $cangrade);
              }
              $return .= html_writer::end_tag('div');
          }
          return $return. $defaultcontent;
      }
code_tokens: public function display_instances ( $ instances , $ defaultcontent , $ cangrade ) { $ return = '' ; if ( sizeof ( $ instances ) ) { $ return .= html_writer :: start_tag ( 'div' , array ( 'class' => 'advancedgrade' ) ) ; $ idx = 0 ; foreach ( $ instances as $ instance ) { $ return .= $ this -> display_instance ( $ instance , $ idx ++ , $ cangrade ) ; } $ return .= html_writer :: end_tag ( 'div' ) ; } return $ return . $ defaultcontent ; }
docstring: Displays for the student the list of instances or default content if no instances found
  
  @param array $instances array of objects of type gradingform_rubric_instance
  @param string $defaultcontent default string that would be displayed without advanced grading
  @param boolean $cangrade whether current user has capability to grade in this context
  @return string
docstring_tokens: Displays for the student the list of instances or default content if no instances found