original_string: public static function delete_feedback_document($assignment, $userid, $attemptnumber) {
  
          $assignment = self::get_assignment_from_param($assignment);
  
          if (!$assignment->can_view_submission($userid)) {
              print_error('nopermission');
          }
          if (!$assignment->can_grade()) {
              print_error('nopermission');
          }
  
          $grade = $assignment->get_user_grade($userid, true, $attemptnumber);
  
          $contextid = $assignment->get_context()->id;
          $component = 'assignfeedback_editpdf';
          $filearea = self::FINAL_PDF_FILEAREA;
          $itemid = $grade->id;
  
          $fs = get_file_storage();
          return $fs->delete_area_files($contextid, $component, $filearea, $itemid);
      }
code: public static function delete_feedback_document($assignment, $userid, $attemptnumber) {
  
          $assignment = self::get_assignment_from_param($assignment);
  
          if (!$assignment->can_view_submission($userid)) {
              print_error('nopermission');
          }
          if (!$assignment->can_grade()) {
              print_error('nopermission');
          }
  
          $grade = $assignment->get_user_grade($userid, true, $attemptnumber);
  
          $contextid = $assignment->get_context()->id;
          $component = 'assignfeedback_editpdf';
          $filearea = self::FINAL_PDF_FILEAREA;
          $itemid = $grade->id;
  
          $fs = get_file_storage();
          return $fs->delete_area_files($contextid, $component, $filearea, $itemid);
      }
code_tokens: public static function delete_feedback_document ( $ assignment , $ userid , $ attemptnumber ) { $ assignment = self :: get_assignment_from_param ( $ assignment ) ; if ( ! $ assignment -> can_view_submission ( $ userid ) ) { print_error ( 'nopermission' ) ; } if ( ! $ assignment -> can_grade ( ) ) { print_error ( 'nopermission' ) ; } $ grade = $ assignment -> get_user_grade ( $ userid , true , $ attemptnumber ) ; $ contextid = $ assignment -> get_context ( ) -> id ; $ component = 'assignfeedback_editpdf' ; $ filearea = self :: FINAL_PDF_FILEAREA ; $ itemid = $ grade -> id ; $ fs = get_file_storage ( ) ; return $ fs -> delete_area_files ( $ contextid , $ component , $ filearea , $ itemid ) ; }
docstring: This function deletes the generated pdf for a student.
  @param int|\assign $assignment
  @param int $userid
  @param int $attemptnumber (-1 means latest attempt)
  @return bool
docstring_tokens: This function deletes the generated pdf for a student .