Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
|
Library class for comment 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. | |
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) | |
delete_instance () | |
The assignment has been deleted - cleanup. | |
disable () | |
Set this plugin to disabled. | |
enable () | |
Set this plugin to enabled. | |
files_for_gradebook (stdClass $grade) | |
Return any files this plugin wishes to save to the gradebook. | |
format_for_gradebook (stdClass $grade) | |
If this plugin adds to the gradebook comments field, it must specify the format of the text of the comment. | |
format_for_log () | |
get_config ($setting=null) | |
Get a configuration value for this plugin. | |
get_config_file_areas () | |
Get a list of file areas associated with the plugin configuration. | |
get_config_for_external () | |
Return the plugin configs for external functions. | |
get_editor_fields () | |
Return a list of the text fields that can be imported/exported by this plugin. | |
get_editor_format ($name, $submissionid) | |
Given a field name, should return the format of an editor field that is part of this plugin. | |
get_editor_text ($name, $gradeid) | |
Get the saved text content from the editor. | |
get_error () | |
What was the last error? | |
get_external_parameters () | |
Return a description of external params suitable for uploading an feedback comment from a webservice. | |
get_feedback_comments ($gradeid) | |
Get the feedback comment from the database. | |
get_file_areas () | |
Get file areas returns a list of areas this plugin stores files. | |
get_file_info ($browser, $filearea, $itemid, $filepath, $filename) | |
Default implementation of file_get_info for plugins. | |
get_files (stdClass $submissionorgrade, stdClass $user) | |
Produce a list of files suitable for export that represent this feedback or submission. | |
get_form_elements ($submissionorgrade, MoodleQuickForm $mform, stdClass $data) | |
Get any additional fields for the submission/grading form for this assignment. | |
get_form_elements_for_user ($grade, MoodleQuickForm $mform, stdClass $data, $userid) | |
Get form elements for the grading page. | |
get_grading_actions () | |
Return a list of the grading actions supported by this plugin. | |
get_grading_batch_operations () | |
Return a list of the batch grading operations supported by this plugin. | |
get_name () | |
Get the name of the online comment feedback plugin. | |
get_quickgrading_html ($userid, $grade) | |
Get quickgrading form elements as html. | |
get_requires () | |
Get the required moodle version for this plugin. | |
get_settings (MoodleQuickForm $mform) | |
Get the default setting for feedback comments plugin. | |
get_sort_order () | |
Get the numerical sort order for this plugin. | |
get_subtype () | |
Return subtype name of the plugin. | |
get_type () | |
Should return the type of this plugin. | |
get_version () | |
Get the installed version of this plugin. | |
grading_action ($gradingaction) | |
Show a grading action form. | |
grading_batch_operation ($action, $users) | |
Show a batch operations form. | |
has_admin_settings () | |
Has this plugin got a custom settings.php file? | |
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. | |
is_configurable () | |
If true, the plugin will appear on the module settings page and can be enabled/disabled per assignment instance. | |
is_empty (stdClass $grade) | |
Returns true if there are no feedback comments for the given grade. | |
is_enabled () | |
Allows hiding this plugin from the submission/feedback screen if it is not enabled. | |
is_feedback_modified (stdClass $grade, stdClass $data) | |
Has the comment feedback been modified? | |
is_first () | |
Is this the first plugin in the list? | |
is_last () | |
Is this the last plugin in the list? | |
is_quickgrading_modified ($userid, $grade) | |
Has the plugin quickgrading form element been modified in the current form submission? | |
is_visible () | |
Is this plugin enaled? | |
save (stdClass $grade, stdClass $data) | |
Saving the comment content into database. | |
save_quickgrading_changes ($userid, $grade) | |
Save quickgrading changes. | |
save_settings (stdClass $data) | |
Save the settings for feedback comments plugin. | |
set_config ($name, $value) | |
Set a configuration value for this plugin. | |
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. | |
set_editor_text ($name, $value, $gradeid) | |
Get the saved text content from the editor. | |
supports_quickgrading () | |
Override to indicate a plugin supports quickgrading. | |
supports_review_panel () | |
Supports injecting content into the review panel of the grading app. | |
text_for_gradebook (stdClass $grade) | |
If this plugin adds to the gradebook comments field, it must format the text of the comment. | |
upgrade (context $oldcontext, stdClass $oldassignment, stdClass $oldsubmission, stdClass $grade, & $log) | |
Upgrade the feedback from the old assignment to the new one. | |
upgrade_settings (context $oldcontext, stdClass $oldassignment, & $log) | |
Upgrade the settings from the old assignment to the new plugin based one. | |
view (stdClass $grade) | |
Display the comment in the feedback table. | |
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. | |
view_page ($action) | |
This allows a plugin to render a page in the context of the assignment. | |
view_summary (stdClass $grade, & $showviewlink) | |
Display the comment in the feedback table. | |
Static Public Member Functions | |
static | cron () |
Run cron for this plugin. | |
Protected Member Functions | |
convert_submission_text_to_feedback ($submission, $data, $grade) | |
Convert the text from any submission plugin that has an editor field to a format suitable for inserting in the feedback text field. | |
set_error ($msg) | |
Save the error message from the last error. | |
Protected Attributes | |
assign | $assignment |
$assignment the assignment record that contains the global settings for this assign instance | |
Library class for comment feedback plugin extending feedback plugin base class.
assign_feedback_comments::can_upgrade | ( | $type, | |
$version ) |
Return true if this plugin can upgrade an old Moodle 2.2 assignment of this type and version.
string | $type | old assignment subtype |
int | $version | old assignment version |
bool | True if upgrade is possible |
Reimplemented from assign_plugin.
|
protected |
Convert the text from any submission plugin that has an editor field to a format suitable for inserting in the feedback text field.
stdClass | $submission | |
stdClass | $data | - Form data to be filled with the converted submission text and format. |
stdClass | null | $grade |
boolean | - True if feedback text was set. |
|
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_comments::delete_instance | ( | ) |
|
finalinherited |
Set this plugin to disabled.
bool |
|
finalinherited |
Set this plugin to enabled.
bool |
assign_feedback_comments::files_for_gradebook | ( | stdClass | $grade | ) |
Return any files this plugin wishes to save to the gradebook.
stdClass | $grade | The assign_grades object from the db |
array |
Reimplemented from assign_feedback_plugin.
assign_feedback_comments::format_for_gradebook | ( | stdClass | $grade | ) |
If this plugin adds to the gradebook comments field, it must specify the format of 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 |
int |
Reimplemented from assign_feedback_plugin.
|
inherited |
|
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_comments::get_config_for_external | ( | ) |
Return the plugin configs for external functions.
array | the list of settings |
Reimplemented from assign_plugin.
assign_feedback_comments::get_editor_fields | ( | ) |
Return a list of the text fields that can be imported/exported by this plugin.
array | An array of field names and descriptions. (name=>description, ...) |
Reimplemented from assign_plugin.
|
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.
assign_feedback_comments::get_editor_text | ( | $name, | |
$gradeid ) |
Get the saved text content from the editor.
string | $name | |
int | $gradeid |
string |
Reimplemented from assign_plugin.
|
finalinherited |
What was the last error?
string |
assign_feedback_comments::get_external_parameters | ( | ) |
Return a description of external params suitable for uploading an feedback comment from a webservice.
core_external\external_description|null |
Reimplemented from assign_plugin.
assign_feedback_comments::get_feedback_comments | ( | $gradeid | ) |
Get the feedback comment from the database.
int | $gradeid |
stdClass|false | The feedback comments for the given grade if it exists. False if it doesn't. |
assign_feedback_comments::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_file, and assign_submission_onlinetext.
|
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_feedback_offline, assign_submission_file, and assign_submission_onlinetext.
assign_feedback_comments::get_form_elements_for_user | ( | $grade, | |
MoodleQuickForm | $mform, | ||
stdClass | $data, | ||
$userid ) |
Get form elements for the grading page.
stdClass | null | $grade | |
MoodleQuickForm | $mform | |
stdClass | $data |
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_file, and assign_feedback_offline.
|
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_comments::get_name | ( | ) |
Get the name of the online comment feedback plugin.
string |
Reimplemented from assign_plugin.
assign_feedback_comments::get_quickgrading_html | ( | $userid, | |
$grade ) |
Get quickgrading form elements as html.
int | $userid | The user id in the table this quickgrading element relates to |
mixed | $grade | - 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 |
Reimplemented from assign_feedback_plugin.
|
finalinherited |
Get the required moodle version for this plugin.
string |
assign_feedback_comments::get_settings | ( | MoodleQuickForm | $mform | ) |
Get the default setting for feedback comments plugin.
MoodleQuickForm | $mform | The form to add elements to |
void |
Reimplemented from assign_plugin.
|
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 |
|
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.
|
inherited |
If true, the plugin will appear on the module settings page and can be enabled/disabled per assignment instance.
bool |
Reimplemented in assign_feedback_editpdf, and assign_submission_comments.
assign_feedback_comments::is_empty | ( | stdClass | $grade | ) |
Returns true if there are no feedback comments for the given grade.
stdClass | $grade |
bool |
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_feedback_offline, and assign_submission_comments.
assign_feedback_comments::is_feedback_modified | ( | stdClass | $grade, |
stdClass | $data ) |
Has the comment feedback been modified?
stdClass | $grade | The grade object. |
stdClass | $data | Data from the form submission. |
boolean | True if the comment feedback 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 |
assign_feedback_comments::is_quickgrading_modified | ( | $userid, | |
$grade ) |
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 from assign_feedback_plugin.
|
finalinherited |
Is this plugin enaled?
bool |
assign_feedback_comments::save | ( | stdClass | $grade, |
stdClass | $data ) |
Saving the comment content into database.
stdClass | $grade | |
stdClass | $data |
bool |
Reimplemented from assign_plugin.
assign_feedback_comments::save_quickgrading_changes | ( | $userid, | |
$grade ) |
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 from assign_feedback_plugin.
assign_feedback_comments::save_settings | ( | stdClass | $data | ) |
Save the settings for feedback comments plugin.
stdClass | $data |
bool |
Reimplemented from assign_plugin.
|
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 |
assign_feedback_comments::set_editor_text | ( | $name, | |
$value, | |||
$gradeid ) |
Get the saved text content from the editor.
string | $name | |
string | $value | |
int | $gradeid |
string |
Reimplemented from assign_plugin.
|
finalprotectedinherited |
Save the error message from the last error.
string | $msg | - the error description |
assign_feedback_comments::supports_quickgrading | ( | ) |
Override to indicate a plugin supports quickgrading.
boolean | - True if the plugin supports quickgrading |
Reimplemented from assign_feedback_plugin.
|
inherited |
Supports injecting content into the review panel of the grading app.
bool | True if this plugin will add content to the review panel of the grading app. |
Reimplemented in assign_feedback_editpdf.
assign_feedback_comments::text_for_gradebook | ( | stdClass | $grade | ) |
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 from assign_feedback_plugin.
assign_feedback_comments::upgrade | ( | context | $oldcontext, |
stdClass | $oldassignment, | ||
stdClass | $oldsubmission, | ||
stdClass | $grade, | ||
& | $log ) |
Upgrade the feedback from the old assignment to the new one.
context | $oldcontext | - the database for the old assignment context |
stdClass | $oldassignment | The data record for the old assignment |
stdClass | $oldsubmission | The data record for the old submission |
stdClass | $grade | The data record for the new grade |
string | $log | Record upgrade messages in the log |
bool | true or false - false will trigger a rollback |
Reimplemented from assign_plugin.
assign_feedback_comments::upgrade_settings | ( | context | $oldcontext, |
stdClass | $oldassignment, | ||
& | $log ) |
Upgrade the settings from the old assignment to the new plugin based one.
context | $oldcontext | - the context for the old assignment |
stdClass | $oldassignment | - the data for the old assignment |
string | $log | - can be appended to by the upgrade |
bool | was it a success? (false will trigger a rollback) |
Reimplemented from assign_plugin.
assign_feedback_comments::view | ( | stdClass | $grade | ) |
Display the comment in the feedback 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_file, and assign_feedback_offline.
assign_feedback_comments::view_summary | ( | stdClass | $grade, |
& | $showviewlink ) |
Display the comment in the feedback table.
stdClass | $grade | |
bool | $showviewlink | Set to true to show a link to view the full feedback |
string |
Reimplemented from assign_plugin.