original_string: public function get_accepted_criteria() {
          global $CFG;
          $criteriatypes = array();
  
          if ($this->type == BADGE_TYPE_COURSE) {
              $criteriatypes = array(
                      BADGE_CRITERIA_TYPE_OVERALL,
                      BADGE_CRITERIA_TYPE_MANUAL,
                      BADGE_CRITERIA_TYPE_COURSE,
                      BADGE_CRITERIA_TYPE_BADGE,
                      BADGE_CRITERIA_TYPE_ACTIVITY,
                      BADGE_CRITERIA_TYPE_COMPETENCY
              );
          } else if ($this->type == BADGE_TYPE_SITE) {
              $criteriatypes = array(
                      BADGE_CRITERIA_TYPE_OVERALL,
                      BADGE_CRITERIA_TYPE_MANUAL,
                      BADGE_CRITERIA_TYPE_COURSESET,
                      BADGE_CRITERIA_TYPE_BADGE,
                      BADGE_CRITERIA_TYPE_PROFILE,
                      BADGE_CRITERIA_TYPE_COHORT,
                      BADGE_CRITERIA_TYPE_COMPETENCY
              );
          }
          $alltypes = badges_list_criteria();
          foreach ($criteriatypes as $index => $type) {
              if (!isset($alltypes[$type])) {
                  unset($criteriatypes[$index]);
              }
          }
  
          return $criteriatypes;
      }
code: public function get_accepted_criteria() {
          global $CFG;
          $criteriatypes = array();
  
          if ($this->type == BADGE_TYPE_COURSE) {
              $criteriatypes = array(
                      BADGE_CRITERIA_TYPE_OVERALL,
                      BADGE_CRITERIA_TYPE_MANUAL,
                      BADGE_CRITERIA_TYPE_COURSE,
                      BADGE_CRITERIA_TYPE_BADGE,
                      BADGE_CRITERIA_TYPE_ACTIVITY,
                      BADGE_CRITERIA_TYPE_COMPETENCY
              );
          } else if ($this->type == BADGE_TYPE_SITE) {
              $criteriatypes = array(
                      BADGE_CRITERIA_TYPE_OVERALL,
                      BADGE_CRITERIA_TYPE_MANUAL,
                      BADGE_CRITERIA_TYPE_COURSESET,
                      BADGE_CRITERIA_TYPE_BADGE,
                      BADGE_CRITERIA_TYPE_PROFILE,
                      BADGE_CRITERIA_TYPE_COHORT,
                      BADGE_CRITERIA_TYPE_COMPETENCY
              );
          }
          $alltypes = badges_list_criteria();
          foreach ($criteriatypes as $index => $type) {
              if (!isset($alltypes[$type])) {
                  unset($criteriatypes[$index]);
              }
          }
  
          return $criteriatypes;
      }
code_tokens: public function get_accepted_criteria ( ) { global $ CFG ; $ criteriatypes = array ( ) ; if ( $ this -> type == BADGE_TYPE_COURSE ) { $ criteriatypes = array ( BADGE_CRITERIA_TYPE_OVERALL , BADGE_CRITERIA_TYPE_MANUAL , BADGE_CRITERIA_TYPE_COURSE , BADGE_CRITERIA_TYPE_BADGE , BADGE_CRITERIA_TYPE_ACTIVITY , BADGE_CRITERIA_TYPE_COMPETENCY ) ; } else if ( $ this -> type == BADGE_TYPE_SITE ) { $ criteriatypes = array ( BADGE_CRITERIA_TYPE_OVERALL , BADGE_CRITERIA_TYPE_MANUAL , BADGE_CRITERIA_TYPE_COURSESET , BADGE_CRITERIA_TYPE_BADGE , BADGE_CRITERIA_TYPE_PROFILE , BADGE_CRITERIA_TYPE_COHORT , BADGE_CRITERIA_TYPE_COMPETENCY ) ; } $ alltypes = badges_list_criteria ( ) ; foreach ( $ criteriatypes as $ index => $ type ) { if ( ! isset ( $ alltypes [ $ type ] ) ) { unset ( $ criteriatypes [ $ index ] ) ; } } return $ criteriatypes ; }
docstring: Return array of accepted criteria types for this badge
  @return array
docstring_tokens: Return array of accepted criteria types for this badge