original_string: protected function update_activity_completion_records($teamsubmission,
                                                            $requireallteammemberssubmit,
                                                            $submission,
                                                            $userid,
                                                            $complete,
                                                            $completion) {
  
          if (($teamsubmission && $submission->groupid > 0 && !$requireallteammemberssubmit) ||
              ($teamsubmission && $submission->groupid > 0 && $requireallteammemberssubmit &&
               $submission->status == ASSIGN_SUBMISSION_STATUS_SUBMITTED)) {
  
              $members = groups_get_members($submission->groupid);
  
              foreach ($members as $member) {
                  $completion->update_state($this->get_course_module(), $complete, $member->id);
              }
          } else {
              $completion->update_state($this->get_course_module(), $complete, $userid);
          }
  
          return;
      }
code: protected function update_activity_completion_records($teamsubmission,
                                                            $requireallteammemberssubmit,
                                                            $submission,
                                                            $userid,
                                                            $complete,
                                                            $completion) {
  
          if (($teamsubmission && $submission->groupid > 0 && !$requireallteammemberssubmit) ||
              ($teamsubmission && $submission->groupid > 0 && $requireallteammemberssubmit &&
               $submission->status == ASSIGN_SUBMISSION_STATUS_SUBMITTED)) {
  
              $members = groups_get_members($submission->groupid);
  
              foreach ($members as $member) {
                  $completion->update_state($this->get_course_module(), $complete, $member->id);
              }
          } else {
              $completion->update_state($this->get_course_module(), $complete, $userid);
          }
  
          return;
      }
code_tokens: protected function update_activity_completion_records ( $ teamsubmission , $ requireallteammemberssubmit , $ submission , $ userid , $ complete , $ completion ) { if ( ( $ teamsubmission && $ submission -> groupid > 0 && ! $ requireallteammemberssubmit ) || ( $ teamsubmission && $ submission -> groupid > 0 && $ requireallteammemberssubmit && $ submission -> status == ASSIGN_SUBMISSION_STATUS_SUBMITTED ) ) { $ members = groups_get_members ( $ submission -> groupid ) ; foreach ( $ members as $ member ) { $ completion -> update_state ( $ this -> get_course_module ( ) , $ complete , $ member -> id ) ; } } else { $ completion -> update_state ( $ this -> get_course_module ( ) , $ complete , $ userid ) ; } return ; }
docstring: Updates and creates the completion records in mdl_course_modules_completion.
  
  @param int $teamsubmission value of 0 or 1 to indicate whether this is a group activity
  @param int $requireallteammemberssubmit value of 0 or 1 to indicate whether all group members must click Submit
  @param obj $submission the submission
  @param int $userid the user id
  @param int $complete
  @param obj $completion
  
  @return null
docstring_tokens: Updates and creates the completion records in mdl_course_modules_completion .