original_string: protected function update_submission(stdClass $submission, $userid, $updatetime, $teamsubmission) {
          global $DB;
  
          if ($teamsubmission) {
              return $this->update_team_submission($submission, $userid, $updatetime);
          }
  
          if ($updatetime) {
              $submission->timemodified = time();
          }
          $result= $DB->update_record('assign_submission', $submission);
          if ($result) {
              $this->gradebook_item_update($submission);
          }
          return $result;
      }
code: protected function update_submission(stdClass $submission, $userid, $updatetime, $teamsubmission) {
          global $DB;
  
          if ($teamsubmission) {
              return $this->update_team_submission($submission, $userid, $updatetime);
          }
  
          if ($updatetime) {
              $submission->timemodified = time();
          }
          $result= $DB->update_record('assign_submission', $submission);
          if ($result) {
              $this->gradebook_item_update($submission);
          }
          return $result;
      }
code_tokens: protected function update_submission ( stdClass $ submission , $ userid , $ updatetime , $ teamsubmission ) { global $ DB ; if ( $ teamsubmission ) { return $ this -> update_team_submission ( $ submission , $ userid , $ updatetime ) ; } if ( $ updatetime ) { $ submission -> timemodified = time ( ) ; } $ result = $ DB -> update_record ( 'assign_submission' , $ submission ) ; if ( $ result ) { $ this -> gradebook_item_update ( $ submission ) ; } return $ result ; }
docstring: Update grades in the gradebook based on submission time.
  
  @param stdClass $submission
  @param int $userid
  @param bool $updatetime
  @param bool $teamsubmission
  @return bool
docstring_tokens: Update grades in the gradebook based on submission time .