original_string: public function update_file_count($grade) {
          global $DB;
  
          $filefeedback = $this->get_file_feedback($grade->id);
          if ($filefeedback) {
              $filefeedback->numfiles = $this->count_files($grade->id, ASSIGNFEEDBACK_FILE_FILEAREA);
              return $DB->update_record('assignfeedback_file', $filefeedback);
          } else {
              $filefeedback = new stdClass();
              $filefeedback->numfiles = $this->count_files($grade->id, ASSIGNFEEDBACK_FILE_FILEAREA);
              $filefeedback->grade = $grade->id;
              $filefeedback->assignment = $this->assignment->get_instance()->id;
              return $DB->insert_record('assignfeedback_file', $filefeedback) > 0;
          }
      }
code: public function update_file_count($grade) {
          global $DB;
  
          $filefeedback = $this->get_file_feedback($grade->id);
          if ($filefeedback) {
              $filefeedback->numfiles = $this->count_files($grade->id, ASSIGNFEEDBACK_FILE_FILEAREA);
              return $DB->update_record('assignfeedback_file', $filefeedback);
          } else {
              $filefeedback = new stdClass();
              $filefeedback->numfiles = $this->count_files($grade->id, ASSIGNFEEDBACK_FILE_FILEAREA);
              $filefeedback->grade = $grade->id;
              $filefeedback->assignment = $this->assignment->get_instance()->id;
              return $DB->insert_record('assignfeedback_file', $filefeedback) > 0;
          }
      }
code_tokens: public function update_file_count ( $ grade ) { global $ DB ; $ filefeedback = $ this -> get_file_feedback ( $ grade -> id ) ; if ( $ filefeedback ) { $ filefeedback -> numfiles = $ this -> count_files ( $ grade -> id , ASSIGNFEEDBACK_FILE_FILEAREA ) ; return $ DB -> update_record ( 'assignfeedback_file' , $ filefeedback ) ; } else { $ filefeedback = new stdClass ( ) ; $ filefeedback -> numfiles = $ this -> count_files ( $ grade -> id , ASSIGNFEEDBACK_FILE_FILEAREA ) ; $ filefeedback -> grade = $ grade -> id ; $ filefeedback -> assignment = $ this -> assignment -> get_instance ( ) -> id ; return $ DB -> insert_record ( 'assignfeedback_file' , $ filefeedback ) > 0 ; } }
docstring: Update the number of files in the file area.
  
  @param stdClass $grade The grade record
  @return bool - true if the value was saved
docstring_tokens: Update the number of files in the file area .