Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
library class for editpdf feedback plugin extending feedback plugin base class More...
Public Member Functions | |
can_upgrade ($type, $version) | |
Return true if this plugin can upgrade an old Moodle 2.2 assignment of this type and version. More... | |
data_preprocessing (&$defaultvalues) | |
Allows the plugin to update the defaultvalues passed in to the settings form (needed to set up draft areas for editor and filemanager elements) More... | |
delete_instance () | |
The assignment has been deleted - remove the plugin specific data. More... | |
disable () | |
Set this plugin to disabled. More... | |
enable () | |
Set this plugin to enabled. More... | |
files_for_gradebook (stdClass $grade) | |
Return any files this plugin wishes to save to the gradebook. More... | |
format_for_gradebook (stdClass $grade) | |
If this plugin adds to the gradebook comments field, it must specify the format of the comment. More... | |
format_for_log (stdClass $submissionorgrade) | |
Formatting for log info. More... | |
get_config ($setting=null) | |
Get a configuration value for this plugin. More... | |
get_config_file_areas () | |
Get a list of file areas associated with the plugin configuration. More... | |
get_config_for_external () | |
Return the plugin configs for external functions. More... | |
get_editor_fields () | |
Return a list of the fields that can be exported or imported via text. More... | |
get_editor_format ($name, $submissionid) | |
Given a field name, should return the format of an editor field that is part of this plugin. More... | |
get_editor_text ($name, $submissionorgradeid) | |
Given a field name, should return the text of an editor field that is part of this plugin. More... | |
get_error () | |
What was the last error? More... | |
get_external_parameters () | |
If this plugin can participate in a webservice (save_submission or save_grade), return a list of external_params to be included in the definition of that webservice. More... | |
get_file_areas () | |
Get file areas returns a list of areas this plugin stores files. More... | |
get_file_info ($browser, $filearea, $itemid, $filepath, $filename) | |
Default implementation of file_get_info for plugins. More... | |
get_files (stdClass $submissionorgrade, stdClass $user) | |
Produce a list of files suitable for export that represent this feedback or submission. More... | |
get_form_elements ($submissionorgrade, MoodleQuickForm $mform, stdClass $data) | |
Get any additional fields for the submission/grading form for this assignment. More... | |
get_form_elements_for_user ($grade, MoodleQuickForm $mform, stdClass $data, $userid) | |
Get form elements for grading form. More... | |
get_grading_actions () | |
Return a list of the grading actions supported by this plugin. More... | |
get_grading_batch_operations () | |
Return a list of the batch grading operations supported by this plugin. More... | |
get_name () | |
Get the name of the file feedback plugin. More... | |
get_quickgrading_html ($userid, $grade) | |
Get quickgrading form elements as html. More... | |
get_requires () | |
Get the required moodle version for this plugin. More... | |
get_settings (MoodleQuickForm $mform) | |
This function should be overridden to provide an array of elements that can be added to a moodle form for display in the settings page for the assignment. More... | |
get_sort_order () | |
Get the numerical sort order for this plugin. More... | |
get_subtype () | |
Return subtype name of the plugin. More... | |
get_type () | |
Should return the type of this plugin. More... | |
get_version () | |
Get the installed version of this plugin. More... | |
get_widget ($userid, $grade, $readonly) | |
Create a widget for rendering the editor. More... | |
grading_action ($gradingaction) | |
Show a grading action form. More... | |
grading_batch_operation ($action, $users) | |
Show a batch operations form. More... | |
has_admin_settings () | |
Has this plugin got a custom settings.php file? More... | |
has_user_summary () | |
If this plugin should not include a column in the grading table or a row on the summary page then return false. More... | |
is_available () | |
Determine if ghostscript is available and working. More... | |
is_configurable () | |
Prevent enabling this plugin if ghostscript is not available. More... | |
is_empty (stdClass $grade) | |
Return true if there are no released comments/annotations. More... | |
is_enabled () | |
Allows hiding this plugin from the submission/feedback screen if it is not enabled. More... | |
is_feedback_modified (stdClass $grade, stdClass $data) | |
Check to see if the grade feedback for the pdf has been modified. More... | |
is_first () | |
Is this the first plugin in the list? More... | |
is_last () | |
Is this the last plugin in the list? More... | |
is_quickgrading_modified ($userid, $grade) | |
Has the plugin quickgrading form element been modified in the current form submission? More... | |
is_visible () | |
Is this plugin enaled? More... | |
save (stdClass $grade, stdClass $data) | |
Generate the pdf. More... | |
save_quickgrading_changes ($userid, $grade) | |
Save quickgrading changes. More... | |
save_settings (stdClass $formdata) | |
The assignment subtype is responsible for saving it's own settings as the database table for the standard type cannot be modified. More... | |
set_config ($name, $value) | |
Set a configuration value for this plugin. More... | |
set_editor_format ($name, $format, $submissionorgradeid) | |
Given a field name and value should update the format for this field in the plugins submission or grade. More... | |
set_editor_text ($name, $value, $submissionorgradeid) | |
Given a field name and value should update the text for this field in the plugins submission or grade. More... | |
supports_quickgrading () | |
Override to indicate a plugin supports quickgrading. More... | |
supports_review_panel () | |
This plugin will inject content into the review panel with javascript. More... | |
text_for_gradebook (stdClass $grade) | |
If this plugin adds to the gradebook comments field, it must format the text of the comment. More... | |
upgrade (context $oldcontext, stdClass $oldassignment, stdClass $oldsubmissionorgrade, stdClass $submissionorgrade, & $log) | |
Upgrade the submission from the old assignment to the new one. More... | |
upgrade_settings (context $oldcontext, stdClass $oldassignment, & $log) | |
Upgrade the settings from the old assignment to the new one. More... | |
view (stdClass $grade) | |
Display the list of files in the feedback status table. More... | |
view_header () | |
This allows a plugin to render an introductory section which is displayed right below the activity's "intro" section on the main assignment page. More... | |
view_page ($action) | |
This allows a plugin to render a page in the context of the assignment. More... | |
view_summary (stdClass $grade, & $showviewlink) | |
Display the list of files in the feedback status table. More... | |
Static Public Member Functions | |
static | cron () |
Run cron for this plugin. | |
Protected Member Functions | |
set_error ($msg) | |
Save the error message from the last error. More... | |
Protected Attributes | |
assign | $assignment |
$assignment the assignment record that contains the global settings for this assign instance | |
library class for editpdf feedback plugin extending feedback plugin base class
|
inherited |
Return true if this plugin can upgrade an old Moodle 2.2 assignment of this type and version.
string | $type | The old assignment subtype |
int | $version | The old assignment version |
bool | True if upgrade is possible |
Reimplemented in assign_submission_onlinetext, assign_submission_file, assign_submission_comments, assign_feedback_file, and assign_feedback_comments.
|
inherited |
Allows the plugin to update the defaultvalues passed in to the settings form (needed to set up draft areas for editor and filemanager elements)
array | $defaultvalues |
assign_feedback_editpdf::delete_instance | ( | ) |
The assignment has been deleted - remove the plugin specific data.
bool |
Reimplemented from assign_plugin.
|
finalinherited |
Set this plugin to disabled.
bool |
|
finalinherited |
Set this plugin to enabled.
bool |
|
inherited |
Return any files this plugin wishes to save to the gradebook.
The array being returned should contain the necessary information to identify and copy the files.
eg.
[ 'contextid' => $modulecontext->id, 'component' => ASSIGNFEEDBACK_XYZ_COMPONENT, 'filearea' => ASSIGNFEEDBACK_XYZ_FILEAREA, 'itemid' => $grade->id ]
stdClass | $grade | The assign_grades object from the db |
array |
Reimplemented in assign_feedback_comments.
|
inherited |
If this plugin adds to the gradebook comments field, it must specify the format of the comment.
(From weblib.php) define('FORMAT_MOODLE', '0'); // Does all sorts of transformations and filtering define('FORMAT_HTML', '1'); // Plain HTML (with some tags stripped) define('FORMAT_PLAIN', '2'); // Plain text (even tags are printed in full) define('FORMAT_WIKI', '3'); // Wiki-formatted text define('FORMAT_MARKDOWN', '4'); // Markdown-formatted
Only one feedback plugin can push comments to the gradebook and that is chosen by the assignment settings page.
stdClass | $grade | The grade |
int |
Reimplemented in assign_feedback_comments.
|
inherited |
Formatting for log info.
stdClass | $submissionorgrade | assign_submission or assign_grade The new submission or grade |
string |
Reimplemented in assign_submission_onlinetext, and assign_submission_file.
|
finalinherited |
Get a configuration value for this plugin.
mixed | $setting | The config key (string) or null |
mixed | string | false |
|
inherited |
Get a list of file areas associated with the plugin configuration.
This is used for backup/restore.
array | names of the fileareas, can be an empty array |
assign_feedback_editpdf::get_config_for_external | ( | ) |
Return the plugin configs for external functions.
array | the list of settings |
Reimplemented from assign_plugin.
|
inherited |
Return a list of the fields that can be exported or imported via text.
array | - The list of field names (strings) and descriptions. ($name => $description) |
Reimplemented in assign_submission_onlinetext, and assign_feedback_comments.
|
inherited |
Given a field name, should return the format of an editor field that is part of this plugin.
This is used when exporting to portfolio.
string | $name | Name of the field. |
int | $submissionid | The id of the submission |
int | - The format for the editor field |
Reimplemented in assign_submission_onlinetext.
|
inherited |
Given a field name, should return the text of an editor field that is part of this plugin.
This is used when exporting to portfolio.
string | $name | Name of the field. |
int | $submissionorgradeid | The id of the submission or grade |
string | - The text for the editor field |
Reimplemented in assign_submission_onlinetext, and assign_feedback_comments.
|
finalinherited |
What was the last error?
string |
|
inherited |
If this plugin can participate in a webservice (save_submission or save_grade), return a list of external_params to be included in the definition of that webservice.
external_description|null |
Reimplemented in assign_submission_onlinetext, assign_submission_file, assign_feedback_file, and assign_feedback_comments.
assign_feedback_editpdf::get_file_areas | ( | ) |
Get file areas returns a list of areas this plugin stores files.
array | - An array of fileareas (keys) and descriptions (values) |
Reimplemented from assign_plugin.
|
inherited |
Default implementation of file_get_info for plugins.
This is used by the filebrowser to browse a plugins file areas.
This implementation should work for most plugins but can be overridden if required.
file_browser | $browser | |
string | $filearea | |
int | $itemid | |
string | $filepath | |
string | $filename |
file_info_stored |
|
inherited |
Produce a list of files suitable for export that represent this feedback or submission.
stdClass | $submissionorgrade | assign_submission or assign_grade For submission plugins this is the submission data, for feedback plugins it is the grade data |
stdClass | $user | The user record for the current submission. Needed for url rewriting if this is a group submission. |
array | - return an array of files indexed by filename |
Reimplemented in assign_submission_onlinetext, and assign_submission_file.
|
inherited |
Get any additional fields for the submission/grading form for this assignment.
This function is retained for backwards compatibility - new plugins should override get_form_elements_for_user().
mixed | $submissionorgrade | submission|grade - For submission plugins this is the submission data, for feedback plugins it is the grade data |
MoodleQuickForm | $mform | - This is the form |
stdClass | $data | - This is the form data that can be modified for example by a filemanager element |
boolean | - true if we added anything to the form |
Reimplemented in assign_submission_onlinetext, assign_submission_file, and assign_feedback_offline.
assign_feedback_editpdf::get_form_elements_for_user | ( | $grade, | |
MoodleQuickForm | $mform, | ||
stdClass | $data, | ||
$userid | |||
) |
Get form elements for grading form.
stdClass | $grade | |
MoodleQuickForm | $mform | |
stdClass | $data | |
int | $userid |
bool | true if elements were added to the form |
Reimplemented from assign_plugin.
|
inherited |
Return a list of the grading actions supported by this plugin.
A grading action is a page that is not specific to a user but to the whole assignment.
array | - An array of action and description strings. The action will be passed to grading_action. |
Reimplemented in assign_feedback_offline, and assign_feedback_file.
|
inherited |
Return a list of the batch grading operations supported by this plugin.
array | - An array of action and description strings. The action will be passed to grading_batch_operation. |
Reimplemented in assign_feedback_file.
assign_feedback_editpdf::get_name | ( | ) |
|
inherited |
Get quickgrading form elements as html.
int | $userid | The user id in the table this quickgrading element relates to |
mixed | $grade | grade or null - The grade data. May be null if there are no grades for this user (yet) |
mixed | - A html string containing the html form elements required for quickgrading or false to indicate this plugin does not support quickgrading |
Reimplemented in assign_feedback_comments.
|
finalinherited |
Get the required moodle version for this plugin.
string |
|
inherited |
This function should be overridden to provide an array of elements that can be added to a moodle form for display in the settings page for the assignment.
MoodleQuickForm | $mform | The form to add the elements to |
$array |
Reimplemented in assign_submission_onlinetext, assign_submission_file, and assign_feedback_comments.
|
finalinherited |
Get the numerical sort order for this plugin.
int |
|
inherited |
|
finalinherited |
Should return the type of this plugin.
string | - the type |
|
finalinherited |
Get the installed version of this plugin.
string |
assign_feedback_editpdf::get_widget | ( | $userid, | |
$grade, | |||
$readonly | |||
) |
Create a widget for rendering the editor.
int | $userid | |
stdClass | $grade | |
bool | $readonly |
assignfeedback_editpdf_widget |
|
inherited |
Show a grading action form.
string | $gradingaction | The action chosen from the grading actions menu |
string | The page containing the form |
|
inherited |
Show a batch operations form.
string | $action | The action chosen from the batch operations menu |
array | $users | The list of selected userids |
string | The page containing the form |
Reimplemented in assign_feedback_file.
|
finalinherited |
Has this plugin got a custom settings.php file?
bool |
|
inherited |
If this plugin should not include a column in the grading table or a row on the summary page then return false.
bool |
Reimplemented in assign_feedback_offline.
assign_feedback_editpdf::is_available | ( | ) |
Determine if ghostscript is available and working.
bool |
assign_feedback_editpdf::is_configurable | ( | ) |
Prevent enabling this plugin if ghostscript is not available.
bool | false |
Reimplemented from assign_plugin.
assign_feedback_editpdf::is_empty | ( | stdClass | $grade | ) |
Return true if there are no released comments/annotations.
stdClass | $grade |
Reimplemented from assign_plugin.
|
inherited |
Allows hiding this plugin from the submission/feedback screen if it is not enabled.
bool | - if false - this plugin will not accept submissions / feedback |
Reimplemented in assign_submission_comments, and assign_feedback_offline.
assign_feedback_editpdf::is_feedback_modified | ( | stdClass | $grade, |
stdClass | $data | ||
) |
Check to see if the grade feedback for the pdf has been modified.
stdClass | $grade | Grade object. |
stdClass | $data | Data from the form submission (not used). |
boolean | True if the pdf has been modified, else false. |
Reimplemented from assign_feedback_plugin.
|
finalinherited |
Is this the first plugin in the list?
bool |
|
finalinherited |
Is this the last plugin in the list?
bool |
|
inherited |
Has the plugin quickgrading form element been modified in the current form submission?
int | $userid | The user id in the table this quickgrading element relates to |
stdClass | $grade | The grade |
boolean | - true if the quickgrading form element has been modified |
Reimplemented in assign_feedback_comments.
|
finalinherited |
Is this plugin enaled?
bool |
assign_feedback_editpdf::save | ( | stdClass | $grade, |
stdClass | $data | ||
) |
Generate the pdf.
stdClass | $grade | |
stdClass | $data |
bool |
Reimplemented from assign_plugin.
|
inherited |
Save quickgrading changes.
int | $userid | The user id in the table this quickgrading element relates to |
stdClass | $grade | The grade |
boolean | - true if the grade changes were saved correctly |
Reimplemented in assign_feedback_comments.
|
inherited |
The assignment subtype is responsible for saving it's own settings as the database table for the standard type cannot be modified.
stdClass | $formdata | - the data submitted from the form |
bool | - on error the subtype should call set_error and return false. |
Reimplemented in assign_submission_onlinetext, assign_submission_file, and assign_feedback_comments.
|
finalinherited |
Set a configuration value for this plugin.
string | $name | The config key |
string | $value | The config value |
bool |
|
inherited |
Given a field name and value should update the format for this field in the plugins submission or grade.
string | $name | Name of the field. |
int | $format | Updated format. |
int | $submissionorgradeid | The id of the submission or grade. |
bool | - true if the value was updated |
|
inherited |
Given a field name and value should update the text for this field in the plugins submission or grade.
string | $name | Name of the field. |
string | $value | Updated text |
int | $submissionorgradeid | The id of the submission or grade |
bool | - true if the value was updated |
Reimplemented in assign_feedback_comments.
|
finalprotectedinherited |
Save the error message from the last error.
string | $msg | - the error description |
|
inherited |
Override to indicate a plugin supports quickgrading.
boolean | - True if the plugin supports quickgrading |
Reimplemented in assign_feedback_comments.
assign_feedback_editpdf::supports_review_panel | ( | ) |
This plugin will inject content into the review panel with javascript.
bool | true |
Reimplemented from assign_feedback_plugin.
|
inherited |
If this plugin adds to the gradebook comments field, it must format the text of the comment.
Only one feedback plugin can push comments to the gradebook and that is chosen by the assignment settings page.
stdClass | $grade | The grade |
string |
Reimplemented in assign_feedback_comments.
|
inherited |
Upgrade the submission from the old assignment to the new one.
context | $oldcontext | The data record for the old context |
stdClass | $oldassignment | The data record for the old assignment |
stdClass | $oldsubmissionorgrade | The data record for the old submission |
stdClass | $submissionorgrade | assign_submission or assign_grade The new submission or grade |
string | $log | Record upgrade messages in the log |
boolean | true or false - false will trigger a rollback |
Reimplemented in assign_submission_onlinetext, assign_submission_file, assign_submission_comments, assign_feedback_file, and assign_feedback_comments.
|
inherited |
Upgrade the settings from the old assignment to the new one.
context | $oldcontext | The context for the old assignment module |
stdClass | $oldassignment | The data record for the old assignment |
string | $log | Record upgrade messages in the log |
bool | true or false - false will trigger a rollback |
Reimplemented in assign_submission_onlinetext, assign_submission_file, assign_submission_comments, assign_feedback_file, and assign_feedback_comments.
assign_feedback_editpdf::view | ( | stdClass | $grade | ) |
Display the list of files in the feedback status table.
stdClass | $grade |
string |
Reimplemented from assign_plugin.
|
inherited |
This allows a plugin to render an introductory section which is displayed right below the activity's "intro" section on the main assignment page.
string |
|
inherited |
This allows a plugin to render a page in the context of the assignment.
If the plugin creates a link to the assignment view.php page with The following required parameters: id=coursemoduleid plugin=type pluginsubtype=assignfeedback|assignsubmission pluginaction=customaction
Then this function will be called to display the page with the pluginaction passed as action
string | $action | The plugin specified action |
string |
Reimplemented in assign_feedback_offline, and assign_feedback_file.
assign_feedback_editpdf::view_summary | ( | stdClass | $grade, |
& | $showviewlink | ||
) |
Display the list of files in the feedback status table.
stdClass | $grade | |
bool | $showviewlink | (Always set to false). |
string |
Reimplemented from assign_plugin.