original_string: protected static function store_assign_user_flags(\context $context, \assign $assign, int $userid) {
          $datatypes = ['locked' => get_string('locksubmissions', 'mod_assign'),
                        'mailed' => get_string('privacy:metadata:mailed', 'mod_assign'),
                        'extensionduedate' => get_string('extensionduedate', 'mod_assign'),
                        'workflowstate' => get_string('markingworkflowstate', 'mod_assign'),
                        'allocatedmarker' => get_string('allocatedmarker_help', 'mod_assign')];
          $userflags = (array)$assign->get_user_flags($userid, false);
  
          foreach ($datatypes as $key => $description) {
              if (isset($userflags[$key]) && !empty($userflags[$key])) {
                  $value = $userflags[$key];
                  if ($key == 'locked' || $key == 'mailed') {
                      $value = transform::yesno($value);
                  } else if ($key == 'extensionduedate') {
                      $value = transform::datetime($value);
                  }
                  writer::with_context($context)->export_metadata([], $key, $value, $description);
              }
          }
      }
code: protected static function store_assign_user_flags(\context $context, \assign $assign, int $userid) {
          $datatypes = ['locked' => get_string('locksubmissions', 'mod_assign'),
                        'mailed' => get_string('privacy:metadata:mailed', 'mod_assign'),
                        'extensionduedate' => get_string('extensionduedate', 'mod_assign'),
                        'workflowstate' => get_string('markingworkflowstate', 'mod_assign'),
                        'allocatedmarker' => get_string('allocatedmarker_help', 'mod_assign')];
          $userflags = (array)$assign->get_user_flags($userid, false);
  
          foreach ($datatypes as $key => $description) {
              if (isset($userflags[$key]) && !empty($userflags[$key])) {
                  $value = $userflags[$key];
                  if ($key == 'locked' || $key == 'mailed') {
                      $value = transform::yesno($value);
                  } else if ($key == 'extensionduedate') {
                      $value = transform::datetime($value);
                  }
                  writer::with_context($context)->export_metadata([], $key, $value, $description);
              }
          }
      }
code_tokens: protected static function store_assign_user_flags ( \ context $ context , \ assign $ assign , int $ userid ) { $ datatypes = [ 'locked' => get_string ( 'locksubmissions' , 'mod_assign' ) , 'mailed' => get_string ( 'privacy:metadata:mailed' , 'mod_assign' ) , 'extensionduedate' => get_string ( 'extensionduedate' , 'mod_assign' ) , 'workflowstate' => get_string ( 'markingworkflowstate' , 'mod_assign' ) , 'allocatedmarker' => get_string ( 'allocatedmarker_help' , 'mod_assign' ) ] ; $ userflags = ( array ) $ assign -> get_user_flags ( $ userid , false ) ; foreach ( $ datatypes as $ key => $ description ) { if ( isset ( $ userflags [ $ key ] ) && ! empty ( $ userflags [ $ key ] ) ) { $ value = $ userflags [ $ key ] ; if ( $ key == 'locked' || $ key == 'mailed' ) { $ value = transform :: yesno ( $ value ) ; } else if ( $ key == 'extensionduedate' ) { $ value = transform :: datetime ( $ value ) ; } writer :: with_context ( $ context ) -> export_metadata ( [ ] , $ key , $ value , $ description ) ; } } }
docstring: Writes out various user meta data about the assignment.
  
  @param  \context $context The context of this assignment.
  @param  \assign $assign The assignment object.
  @param  int $userid The user ID
docstring_tokens: Writes out various user meta data about the assignment .