Calling this function should delete all user data associated with this grade.

@param  assign_plugin_request_data $requestdata Data useful for deleting user data.
182782
public static function delete_feedback_for_grade(assign_plugin_request_data $requestdata) {
        $requestdata->set_userids([$requestdata->get_user()->id]);
        $requestdata->populate_submissions_and_grades();
        self::delete_feedback_for_grades($requestdata);
    }
1126443
public function validate(array $requestData)
    {
        $ourData = Hash::extract($requestData, $this->getInputName());

        foreach ($this->getAttributeNames() as $name) {

            $validations = $this->extractNormalizedValidations($name);
            foreach ($validations as $validationKey => $validatorConfig) {

                $validator = Validator::factory($validationKey);
                $validator->configure($validatorConfig);
                $validator->init();

                if (!array_key_exists($name, $ourData) || !$validator->test($ourData[$name], $this)) {
                    $this->setValidationError($name, $validationKey, $validator->getMessage());
                }
            }
        }

        return !$this->hasValidationErrors();
    }
1085812
public function setSubscriptionUsageData(SetUsageData\RequestData $requestData)
    {
        $request = new SetUsageData\Request($requestData);

        return $this->sendRequest($request, SetUsageData\ApiResponse::class);
    }
833896
protected function delete_assignment()
    {
        $uri = str_replace('{assignment}', $this->assignment, config('forge-publish.update_assignment_uri'));
        $url = config('forge-publish.url') . $uri;
        try {
            $response = $this->http->delete($url, [
                'headers' => [
                    'X-Requested-With' => 'XMLHttpRequest',
                    'Authorization' => 'Bearer ' . fp_env('ACACHA_FORGE_ACCESS_TOKEN')
                ]
            ]);
        } catch (\Exception $e) {
            $this->error('And error occurs connecting to the api url: ' . $url);
            $this->error('Status code: ' . $e->getResponse()->getStatusCode() . ' | Reason : ' . $e->getResponse()->getReasonPhrase());
            return [];
        }
    }
978916
public static function delete_submission_for_userid(assign_plugin_request_data $deletedata) {
        global $DB;

        \core_plagiarism\privacy\provider::delete_plagiarism_for_user($deletedata->get_user()->id, $deletedata->get_context());

        $submissionid = $deletedata->get_pluginobject()->id;

        // Delete related files.
        $fs = get_file_storage();
        $fs->delete_area_files($deletedata->get_context()->id, 'assignsubmission_onlinetext', ASSIGNSUBMISSION_ONLINETEXT_FILEAREA,
                $submissionid);

        // Delete the records in the table.
        $DB->delete_records('assignsubmission_onlinetext', ['assignment' => $deletedata->get_assignid(),
                'submission' => $submissionid]);
    }
197558
public static function delete_submission_for_userid(assign_plugin_request_data $exportdata) {
        // Create an approved context list to delete the comments.
        $contextlist = new \core_privacy\local\request\approved_contextlist($exportdata->get_user(), 'assignsubmission_comments',
            [$exportdata->get_context()->id]);
        comments_provider::delete_comments_for_user($contextlist, 'assignsubmission_comments', 'submission_comments');
    }
1042091
public function post($requestUri, array $postData = [])
    {
        return $this->exec(
            [
                CURLOPT_URL => $requestUri,
                CURLOPT_POSTFIELDS => http_build_query($postData),
            ]
        );
    }
854204
public function delete($data = false)
    {    
		if ($this->name == 'partner') return;
        if ($data) {
            $schema = new Schema();  
            $schema->dropSchema($this->name);      
        }
        Util::delTree(WWWROOT.PLUGIN_DIR.'/'.$this->name);
    }
539781
public function deleteAction(Request $request, Role $role, RoleAssignment $roleAssignment): Response
    {
        $this->denyAccessUnlessGranted(new Attribute('role', 'assign'));
        $form = $this->formFactory->deleteRoleAssignment(
            new RoleAssignmentDeleteData($roleAssignment)
        );
        $form->handleRequest($request);

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function (RoleAssignmentDeleteData $data) use ($role) {
                $roleAssignment = $data->getRoleAssignment();
                $this->roleService->removeRoleAssignment($roleAssignment);

                $this->notificationHandler->success(
                    $this->translator->trans(
                        /** @Desc("Assignment on role '%role%' removed.") */
                        'role.assignment_delete.success',
                        ['%role%' => $role->identifier],
                        'role'
                    )
                );

                return new RedirectResponse($this->generateUrl('ezplatform.role.view', [
                    'roleId' => $role->id,
                ]));
            });

            if ($result instanceof Response) {
                return $result;
            }
        }

        return $this->redirect($this->generateUrl('ezplatform.role.view', [
            'roleId' => $role->id,
        ]));
    }
