Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 402] [Versions 310 and 403]

Defines {@link \mod_workshop\privacy\provider} class.

Copyright: 2018 David Mudrák <david@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 885 lines (42 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: provider  - X-Ref

Privacy API implementation for the Workshop activity module.

get_metadata(collection $collection)   X-Ref
Describe all the places where the Workshop module stores some personal data.

param: collection $collection Collection of items to add metadata to.
return: collection Collection with our added items.

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

User has personal data in the workshop if any of the following cases happens:

- the user has submitted in the workshop
- the user has overridden a submission grade
- the user has been assigned as a reviewer of a submission
- the user has overridden a grading grade
- the user has a grading grade (existing or to be calculated)

param: int $userid ID of the user.
return: contextlist List of contexts containing the user's personal data.

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

param: userlist $userlist To be filled list of users who have data in this context/plugin combination.

export_user_data(approved_contextlist $contextlist)   X-Ref
Export personal data stored in the given contexts.

param: approved_contextlist $contextlist List of contexts approved for export.

export_user_preferences(int $userid)   X-Ref
Export user preferences controlled by this plugin.

param: int $userid ID of the user we are exporting data for

append_extra_workshop_data(\context $context, \stdClass $user, \stdClass $data, array $subcontext)   X-Ref
Append additional relevant data into the base data about the workshop instance.

Relevant are data that are important for interpreting or evaluating the performance of the user expressed in
his/her exported personal data. For example, we need to know what were the instructions for submissions or what
was the phase of the workshop when it was exported.

param: context $context Workshop module content.
param: stdClass $user User for which we are exporting data.
param: stdClass $data Base data about the workshop instance to append to.
param: array $subcontext Subcontext path items to eventually write files into.

export_submissions(approved_contextlist $contextlist)   X-Ref
Export all user's submissions and example submissions he/she created in the given contexts.

param: approved_contextlist $contextlist List of contexts approved for export.

export_assessments(approved_contextlist $contextlist)   X-Ref
Export all assessments given by the user.

param: approved_contextlist $contextlist List of contexts approved for export.

export_assessment_forms(\stdClass $user, \context $context, array $subcontext, int $assessmentid)   X-Ref
Export the grading strategy data related to the particular assessment.

param: stdClass $user User we are exporting for
param: context $context Workshop activity content
param: array $subcontext Subcontext path of the assessment
param: int $assessmentid ID of the exported assessment

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

param: context $context Context to delete personal data from.

delete_data_for_user(approved_contextlist $contextlist)   X-Ref
Delete personal data for the user in a list of contexts.

Removing assessments of submissions from the Workshop is not trivial. Removing one user's data can easily affect
other users' grades and completion criteria. So we replace the non-essential contents with a "deleted" message,
but keep the actual info in place. The argument is that one's right for privacy should not overweight others'
right for accessing their own personal data and be evaluated on their basis.

param: approved_contextlist $contextlist List of contexts to delete data from.

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

See documentation for {@link self::delete_data_for_user()} for more details on what we do and don't actually
delete and why.

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

get_user_prefs()   X-Ref
Get the user preferences.

return: array List of user preferences