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.

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.

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

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

param: int $userid the userid.
return: contextlist the list of contexts containing user info for the user.

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.

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.
return: bool             If user has marked associated submissions returns true, otherwise false.

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

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

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.

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.
return: array                Array of assignment submission details.

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.

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.
return: array                Array of assignment submissions details.

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

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

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

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