1329309
public function reset_userdata($data) {
        global $CFG, $DB;

        $componentstr = get_string('modulenameplural', 'assign');
        $status = array();

        $fs = get_file_storage();
        if (!empty($data->reset_assign_submissions)) {
            // Delete files associated with this assignment.
            foreach ($this->submissionplugins as $plugin) {
                $fileareas = array();
                $plugincomponent = $plugin->get_subtype() . '_' . $plugin->get_type();
                $fileareas = $plugin->get_file_areas();
                foreach ($fileareas as $filearea => $notused) {
                    $fs->delete_area_files($this->context->id, $plugincomponent, $filearea);
                }

                if (!$plugin->delete_instance()) {
                    $status[] = array('component'=>$componentstr,
                                      'item'=>get_string('deleteallsubmissions', 'assign'),
                                      'error'=>$plugin->get_error());
                }
            }

            foreach ($this->feedbackplugins as $plugin) {
                $fileareas = array();
                $plugincomponent = $plugin->get_subtype() . '_' . $plugin->get_type();
                $fileareas = $plugin->get_file_areas();
                foreach ($fileareas as $filearea => $notused) {
                    $fs->delete_area_files($this->context->id, $plugincomponent, $filearea);
                }

                if (!$plugin->delete_instance()) {
                    $status[] = array('component'=>$componentstr,
                                      'item'=>get_string('deleteallsubmissions', 'assign'),
                                      'error'=>$plugin->get_error());
                }
            }

            $assignids = $DB->get_records('assign', array('course' => $data->courseid), '', 'id');
            list($sql, $params) = $DB->get_in_or_equal(array_keys($assignids));

            $DB->delete_records_select('assign_submission', "assignment $sql", $params);
            $DB->delete_records_select('assign_user_flags', "assignment $sql", $params);

            $status[] = array('component'=>$componentstr,
                              'item'=>get_string('deleteallsubmissions', 'assign'),
                              'error'=>false);

            if (!empty($data->reset_gradebook_grades)) {
                $DB->delete_records_select('assign_grades', "assignment $sql", $params);
                // Remove all grades from gradebook.
                require_once($CFG->dirroot.'/mod/assign/lib.php');
                assign_reset_gradebook($data->courseid);
            }

            // Reset revealidentities for assign if blindmarking is enabled.
            if ($this->get_instance()->blindmarking) {
                $DB->set_field('assign', 'revealidentities', 0, array('id' => $this->get_instance()->id));
            }
        }

        // Remove user overrides.
        if (!empty($data->reset_assign_user_overrides)) {
            $DB->delete_records_select('assign_overrides',
                'assignid IN (SELECT id FROM {assign} WHERE course = ?) AND userid IS NOT NULL', array($data->courseid));
            $status[] = array(
                'component' => $componentstr,
                'item' => get_string('useroverridesdeleted', 'assign'),
                'error' => false);
        }
        // Remove group overrides.
        if (!empty($data->reset_assign_group_overrides)) {
            $DB->delete_records_select('assign_overrides',
                'assignid IN (SELECT id FROM {assign} WHERE course = ?) AND groupid IS NOT NULL', array($data->courseid));
            $status[] = array(
                'component' => $componentstr,
                'item' => get_string('groupoverridesdeleted', 'assign'),
                'error' => false);
        }

        // Updating dates - shift may be negative too.
        if ($data->timeshift) {
            $DB->execute("UPDATE {assign_overrides}
                         SET allowsubmissionsfromdate = allowsubmissionsfromdate + ?
                       WHERE assignid = ? AND allowsubmissionsfromdate <> 0",
                array($data->timeshift, $this->get_instance()->id));
            $DB->execute("UPDATE {assign_overrides}
                         SET duedate = duedate + ?
                       WHERE assignid = ? AND duedate <> 0",
                array($data->timeshift, $this->get_instance()->id));
            $DB->execute("UPDATE {assign_overrides}
                         SET cutoffdate = cutoffdate + ?
                       WHERE assignid =? AND cutoffdate <> 0",
                array($data->timeshift, $this->get_instance()->id));

            // Any changes to the list of dates that needs to be rolled should be same during course restore and course reset.
            // See MDL-9367.
            shift_course_mod_dates('assign',
                                    array('duedate', 'allowsubmissionsfromdate', 'cutoffdate'),
                                    $data->timeshift,
                                    $data->courseid, $this->get_instance()->id);
            $status[] = array('component'=>$componentstr,
                              'item'=>get_string('datechanged'),
                              'error'=>false);
        }

        return $status;
    }
525151
public static function export_feedback_user_data(assign_plugin_request_data $exportdata) {
        $currentpath = $exportdata->get_subcontext();
        $currentpath[] = get_string('privacy:path', 'assignfeedback_file');
        $assign = $exportdata->get_assign();
        $plugin = $assign->get_plugin_by_type('assignfeedback', 'file');
        $gradeid = $exportdata->get_pluginobject()->id;
        $filefeedback = $plugin->get_file_feedback($gradeid);
        if ($filefeedback) {
            $fileareas = $plugin->get_file_areas();
            foreach ($fileareas as $filearea => $notused) {
                \core_privacy\local\request\writer::with_context($exportdata->get_context())
                        ->export_area_files($currentpath, 'assignfeedback_file', $filearea, $gradeid);
            }
        }
    }
1299141
public function assignRequest(Request $request)
    {
        $extracted = $this->extractData($request);

        if (count($extracted)) {
            foreach ($this->getAttributeNames() as $key) {
                if (array_key_exists($key, $extracted)) {
                    $this->{$key} = $extracted[$key];
                }
            }
            return true;
        }

        return false;
    }
559803
public function setSubscriptionAddon(SetAddon\RequestData $requestData)
    {
        $request = new SetAddon\Request($requestData);

        return $this->sendRequest($request, SetAddon\ApiResponse::class);
    }
1342597
protected function delete($uri, array $data = [])
    {
        $this->call('DELETE', $uri, $data, $this->cookies, [], $this->headers);

        return $this;
    }
1357091
public function changeSubscriptionArticle(ChangeArticle\RequestData $requestData)
    {
        $request = new ChangeArticle\Request($requestData);

        return $this->sendRequest($request, ChangeArticle\ApiResponse::class);
    }
1300944
public function process($formdata, $data = null)
    {
        parent::process($formdata, $data);
        $this->current_token = $this->csrf_impl->generateCSRFToken($this);
    }
858615
public static function delete_data_for_all_users_in_context(\context $context) {
        global $DB;

        if (!$context instanceof \context_course) {
            return;
        }

        $DB->delete_records('enrol_paypal', array('courseid' => $context->instanceid));
    }