Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

This file contains the definition for the library class for online comment submission plugin

Copyright: 2012 NetSpot {@link http://www.netspot.com.au}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 200 lines (7 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class

assign_submission_comments:: (10 methods):
  get_name()
  view_summary()
  is_empty()
  can_upgrade()
  upgrade_settings()
  upgrade()
  allow_submissions()
  is_enabled()
  is_configurable()
  get_config_for_external()


Class: assign_submission_comments  - X-Ref

Library class for comment submission plugin extending submission plugin base class

get_name()   X-Ref
Get the name of the online comment submission plugin

return: string

view_summary(stdClass $submission, & $showviewlink)   X-Ref
Display AJAX based comment in the submission status table

param: stdClass $submission
param: bool $showviewlink - If the comments are long this is
return: string

is_empty(stdClass $submission)   X-Ref
Always return true because the submission comments are not part of the submission form.

param: stdClass $submission
return: bool

can_upgrade($type, $version)   X-Ref
Return true if this plugin can upgrade an old Moodle 2.2 assignment of this type
and version.

param: string $type old assignment subtype
param: int $version old assignment version
return: bool True if upgrade is possible

upgrade_settings(context $oldcontext, stdClass $oldassignment, & $log)   X-Ref
Upgrade the settings from the old assignment to the new plugin based one

param: context $oldcontext - the context for the old assignment
param: stdClass $oldassignment - the data for the old assignment
param: string $log - can be appended to by the upgrade
return: bool was it a success? (false will trigger a rollback)

upgrade(context $oldcontext,stdClass $oldassignment,stdClass $oldsubmission,stdClass $submission,& $log)   X-Ref
Upgrade the submission from the old assignment to the new one

param: context $oldcontext The context for the old assignment
param: stdClass $oldassignment The data record for the old assignment
param: stdClass $oldsubmission The data record for the old submission
param: stdClass $submission The new submission record
param: string $log Record upgrade messages in the log
return: bool true or false - false will trigger a rollback

allow_submissions()   X-Ref
The submission comments plugin has no submission component so should not be counted
when determining whether to show the edit submission link.

return: boolean

is_enabled()   X-Ref
Automatically enable or disable this plugin based on "$CFG->commentsenabled"

return: bool

is_configurable()   X-Ref
Automatically hide the setting for the submission plugin.

return: bool

get_config_for_external()   X-Ref
Return the plugin configs for external functions.

return: array the list of settings