original_string: public static function copy_pages_to_readonly_area($assignment, $grade) {
          $fs = get_file_storage();
          $assignment = self::get_assignment_from_param($assignment);
          $contextid = $assignment->get_context()->id;
          $component = 'assignfeedback_editpdf';
          $itemid = $grade->id;
  
          // Get all the pages.
          $originalfiles = $fs->get_area_files($contextid, $component, self::PAGE_IMAGE_FILEAREA, $itemid);
          if (empty($originalfiles)) {
              // Nothing to do here...
              return;
          }
  
          // Delete the old readonly files.
          $fs->delete_area_files($contextid, $component, self::PAGE_IMAGE_READONLY_FILEAREA, $itemid);
  
          // Do the copying.
          foreach ($originalfiles as $originalfile) {
              $fs->create_file_from_storedfile(array('filearea' => self::PAGE_IMAGE_READONLY_FILEAREA), $originalfile);
          }
      }
code: public static function copy_pages_to_readonly_area($assignment, $grade) {
          $fs = get_file_storage();
          $assignment = self::get_assignment_from_param($assignment);
          $contextid = $assignment->get_context()->id;
          $component = 'assignfeedback_editpdf';
          $itemid = $grade->id;
  
          // Get all the pages.
          $originalfiles = $fs->get_area_files($contextid, $component, self::PAGE_IMAGE_FILEAREA, $itemid);
          if (empty($originalfiles)) {
              // Nothing to do here...
              return;
          }
  
          // Delete the old readonly files.
          $fs->delete_area_files($contextid, $component, self::PAGE_IMAGE_READONLY_FILEAREA, $itemid);
  
          // Do the copying.
          foreach ($originalfiles as $originalfile) {
              $fs->create_file_from_storedfile(array('filearea' => self::PAGE_IMAGE_READONLY_FILEAREA), $originalfile);
          }
      }
code_tokens: public static function copy_pages_to_readonly_area ( $ assignment , $ grade ) { $ fs = get_file_storage ( ) ; $ assignment = self :: get_assignment_from_param ( $ assignment ) ; $ contextid = $ assignment -> get_context ( ) -> id ; $ component = 'assignfeedback_editpdf' ; $ itemid = $ grade -> id ; // Get all the pages. $ originalfiles = $ fs -> get_area_files ( $ contextid , $ component , self :: PAGE_IMAGE_FILEAREA , $ itemid ) ; if ( empty ( $ originalfiles ) ) { // Nothing to do here... return ; } // Delete the old readonly files. $ fs -> delete_area_files ( $ contextid , $ component , self :: PAGE_IMAGE_READONLY_FILEAREA , $ itemid ) ; // Do the copying. foreach ( $ originalfiles as $ originalfile ) { $ fs -> create_file_from_storedfile ( array ( 'filearea' => self :: PAGE_IMAGE_READONLY_FILEAREA ) , $ originalfile ) ; } }
docstring: Copy the pages image to the readonly area.
  
  @param int|\assign $assignment The assignment.
  @param \stdClass $grade The grade record.
  @return void
docstring_tokens: Copy the pages image to the readonly area .