original_string: public function get_grade_item() {
          if ($this->gradeitem) {
              return $this->gradeitem;
          }
          $instance = $this->get_instance();
          $params = array('itemtype' => 'mod',
                          'itemmodule' => 'assign',
                          'iteminstance' => $instance->id,
                          'courseid' => $instance->course,
                          'itemnumber' => 0);
          $this->gradeitem = grade_item::fetch($params);
          if (!$this->gradeitem) {
              throw new coding_exception('Improper use of the assignment class. ' .
                                         'Cannot load the grade item.');
          }
          return $this->gradeitem;
      }
code: public function get_grade_item() {
          if ($this->gradeitem) {
              return $this->gradeitem;
          }
          $instance = $this->get_instance();
          $params = array('itemtype' => 'mod',
                          'itemmodule' => 'assign',
                          'iteminstance' => $instance->id,
                          'courseid' => $instance->course,
                          'itemnumber' => 0);
          $this->gradeitem = grade_item::fetch($params);
          if (!$this->gradeitem) {
              throw new coding_exception('Improper use of the assignment class. ' .
                                         'Cannot load the grade item.');
          }
          return $this->gradeitem;
      }
code_tokens: public function get_grade_item ( ) { if ( $ this -> gradeitem ) { return $ this -> gradeitem ; } $ instance = $ this -> get_instance ( ) ; $ params = array ( 'itemtype' => 'mod' , 'itemmodule' => 'assign' , 'iteminstance' => $ instance -> id , 'courseid' => $ instance -> course , 'itemnumber' => 0 ) ; $ this -> gradeitem = grade_item :: fetch ( $ params ) ; if ( ! $ this -> gradeitem ) { throw new coding_exception ( 'Improper use of the assignment class. ' . 'Cannot load the grade item.' ) ; } return $ this -> gradeitem ; }
docstring: Get the primary grade item for this assign instance.
  
  @return grade_item The grade_item record
docstring_tokens: Get the primary grade item for this assign instance .