Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

This file contains the polyfill to allow a plugin to operate with Moodle 3.3 up.

Copyright: 2018 Adrian Greeve <adrian@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 101 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 5 functions


Functions that are not part of a class:

get_context_for_userid_within_submission(int $userid, contextlist $contextlist)   X-Ref
Retrieves the contextids associated with the provided userid for this subplugin.
NOTE if your subplugin must have an entry in the assign_submission table to work, then this
method can be empty.

param: int $userid The user ID to get context IDs for.
param: \core_privacy\local\request\contextlist $contextlist Use add_from_sql with this object to add your context IDs.

get_student_user_ids(useridlist $useridlist)   X-Ref
Returns student user ids related to the provided teacher ID. If it is possible that a student ID will not be returned by
the sql query in \mod_assign\privacy\provider::find_grader_info() Then you need to provide some sql to retrive those
student IDs. This is highly likely if you had to fill in get_context_for_userid_within_submission above.

param: useridlist $useridlist A user ID list object that you can append your user IDs to.

export_submission_user_data(assign_plugin_request_data $exportdata)   X-Ref
This method is used to export any user data this sub-plugin has using the assign_plugin_request_data object to get the
context and userid.
assign_plugin_request_data contains:
- context
- submission object
- current path (subcontext)
- user object

param: assign_plugin_request_data $exportdata Information to use to export user data for this sub-plugin.

delete_submission_for_context(assign_plugin_request_data $requestdata)   X-Ref
Any call to this method should delete all user data for the context defined in the deletion_criteria.
assign_plugin_request_data contains:
- context
- assign object

param: assign_plugin_request_data $requestdata Information to use to delete user data for this submission.

delete_submission_for_userid(assign_plugin_request_data $exportdata)   X-Ref
A call to this method should delete user data (where practicle) from the userid and context.
assign_plugin_request_data contains:
- context
- submission object
- user object
- assign object

param: assign_plugin_request_data $exportdata Details about the user and context to focus the deletion.