Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403]

Privacy class for requesting user data.

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

Defines 1 class


Class: provider  - X-Ref

Privacy class for requesting user data.

get_metadata(collection $collection)   X-Ref
Provides meta data that is stored about a user with mod_assign

param: collection $collection A collection of meta data items to be added to.
return: collection Returns the collection of metadata.

get_contexts_for_userid(int $userid)   X-Ref
Returns all of the contexts that has information relating to the userid.

param: int $userid The user ID.
return: contextlist an object with the contexts related to a userid.

get_users_in_context(userlist $userlist)   X-Ref
Get the list of users who have data within a context.

param: userlist    $userlist   The userlist containing the list of users who have data in this context/plugin combination.

export_user_data(approved_contextlist $contextlist)   X-Ref
Write out the user data filtered by contexts.

param: approved_contextlist $contextlist contexts that we are writing data out from.

delete_data_for_all_users_in_context(\context $context)   X-Ref
Delete all use data which matches the specified context.

param: \context $context The module context.

delete_data_for_user(approved_contextlist $contextlist)   X-Ref
Delete all user data for the specified user, in the specified contexts.

param: approved_contextlist $contextlist The approved contexts and user information to delete information for.

delete_data_for_users(approved_userlist $userlist)   X-Ref
Delete multiple users within a single context.

param: approved_userlist $userlist The approved context and user information to delete information for.

delete_overrides_for_users(\assign $assign, array $userids = [])   X-Ref
Deletes assignment overrides in bulk

param: \assign $assign  The assignment object
param: array   $userids An array of user IDs

get_graded_users(int $userid, \assign $assign)   X-Ref
Find out if this user has graded any users.

param: int $userid The user ID (potential teacher).
param: \assign $assign The assignment object.
return: array If successful an array of objects with userids that this user graded, otherwise false.

store_assign_user_flags(\context $context, \assign $assign, int $userid)   X-Ref
Writes out various user meta data about the assignment.

param: \context $context The context of this assignment.
param: \assign $assign The assignment object.
param: int $userid The user ID

export_grade_data(\stdClass $grade, \context $context, array $currentpath)   X-Ref
Formats and then exports the user's grade data.

param: \stdClass $grade The assign grade object
param: \context $context The context object
param: array $currentpath Current directory path that we are exporting to.

export_submission_data(\stdClass $submission, \context $context, array $currentpath)   X-Ref
Formats and then exports the user's submission data.

param: \stdClass $submission The assign submission object
param: \context $context The context object
param: array $currentpath Current directory path that we are exporting to.

export_user_preferences(int $userid)   X-Ref
Stores the user preferences related to mod_assign.

param: int $userid The user ID that we want the preferences for.

export_overrides(\context $context, \assign $assign, \stdClass $user)   X-Ref
Export overrides for this assignment.

param: \context $context Context
param: \assign $assign The assign object.
param: \stdClass $user The user object.

export_submission(\assign $assign, \stdClass $user, \context_module $context, array $path,bool $exportforteacher = false)   X-Ref
Exports assignment submission data for a user.

param: \assign         $assign           The assignment object
param: \stdClass        $user             The user object
param: \context_module $context          The context
param: array           $path             The path for exporting data
param: bool|boolean    $exportforteacher A flag for if this is exporting data as a teacher.