original_string: public function delete_all_grades($source=null) {
          if (!$this->is_course_item()) {
              $this->force_regrading();
          }
  
          if ($grades = grade_grade::fetch_all(array('itemid'=>$this->id))) {
              foreach ($grades as $grade) {
                  $grade->delete($source);
              }
          }
  
          // Delete all the historical files.
          // We only support feedback files for modules atm.
          if ($this->is_external_item()) {
              $fs = new file_storage();
              $fs->delete_area_files($this->get_context()->id, GRADE_FILE_COMPONENT, GRADE_HISTORY_FEEDBACK_FILEAREA);
          }
  
          return true;
      }
code: public function delete_all_grades($source=null) {
          if (!$this->is_course_item()) {
              $this->force_regrading();
          }
  
          if ($grades = grade_grade::fetch_all(array('itemid'=>$this->id))) {
              foreach ($grades as $grade) {
                  $grade->delete($source);
              }
          }
  
          // Delete all the historical files.
          // We only support feedback files for modules atm.
          if ($this->is_external_item()) {
              $fs = new file_storage();
              $fs->delete_area_files($this->get_context()->id, GRADE_FILE_COMPONENT, GRADE_HISTORY_FEEDBACK_FILEAREA);
          }
  
          return true;
      }
code_tokens: public function delete_all_grades ( $ source = null ) { if ( ! $ this -> is_course_item ( ) ) { $ this -> force_regrading ( ) ; } if ( $ grades = grade_grade :: fetch_all ( array ( 'itemid' => $ this -> id ) ) ) { foreach ( $ grades as $ grade ) { $ grade -> delete ( $ source ) ; } } // Delete all the historical files. // We only support feedback files for modules atm. if ( $ this -> is_external_item ( ) ) { $ fs = new file_storage ( ) ; $ fs -> delete_area_files ( $ this -> get_context ( ) -> id , GRADE_FILE_COMPONENT , GRADE_HISTORY_FEEDBACK_FILEAREA ) ; } return true ; }
docstring: Delete all grades
  
  @param string $source from where was the object deleted (mod/forum, manual, etc.)
  @return bool
docstring_tokens: Delete all grades