original_string: public function get_completions($user_id, $criteriatype = null) {
          $criteria = $this->get_criteria($criteriatype);
  
          $completions = array();
  
          foreach ($criteria as $criterion) {
              $params = array(
                  'course'        => $this->course_id,
                  'userid'        => $user_id,
                  'criteriaid'    => $criterion->id
              );
  
              $completion = new completion_criteria_completion($params);
              $completion->attach_criteria($criterion);
  
              $completions[] = $completion;
          }
  
          return $completions;
      }
code: public function get_completions($user_id, $criteriatype = null) {
          $criteria = $this->get_criteria($criteriatype);
  
          $completions = array();
  
          foreach ($criteria as $criterion) {
              $params = array(
                  'course'        => $this->course_id,
                  'userid'        => $user_id,
                  'criteriaid'    => $criterion->id
              );
  
              $completion = new completion_criteria_completion($params);
              $completion->attach_criteria($criterion);
  
              $completions[] = $completion;
          }
  
          return $completions;
      }
code_tokens: public function get_completions ( $ user_id , $ criteriatype = null ) { $ criteria = $ this -> get_criteria ( $ criteriatype ) ; $ completions = array ( ) ; foreach ( $ criteria as $ criterion ) { $ params = array ( 'course' => $ this -> course_id , 'userid' => $ user_id , 'criteriaid' => $ criterion -> id ) ; $ completion = new completion_criteria_completion ( $ params ) ; $ completion -> attach_criteria ( $ criterion ) ; $ completions [ ] = $ completion ; } return $ completions ; }
docstring: Get all course criteria's completion objects for a user
  
  @param int $user_id User id
  @param int $criteriatype Specific criteria type to return (optional)
  @return array
docstring_tokens: Get all course criteria s completion objects for a user