original_string: protected function process_save_submission(&$mform, &$notices) {
          global $CFG, $USER;
  
          // Include submission form.
          require_once($CFG->dirroot . '/mod/assign/submission_form.php');
  
          $userid = optional_param('userid', $USER->id, PARAM_INT);
          // Need submit permission to submit an assignment.
          require_sesskey();
          if (!$this->submissions_open($userid)) {
              $notices[] = get_string('duedatereached', 'assign');
              return false;
          }
          $instance = $this->get_instance();
  
          $data = new stdClass();
          $data->userid = $userid;
          $mform = new mod_assign_submission_form(null, array($this, $data));
          if ($mform->is_cancelled()) {
              return true;
          }
          if ($data = $mform->get_data()) {
              return $this->save_submission($data, $notices);
          }
          return false;
      }
code: protected function process_save_submission(&$mform, &$notices) {
          global $CFG, $USER;
  
          // Include submission form.
          require_once($CFG->dirroot . '/mod/assign/submission_form.php');
  
          $userid = optional_param('userid', $USER->id, PARAM_INT);
          // Need submit permission to submit an assignment.
          require_sesskey();
          if (!$this->submissions_open($userid)) {
              $notices[] = get_string('duedatereached', 'assign');
              return false;
          }
          $instance = $this->get_instance();
  
          $data = new stdClass();
          $data->userid = $userid;
          $mform = new mod_assign_submission_form(null, array($this, $data));
          if ($mform->is_cancelled()) {
              return true;
          }
          if ($data = $mform->get_data()) {
              return $this->save_submission($data, $notices);
          }
          return false;
      }
code_tokens: protected function process_save_submission ( & $ mform , & $ notices ) { global $ CFG , $ USER ; // Include submission form. require_once ( $ CFG -> dirroot . '/mod/assign/submission_form.php' ) ; $ userid = optional_param ( 'userid' , $ USER -> id , PARAM_INT ) ; // Need submit permission to submit an assignment. require_sesskey ( ) ; if ( ! $ this -> submissions_open ( $ userid ) ) { $ notices [ ] = get_string ( 'duedatereached' , 'assign' ) ; return false ; } $ instance = $ this -> get_instance ( ) ; $ data = new stdClass ( ) ; $ data -> userid = $ userid ; $ mform = new mod_assign_submission_form ( null , array ( $ this , $ data ) ) ; if ( $ mform -> is_cancelled ( ) ) { return true ; } if ( $ data = $ mform -> get_data ( ) ) { return $ this -> save_submission ( $ data , $ notices ) ; } return false ; }
docstring: Save assignment submission.
  
  @param  moodleform $mform
  @param  array $notices Any error messages that should be shown
  to the user at the top of the edit submission form.
  @return bool
docstring_tokens: Save assignment submission .