library class for importing feedback files from a zip
More...
|
| delete_import_files ($contextid) |
| Delete all temp files used when importing a zip. More...
|
|
| extract_files_from_zip ($zipfile, $contextid) |
| Extract the uploaded zip to a temporary import area for this user. More...
|
|
| get_import_files ($contextid) |
| Get the list of files extracted from the uploaded zip. More...
|
|
| import_zip_files ($assignment, $fileplugin) |
| Process an uploaded zip file. More...
|
|
| is_file_modified ($assignment, $user, $plugin, $filename, $fileinfo) |
| Does this file exist in any of the current files supported by this plugin for this user? More...
|
|
| is_valid_filename_for_import ($assignment, $fileinfo, $participants, & $user, & $plugin, & $filename) |
| Is this filename valid (contains a unique participant ID) for import? More...
|
|
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
-
◆ 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, |
|
|
|
$user, |
|
|
|
$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 |
stdClass | $user | 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, |
|
|
& |
$user, |
|
|
& |
$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 |
stdClass | $user | - Set to the user 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
-
true | If the participant Id can be extracted and this is a valid user |
The documentation for this class was generated from the following file: