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 test for the event monitor

Copyright: 2018 Zig Tan <zig@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 788 lines (33 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 mod/assignment/lib.php

Defines 1 class


Class: provider_test  - X-Ref

Privacy test for the event monitor

test_get_contexts_for_userid()   X-Ref
Test for provider::get_contexts_for_userid().


test_get_users_in_context()   X-Ref
Test that the correct userids are returned for a specific context.


test_export_user_data_teacher()   X-Ref
Test for provider::export_user_data().


test_export_user_data_student()   X-Ref
Test for provider::export_user_data().


test_delete_data_for_all_users_in_context()   X-Ref
Test for provider::delete_data_for_all_users_in_context().


test_delete_data_for_user()   X-Ref
Test for provider::delete_data_for_user().


test_delete_data_for_users()   X-Ref
Test the deletion of a data for users.


create_courses_and_assignments()   X-Ref
Helper function to setup Course, users, and assignments for testing.


add_assignment_submission($assignment, $user, $submissiondata)   X-Ref
Helper function to add an assignment submission for testing.

param: object $assignment        Object containing assignment submission details to create for testing.
param: object $user              Object of the user making the assignment submission.
param: string $submissiondata    The onlintext string value of the assignment submission.

add_file_assignment_submission($assignment, $user, $submissiondata, $filename, $numfiles = 1)   X-Ref
Helper function to add an assignment submission with file submissions for testing.

param: object $assignment        Object containing assignment submission details to create for testing.
param: object $user              Object of the user making the assignment submission.
param: string $submissiondata    The onlintext string value of the assignment submission.
param: string $filename          The filename of the file submission included with the assignment submission.
param: int $numfiles             The number of files included with the assignment submission.

get_course_assignment_submissions($courseid)   X-Ref
Helper function to retrieve the assignment submission records for a given course.

param: int $courseid     The course ID to get assignment submissions by.
return: array            Array of assignment submission details.

mark_assignment_submission($assignmentid, $submissionid, $teacher, $gradedata)   X-Ref
Helper function to update an assignment submission with grading details for a teacher.

param: int $assignmentid     The assignment ID to update assignment submissions with marking/graded details.
param: int $submissionid     The assignment submission ID to update with marking/grading details.
param: int $teacher          The teacher user ID to making the marking/grading details.
param: int $gradedata        The grade value set for the marking/grading details.

get_assignments($contextid)   X-Ref
Helper function to retrieve the assignment records for a given context.

param: int $contextid    The context module ID value to retrieve assignment IDs by.
return: array            Array of assignment IDs.

get_assignment_submissions($contextid)   X-Ref
Helper function to retrieve the assignment submission records for a given context.

param: int $contextid    The context module ID value to retrieve assignment submission IDs by.
return: array            Array of assignment submission IDs.