original_string: protected static function export_submission(\assign $assign, \stdClass $user, \context_module $context, array $path,
              bool $exportforteacher = false) {
          $submissions = $assign->get_all_submissions($user->id);
          $teacher = ($exportforteacher) ? $user : null;
          $gradingmanager = get_grading_manager($context, 'mod_assign', 'submissions');
          $controller = $gradingmanager->get_active_controller();
          foreach ($submissions as $submission) {
              // Attempt numbers start at zero, which is fine for programming, but doesn't make as much sense
              // for users.
              $submissionpath = array_merge($path,
                      [get_string('privacy:attemptpath', 'mod_assign', ($submission->attemptnumber + 1))]);
  
              $params = new assign_plugin_request_data($context, $assign, $submission, $submissionpath ,$teacher);
              manager::plugintype_class_callback('assignsubmission', self::ASSIGNSUBMISSION_INTERFACE,
                      'export_submission_user_data', [$params]);
              if (!isset($teacher)) {
                  self::export_submission_data($submission, $context, $submissionpath);
              }
              $grade = $assign->get_user_grade($user->id, false, $submission->attemptnumber);
              if ($grade) {
                  $params = new assign_plugin_request_data($context, $assign, $grade, $submissionpath, $teacher);
                  manager::plugintype_class_callback('assignfeedback', self::ASSIGNFEEDBACK_INTERFACE, 'export_feedback_user_data',
                          [$params]);
  
                  self::export_grade_data($grade, $context, $submissionpath);
                  // Check for advanced grading and retrieve that information.
                  if (isset($controller)) {
                      \core_grading\privacy\provider::export_item_data($context, $grade->id, $submissionpath);
                  }
              }
          }
      }
code: protected static function export_submission(\assign $assign, \stdClass $user, \context_module $context, array $path,
              bool $exportforteacher = false) {
          $submissions = $assign->get_all_submissions($user->id);
          $teacher = ($exportforteacher) ? $user : null;
          $gradingmanager = get_grading_manager($context, 'mod_assign', 'submissions');
          $controller = $gradingmanager->get_active_controller();
          foreach ($submissions as $submission) {
              // Attempt numbers start at zero, which is fine for programming, but doesn't make as much sense
              // for users.
              $submissionpath = array_merge($path,
                      [get_string('privacy:attemptpath', 'mod_assign', ($submission->attemptnumber + 1))]);
  
              $params = new assign_plugin_request_data($context, $assign, $submission, $submissionpath ,$teacher);
              manager::plugintype_class_callback('assignsubmission', self::ASSIGNSUBMISSION_INTERFACE,
                      'export_submission_user_data', [$params]);
              if (!isset($teacher)) {
                  self::export_submission_data($submission, $context, $submissionpath);
              }
              $grade = $assign->get_user_grade($user->id, false, $submission->attemptnumber);
              if ($grade) {
                  $params = new assign_plugin_request_data($context, $assign, $grade, $submissionpath, $teacher);
                  manager::plugintype_class_callback('assignfeedback', self::ASSIGNFEEDBACK_INTERFACE, 'export_feedback_user_data',
                          [$params]);
  
                  self::export_grade_data($grade, $context, $submissionpath);
                  // Check for advanced grading and retrieve that information.
                  if (isset($controller)) {
                      \core_grading\privacy\provider::export_item_data($context, $grade->id, $submissionpath);
                  }
              }
          }
      }
code_tokens: protected static function export_submission ( \ assign $ assign , \ stdClass $ user , \ context_module $ context , array $ path , bool $ exportforteacher = false ) { $ submissions = $ assign -> get_all_submissions ( $ user -> id ) ; $ teacher = ( $ exportforteacher ) ? $ user : null ; $ gradingmanager = get_grading_manager ( $ context , 'mod_assign' , 'submissions' ) ; $ controller = $ gradingmanager -> get_active_controller ( ) ; foreach ( $ submissions as $ submission ) { // Attempt numbers start at zero, which is fine for programming, but doesn't make as much sense // for users. $ submissionpath = array_merge ( $ path , [ get_string ( 'privacy:attemptpath' , 'mod_assign' , ( $ submission -> attemptnumber + 1 ) ) ] ) ; $ params = new assign_plugin_request_data ( $ context , $ assign , $ submission , $ submissionpath , $ teacher ) ; manager :: plugintype_class_callback ( 'assignsubmission' , self :: ASSIGNSUBMISSION_INTERFACE , 'export_submission_user_data' , [ $ params ] ) ; if ( ! isset ( $ teacher ) ) { self :: export_submission_data ( $ submission , $ context , $ submissionpath ) ; } $ grade = $ assign -> get_user_grade ( $ user -> id , false , $ submission -> attemptnumber ) ; if ( $ grade ) { $ params = new assign_plugin_request_data ( $ context , $ assign , $ grade , $ submissionpath , $ teacher ) ; manager :: plugintype_class_callback ( 'assignfeedback' , self :: ASSIGNFEEDBACK_INTERFACE , 'export_feedback_user_data' , [ $ params ] ) ; self :: export_grade_data ( $ grade , $ context , $ submissionpath ) ; // Check for advanced grading and retrieve that information. if ( isset ( $ controller ) ) { \ core_grading \ privacy \ provider :: export_item_data ( $ context , $ grade -> id , $ submissionpath ) ; } } } }
docstring: Exports assignment submission data for a user.
  
  @param  \assign         $assign           The assignment object
  @param  \stdClass        $user             The user object
  @param  \context_module $context          The context
  @param  array           $path             The path for exporting data
  @param  bool|boolean    $exportforteacher A flag for if this is exporting data as a teacher.
docstring_tokens: Exports assignment submission data for a user .