library class for importing feedback files from a zip
More...
|
| delete_import_files ($contextid) |
| Delete all temp files used when importing a zip.
|
|
| extract_files_from_zip ($zipfile, $contextid) |
| Extract the uploaded zip to a temporary import area for this user.
|
|
| get_import_files ($contextid) |
| Get the list of files extracted from the uploaded zip.
|
|
| get_participant_mapping (assign $assignment) |
| Returns a mapping from unique user / group ids in folder names to array of moodle users.
|
|
| import_zip_files ($assignment, $fileplugin) |
| Process an uploaded zip file.
|
|
| is_file_modified ($assignment, $users, $plugin, $filename, $fileinfo) |
| Does this file exist in any of the current files supported by this plugin for this user?
|
|
| is_valid_filename_for_import ($assignment, $fileinfo, $participants, & $users, & $plugin, & $filename) |
| Is this filename valid (contains a unique participant ID) for import?
|
|
library class for importing feedback files from a zip
- Copyright
- 2012 NetSpot
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ delete_import_files()
assignfeedback_file_zip_importer::delete_import_files |
( |
| $contextid | ) |
|
Delete all temp files used when importing a zip.
- Parameters
-
int | $contextid | - The context id of this assignment instance |
- Return values
-
bool | true if all files were deleted |
◆ extract_files_from_zip()
assignfeedback_file_zip_importer::extract_files_from_zip |
( |
| $zipfile, |
|
|
| $contextid ) |
Extract the uploaded zip to a temporary import area for this user.
- Parameters
-
stored_file | $zipfile | The uploaded file |
int | $contextid | The context for this assignment |
- Return values
-
bool | - True if the files were unpacked |
◆ get_import_files()
assignfeedback_file_zip_importer::get_import_files |
( |
| $contextid | ) |
|
Get the list of files extracted from the uploaded zip.
- Parameters
-
- Return values
-
◆ get_participant_mapping()
assignfeedback_file_zip_importer::get_participant_mapping |
( |
assign | $assignment | ) |
|
Returns a mapping from unique user / group ids in folder names to array of moodle users.
- Parameters
-
assign | $assignment | - The assignment instance |
- Return values
-
◆ import_zip_files()
assignfeedback_file_zip_importer::import_zip_files |
( |
| $assignment, |
|
|
| $fileplugin ) |
Process an uploaded zip file.
- Parameters
-
assign | $assignment | - The assignment instance |
assign_feedback_file | $fileplugin | - The file feedback plugin |
- Return values
-
string | - The html response |
◆ is_file_modified()
assignfeedback_file_zip_importer::is_file_modified |
( |
| $assignment, |
|
|
| $users, |
|
|
| $plugin, |
|
|
| $filename, |
|
|
| $fileinfo ) |
Does this file exist in any of the current files supported by this plugin for this user?
- Parameters
-
assign | $assignment | - The assignment instance |
array | $users | The user matching this uploaded file |
assign_plugin | $plugin | The matching plugin from the filename |
string | $filename | The parsed filename from the zip |
stored_file | $fileinfo | The info about the extracted file from the zip |
- Return values
-
bool | - True if the file has been modified or is new |
◆ is_valid_filename_for_import()
assignfeedback_file_zip_importer::is_valid_filename_for_import |
( |
| $assignment, |
|
|
| $fileinfo, |
|
|
| $participants, |
|
|
& | $users, |
|
|
& | $plugin, |
|
|
& | $filename ) |
Is this filename valid (contains a unique participant ID) for import?
- Parameters
-
assign | $assignment | - The assignment instance |
stored_file | $fileinfo | - The fileinfo |
array | $participants | - A list of valid participants for this module indexed by unique_id or group id. |
array | $users | - Set to array with the user(s) that matches by participant id |
assign_plugin | $plugin | - Set to the plugin that exported the file |
string | $filename | - Set to truncated filename (prefix stripped) |
- Return values
-
bool | If the participant Id can be extracted and this is a valid user |
The documentation for this class was generated from the following file:
- mod/assign/feedback/file/importziplib.php