original_string: public function grading_evaluation_instance() {
          global $CFG;    // because we require other libs here
  
          if (is_null($this->evaluationinstance)) {
              if (empty($this->evaluation)) {
                  $this->evaluation = 'best';
              }
              $evaluationlib = __DIR__ . '/eval/' . $this->evaluation . '/lib.php';
              if (is_readable($evaluationlib)) {
                  require_once($evaluationlib);
              } else {
                  // Fall back in case the subplugin is not available.
                  $this->evaluation = 'best';
                  $evaluationlib = __DIR__ . '/eval/' . $this->evaluation . '/lib.php';
                  if (is_readable($evaluationlib)) {
                      require_once($evaluationlib);
                  } else {
                      // Fall back in case the subplugin is not available any more.
                      throw new coding_exception('Missing default grading evaluation library ' . $evaluationlib);
                  }
              }
              $classname = 'workshop_' . $this->evaluation . '_evaluation';
              $this->evaluationinstance = new $classname($this);
              if (!in_array('workshop_evaluation', class_parents($this->evaluationinstance))) {
                  throw new coding_exception($classname . ' does not extend workshop_evaluation class');
              }
          }
          return $this->evaluationinstance;
      }
code: public function grading_evaluation_instance() {
          global $CFG;    // because we require other libs here
  
          if (is_null($this->evaluationinstance)) {
              if (empty($this->evaluation)) {
                  $this->evaluation = 'best';
              }
              $evaluationlib = __DIR__ . '/eval/' . $this->evaluation . '/lib.php';
              if (is_readable($evaluationlib)) {
                  require_once($evaluationlib);
              } else {
                  // Fall back in case the subplugin is not available.
                  $this->evaluation = 'best';
                  $evaluationlib = __DIR__ . '/eval/' . $this->evaluation . '/lib.php';
                  if (is_readable($evaluationlib)) {
                      require_once($evaluationlib);
                  } else {
                      // Fall back in case the subplugin is not available any more.
                      throw new coding_exception('Missing default grading evaluation library ' . $evaluationlib);
                  }
              }
              $classname = 'workshop_' . $this->evaluation . '_evaluation';
              $this->evaluationinstance = new $classname($this);
              if (!in_array('workshop_evaluation', class_parents($this->evaluationinstance))) {
                  throw new coding_exception($classname . ' does not extend workshop_evaluation class');
              }
          }
          return $this->evaluationinstance;
      }
code_tokens: public function grading_evaluation_instance ( ) { global $ CFG ; // because we require other libs here if ( is_null ( $ this -> evaluationinstance ) ) { if ( empty ( $ this -> evaluation ) ) { $ this -> evaluation = 'best' ; } $ evaluationlib = __DIR__ . '/eval/' . $ this -> evaluation . '/lib.php' ; if ( is_readable ( $ evaluationlib ) ) { require_once ( $ evaluationlib ) ; } else { // Fall back in case the subplugin is not available. $ this -> evaluation = 'best' ; $ evaluationlib = __DIR__ . '/eval/' . $ this -> evaluation . '/lib.php' ; if ( is_readable ( $ evaluationlib ) ) { require_once ( $ evaluationlib ) ; } else { // Fall back in case the subplugin is not available any more. throw new coding_exception ( 'Missing default grading evaluation library ' . $ evaluationlib ) ; } } $ classname = 'workshop_' . $ this -> evaluation . '_evaluation' ; $ this -> evaluationinstance = new $ classname ( $ this ) ; if ( ! in_array ( 'workshop_evaluation' , class_parents ( $ this -> evaluationinstance ) ) ) { throw new coding_exception ( $ classname . ' does not extend workshop_evaluation class' ) ; } } return $ this -> evaluationinstance ; }
docstring: Returns instance of grading evaluation class
  
  @return stdclass Instance of a grading evaluation
docstring_tokens: Returns instance of grading evaluation class