original_string: public function get_criteria_completions($userid) {
          global $DB;
          $completions = array();
          $sql = "SELECT bcm.id, bcm.critid
                  FROM {badge_criteria_met} bcm
                      INNER JOIN {badge_criteria} bc ON bcm.critid = bc.id
                  WHERE bc.badgeid = :badgeid AND bcm.userid = :userid ";
          $completions = $DB->get_records_sql($sql, array('badgeid' => $this->id, 'userid' => $userid));
  
          return $completions;
      }
code: public function get_criteria_completions($userid) {
          global $DB;
          $completions = array();
          $sql = "SELECT bcm.id, bcm.critid
                  FROM {badge_criteria_met} bcm
                      INNER JOIN {badge_criteria} bc ON bcm.critid = bc.id
                  WHERE bc.badgeid = :badgeid AND bcm.userid = :userid ";
          $completions = $DB->get_records_sql($sql, array('badgeid' => $this->id, 'userid' => $userid));
  
          return $completions;
      }
code_tokens: public function get_criteria_completions ( $ userid ) { global $ DB ; $ completions = array ( ) ; $ sql = "SELECT bcm.id, bcm.critid
                  FROM {badge_criteria_met} bcm
                      INNER JOIN {badge_criteria} bc ON bcm.critid = bc.id
                  WHERE bc.badgeid = :badgeid AND bcm.userid = :userid " ; $ completions = $ DB -> get_records_sql ( $ sql , array ( 'badgeid' => $ this -> id , 'userid' => $ userid ) ) ; return $ completions ; }
docstring: Gets an array of completed criteria from 'badge_criteria_met' table.
  
  @param int $userid Completions for a user
  @return array Records of criteria completions
docstring_tokens: Gets an array of completed criteria from badge_criteria_met table .