original_string: public function has_active_instances() {
          global $DB;
          if (empty($this->definition->id)) {
              return false;
          }
          if ($this->hasactiveinstances === null) {
              $conditions = array('definitionid'  => $this->definition->id,
                          'status'  => gradingform_instance::INSTANCE_STATUS_ACTIVE);
              $this->hasactiveinstances = $DB->record_exists('grading_instances', $conditions);
          }
          return $this->hasactiveinstances;
      }
code: public function has_active_instances() {
          global $DB;
          if (empty($this->definition->id)) {
              return false;
          }
          if ($this->hasactiveinstances === null) {
              $conditions = array('definitionid'  => $this->definition->id,
                          'status'  => gradingform_instance::INSTANCE_STATUS_ACTIVE);
              $this->hasactiveinstances = $DB->record_exists('grading_instances', $conditions);
          }
          return $this->hasactiveinstances;
      }
code_tokens: public function has_active_instances ( ) { global $ DB ; if ( empty ( $ this -> definition -> id ) ) { return false ; } if ( $ this -> hasactiveinstances === null ) { $ conditions = array ( 'definitionid' => $ this -> definition -> id , 'status' => gradingform_instance :: INSTANCE_STATUS_ACTIVE ) ; $ this -> hasactiveinstances = $ DB -> record_exists ( 'grading_instances' , $ conditions ) ; } return $ this -> hasactiveinstances ; }
docstring: Returns true if there are already people who has been graded on this definition.
  In this case plugins may restrict changes of the grading definition
  
  @return boolean
docstring_tokens: Returns true if there are already people who has been graded on this definition . In this case plugins may restrict changes of the grading definition