Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [Versions 401 and 403]

This file contains the combined document class for the assignfeedback_editpdf plugin.

Copyright: 2017 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 446 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: combined_document  - X-Ref

The combined_document class for the assignfeedback_editpdf plugin.

get_status()   X-Ref
Check the current status of the document combination.
Note that the combined document may not contain all the source files if some of the
source files were not able to be converted. An example is an audio file with a pdf cover sheet. Only
the cover sheet will be included in the combined document.

return: int

set_combined_file($file)   X-Ref
Set the completed combined file.

param: stored_file $file The completed document for all files to be combined.
return: $this

is_partial_conversion()   X-Ref
Return true of the combined file contained only some of the submission files.

return: boolean

get_combined_file()   X-Ref
Retrieve the completed combined file.

return: stored_file

set_source_files($files)   X-Ref
Set all source files which are to be combined.

param: stored_file|conversion[] $files The complete list of all source files to be combined.
return: $this

add_source_file($file)   X-Ref
Add an additional source file to the end of the existing list.

param: stored_file|conversion $file The file to add to the end of the list.
return: $this

get_source_files()   X-Ref
Retrieve the complete list of source files.

return: stored_file|conversion[]

refresh_files()   X-Ref
Refresh the files.

This includes polling any pending conversions to see if they are complete.

return: $this

combine_files($contextid, $itemid)   X-Ref
Combine all source files into a single PDF and store it in the
file_storage API using the supplied contextid and itemid.

param: int $contextid The contextid for the file to be stored under
param: int $itemid The itemid for the file to be stored under
return: $this

mark_combination_failed()   X-Ref
Mark the combination attempt as having encountered a permanent failure.

return: $this

store_combined_file($tmpfile, $contextid, $itemid, $partial = false)   X-Ref
Store the combined file in the file_storage API.

param: string $tmpfile The path to the file on disk to be stored.
param: int $contextid The contextid for the file to be stored under
param: int $itemid The itemid for the file to be stored under
param: boolean $partial The combined pdf contains only some of the source files.
return: $this

store_empty_document($contextid, $itemid)   X-Ref
Store the empty document file in the file_storage API.

param: int $contextid The contextid for the file to be stored under
param: int $itemid The itemid for the file to be stored under
return: $this

get_page_count()   X-Ref
Get the total number of pages in the combined document.

If there are no pages, or it is not yet possible to count them a
value of 0 is returned.

return: int

get_document_count()   X-Ref
Get the total number of documents to be combined.

return: int

get_stored_file_record($contextid, $itemid, $partial = false)   X-Ref
Helper to fetch the stored_file record.

param: int $contextid The contextid for the file to be stored under
param: int $itemid The itemid for the file to be stored under
param: boolean $partial The combined file contains only some of the source files.
return: stdClass