Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

This file contains the mod_assign assign_plugin_request_data class For assign plugin privacy data to fulfill requests.

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

Defines 1 class

assign_plugin_request_data:: (14 methods):
  __construct()
  set_userids()
  get_context()
  get_pluginobject()
  get_subcontext()
  get_user()
  get_assign()
  get_assignid()
  get_userids()
  get_submissionids()
  get_submissions()
  get_gradeids()
  get_grades()
  populate_submissions_and_grades()


Class: assign_plugin_request_data  - X-Ref

An object for fulfilling an assign plugin data request.

__construct(\context $context, \assign $assign, \stdClass $pluginobject = null, array $subcontext = [],\stdClass $user = null)   X-Ref
Object creator for assign plugin request data.

param: \context $context Context object.
param: \stdClass $pluginobject The grade object.
param: array  $subcontext Directory / file location.
param: \stdClass $user The user object.
param: \assign $assign The assign object.

set_userids(array $userids)   X-Ref
Method for adding an array of user IDs. This will do a query to populate the submissions and grades
for these users.

param: array $userids User IDs to do something with.

get_context()   X-Ref
Getter for this attribute.

return: context Context

get_pluginobject()   X-Ref
Getter for this attribute.

return: object The assign plugin object

get_subcontext()   X-Ref
Getter for this attribute.

return: array The location (path) that this data is being writter to.

get_user()   X-Ref
Getter for this attribute.

return: object The user id. If set then only information directly related to this user ID will be returned.

get_assign()   X-Ref
Getter for this attribute.

return: assign The assign object.

get_assignid()   X-Ref
A method to conveniently fetch the assign id.

return: int The assign id.

get_userids()   X-Ref
Get all of the user IDs

return: array User IDs

get_submissionids()   X-Ref
Returns all of the submission IDs

return: array submission IDs

get_submissions()   X-Ref
Returns the submissions related to the user IDs

return: array User submissions.

get_gradeids()   X-Ref
Returns the grade IDs related to the user IDs

return: array User grade IDs.

get_grades()   X-Ref
Returns the grades related to the user IDs

return: array User grades.

populate_submissions_and_grades()   X-Ref
Fetches all of the submissions and grades related to the User IDs provided. Use get_grades, get_submissions etc to
retrieve this information.