Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Privacy Subsystem implementation for mod_assignment.

Copyright: 2018 Zig Tan <zig@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 548 lines (23 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: provider  - X-Ref

Implementation of the privacy subsystem plugin provider for mod_assignment.

get_metadata(collection $collection)   X-Ref
Return the fields which contain personal data.

return: collection the updated collection of metadata items.
param: collection $collection a reference to the collection to use to store the metadata.

get_contexts_for_userid(int $userid)   X-Ref
Get the list of contexts that contain user information for the specified user.

return: contextlist the list of contexts containing user info for the user.
param: int $userid the 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
Export personal data for the given approved_contextlist.
User and context information is contained within the contextlist.

param: approved_contextlist $contextlist a list of contexts approved for export.

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.

delete_data_for_all_users_in_context(\context $context)   X-Ref
Delete all data for all users in the specified context.

param: \context $context the context to delete in.

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 a list of contexts approved for deletion.

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.

has_marked_assignment_submissions($assignmentid, $userid)   X-Ref
Helper function to check if a user has marked assignment submissions for a given assignment.

return: bool             If user has marked associated submissions returns true, otherwise false.
param: int $assignmentid The assignment ID to check if user has marked associated submissions.
param: int $userid       The user ID to check if user has marked associated submissions.

get_assignment_by_context($context)   X-Ref
Helper function to return assignment for a context module.

return: mixed            The assignment details or null record associated with the context module.
param: object $context   The context module object to return the assignment record by.

get_assignment_submissions_by_contextlist($contextlist, $userid, $teacher = false)   X-Ref
Helper function to return assignment submissions submitted by / marked by a user and their contextlist.

return: array                Array of assignment submission details.
param: object $contextlist   Object with the contexts related to a userid to retrieve assignment submissions by.
param: int $userid           The user ID to find assignment submissions that were submitted by.
param: bool $teacher         The teacher status to determine if marked assignment submissions should be returned.

get_assignment_submissions_by_assignment($assignmentid, $userid, $teacher = false)   X-Ref
Helper function to retrieve assignment submissions submitted by / marked by a user for a specific assignment.

return: array                Array of assignment submissions details.
param: int $assignmentid     The assignment ID to retrieve assignment submissions by.
param: int $userid           The user ID to retrieve assignment submissions submitted / marked by.
param: bool $teacher         The teacher status to determine if marked assignment submissions should be returned.

get_assignment_output($assignmentdata)   X-Ref
Helper function generate assignment output object for exporting.

return: object                   Formatted assignment output object for exporting.
param: object $assignmentdata    Object containing assignment data.

get_assignment_submission_output($submissiondata)   X-Ref
Helper function generate assignment submission output object for exporting.

return: object                   Formatted assignment submission output for exporting.
param: object $submissiondata    Object containing assignment submission data.