original_string: public function modifying_submission_allowed($userid) {
  
          $now = time();
          $ignoredeadlines = has_capability('mod/workshop:ignoredeadlines', $this->context, $userid);
  
          if ($this->phase != self::PHASE_SUBMISSION) {
              // submissions can be edited during the submission phase only
              return false;
          }
          if (!$ignoredeadlines and !empty($this->submissionstart) and $this->submissionstart > $now) {
              // if enabled, re-submitting is not allowed before the date/time defined in the mod_form
              return false;
          }
          if (!$ignoredeadlines and !empty($this->submissionend) and $now > $this->submissionend) {
              // if enabled, re-submitting is not allowed after the date/time defined in the mod_form even if late submission is allowed
              return false;
          }
          return true;
      }
code: public function modifying_submission_allowed($userid) {
  
          $now = time();
          $ignoredeadlines = has_capability('mod/workshop:ignoredeadlines', $this->context, $userid);
  
          if ($this->phase != self::PHASE_SUBMISSION) {
              // submissions can be edited during the submission phase only
              return false;
          }
          if (!$ignoredeadlines and !empty($this->submissionstart) and $this->submissionstart > $now) {
              // if enabled, re-submitting is not allowed before the date/time defined in the mod_form
              return false;
          }
          if (!$ignoredeadlines and !empty($this->submissionend) and $now > $this->submissionend) {
              // if enabled, re-submitting is not allowed after the date/time defined in the mod_form even if late submission is allowed
              return false;
          }
          return true;
      }
code_tokens: public function modifying_submission_allowed ( $ userid ) { $ now = time ( ) ; $ ignoredeadlines = has_capability ( 'mod/workshop:ignoredeadlines' , $ this -> context , $ userid ) ; if ( $ this -> phase != self :: PHASE_SUBMISSION ) { // submissions can be edited during the submission phase only return false ; } if ( ! $ ignoredeadlines and ! empty ( $ this -> submissionstart ) and $ this -> submissionstart > $ now ) { // if enabled, re-submitting is not allowed before the date/time defined in the mod_form return false ; } if ( ! $ ignoredeadlines and ! empty ( $ this -> submissionend ) and $ now > $ this -> submissionend ) { // if enabled, re-submitting is not allowed after the date/time defined in the mod_form even if late submission is allowed return false ; } return true ; }
docstring: Is the given user allowed to modify their existing submission?
  
  @param int $userid
  @return bool
docstring_tokens: Is the given user allowed to modify their existing submission?