Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
core_question\privacy\provider Class Reference

Privacy Subsystem implementation for core_question. More...

Inheritance diagram for core_question\privacy\provider:
core_privacy\local\metadata\provider core_privacy\local\request\subsystem\provider core_privacy\local\request\subsystem\plugin_provider core_privacy\local\request\core_userlist_provider core_privacy\local\request\shared_userlist_provider core_privacy\local\request\core_user_data_provider core_privacy\local\request\shared_data_provider core_privacy\local\request\userlist_provider core_privacy\local\request\userlist_provider core_privacy\local\request\core_data_provider core_privacy\local\request\data_provider core_privacy\local\request\data_provider

Static Public Member Functions

static delete_data_for_all_users_in_context (\context $context)
 Delete all data for all users in the specified context.
 
static delete_data_for_user (approved_contextlist $contextlist)
 Delete all user data for the specified user, in the specified contexts.
 
static delete_data_for_users (approved_userlist $userlist)
 Delete multiple users within a single context.
 
static export_question_attempt_steps (int $userid, context $context, array $questionnocontext, question_attempt $qa, question_display_options $options, $isowner)
 Export the data for each step transition for each question in each question attempt.
 
static export_question_usage (int $userid, context $context, array $usagecontext, int $usage, question_display_options $options, bool $isowner)
 Export the data for all question attempts on this question usage.
 
static export_user_data (approved_contextlist $contextlist)
 Export all user data for the specified user, in the specified contexts.
 
static get_contexts_for_userid (int $userid)
 Get the list of contexts where the specified user has either created, or edited a question.
 
static get_metadata (collection $items)
 Describe the types of data stored by the question subsystem.
 
static get_related_question_usages_for_user (string $prefix, string $component, string $joinfield, int $userid)
 Determine related question usages for a user.
 
static get_users_in_context (userlist $userlist)
 Get the list of users who have data within a context.
 
static get_users_in_context_from_sql (userlist $userlist, string $prefix, string $insql, $params, int $contextid=null)
 Add the list of users who have rated in the specified constraints.
 

Detailed Description

Privacy Subsystem implementation for core_question.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ delete_data_for_all_users_in_context()

static core_question\privacy\provider::delete_data_for_all_users_in_context ( \context $context)
static

Delete all data for all users in the specified context.

Parameters
context$contextThe specific context to delete data for.
Exceptions
dml_exception

Implements core_privacy\local\request\core_user_data_provider.

◆ delete_data_for_user()

static core_question\privacy\provider::delete_data_for_user ( approved_contextlist $contextlist)
static

Delete all user data for the specified user, in the specified contexts.

Parameters
approved_contextlist$contextlistThe approved contexts and user information to delete information for.

Implements core_privacy\local\request\core_user_data_provider.

◆ delete_data_for_users()

static core_question\privacy\provider::delete_data_for_users ( approved_userlist $userlist)
static

Delete multiple users within a single context.

Parameters
approved_userlist$userlistThe approved context and user information to delete information for.

Implements core_privacy\local\request\core_userlist_provider.

◆ export_question_attempt_steps()

static core_question\privacy\provider::export_question_attempt_steps ( int $userid,
context $context,
array $questionnocontext,
question_attempt $qa,
question_display_options $options,
$isowner )
static

Export the data for each step transition for each question in each question attempt.

Where a user is the owner of the usage, then all steps in the question usage will be exported. Where a user is not the owner, but has been involved in the usage, then only their specific involvement will be exported.

Parameters
int$useridThe user to export for
context$contextThe context that the question was used within.
array$questionnocontextThe subcontext of this question number.
question_attempt$qaThe attempt being checked
question_display_options$optionsThe display options used for formatting.
bool$isownerWhether the user being exported is the user who used the question.

◆ export_question_usage()

static core_question\privacy\provider::export_question_usage ( int $userid,
context $context,
array $usagecontext,
int $usage,
question_display_options $options,
bool $isowner )
static

Export the data for all question attempts on this question usage.

Where a user is the owner of the usage, then the full detail of that usage will be included. Where a user has been involved in the usage, but it is not their own usage, then only their specific involvement will be exported.

Parameters
int$useridThe userid to export.
context$contextThe context that the question was used within.
array$usagecontextThe subcontext of this usage.
int$usageThe question usage ID.
question_display_options$optionsThe display options used for formatting.
bool$isownerWhether the user being exported is the user who used the question.

◆ export_user_data()

static core_question\privacy\provider::export_user_data ( approved_contextlist $contextlist)
static

Export all user data for the specified user, in the specified contexts.

Parameters
approved_contextlist$contextlistThe approved contexts to export information for.

Implements core_privacy\local\request\core_user_data_provider.

◆ get_contexts_for_userid()

static core_question\privacy\provider::get_contexts_for_userid ( int $userid)
static

Get the list of contexts where the specified user has either created, or edited a question.

To export usage of a question, please call provider::export_question_usage() from the module which instantiated the usage of the question.

Parameters
int$useridThe user to search.
Return values
contextlist\$contextlistThe contextlist containing the list of contexts used in this plugin.

Implements core_privacy\local\request\core_user_data_provider.

◆ get_metadata()

static core_question\privacy\provider::get_metadata ( collection $items)
static

Describe the types of data stored by the question subsystem.

Parameters
collection$itemsThe collection to add metadata to.
Return values
collectionThe array of metadata

Implements core_privacy\local\metadata\provider.

◆ get_related_question_usages_for_user()

static core_question\privacy\provider::get_related_question_usages_for_user ( string $prefix,
string $component,
string $joinfield,
int $userid )
static

Determine related question usages for a user.

Parameters
string$prefixA unique prefix to add to the table alias
string$componentThe name of the component to fetch usages for.
string$joinfieldThe SQL field name to use in the JOIN ON - e.g. q.usageid
int$useridThe user to search.
Return values
qubaid_join

◆ get_users_in_context()

static core_question\privacy\provider::get_users_in_context ( userlist $userlist)
static

Get the list of users who have data within a context.

Parameters
userlist$userlistThe userlist containing the list of users who have data in this context/plugin combination.

Implements core_privacy\local\request\core_userlist_provider.

◆ get_users_in_context_from_sql()

static core_question\privacy\provider::get_users_in_context_from_sql ( userlist $userlist,
string $prefix,
string $insql,
$params,
int $contextid = null )
static

Add the list of users who have rated in the specified constraints.

Parameters
userlist$userlistThe userlist to add the users to.
string$prefixA unique prefix to add to the table alias to avoid interference with your own sql.
string$insqlThe SQL to use in a sub-select for the question_usages.id query.
array$paramsThe params required for the insql.
int | null$contextidAn optional context id, in case the $sql query is not already filtered by that.

The documentation for this class was generated from the following file: