original_string: public function search($query) {
          global $CFG;
          if ($result = parent::search($query)) {
              return $result;
          }
  
          $found = false;
          require_once($CFG->dirroot . '/question/engine/bank.php');
          foreach (question_bank::get_all_qtypes() as $qtype) {
              if (strpos(core_text::strtolower($qtype->local_name()), $query) !== false) {
                  $found = true;
                  break;
              }
          }
          if ($found) {
              $result = new stdClass();
              $result->page     = $this;
              $result->settings = array();
              return array($this->name => $result);
          } else {
              return array();
          }
      }
code: public function search($query) {
          global $CFG;
          if ($result = parent::search($query)) {
              return $result;
          }
  
          $found = false;
          require_once($CFG->dirroot . '/question/engine/bank.php');
          foreach (question_bank::get_all_qtypes() as $qtype) {
              if (strpos(core_text::strtolower($qtype->local_name()), $query) !== false) {
                  $found = true;
                  break;
              }
          }
          if ($found) {
              $result = new stdClass();
              $result->page     = $this;
              $result->settings = array();
              return array($this->name => $result);
          } else {
              return array();
          }
      }
code_tokens: public function search ( $ query ) { global $ CFG ; if ( $ result = parent :: search ( $ query ) ) { return $ result ; } $ found = false ; require_once ( $ CFG -> dirroot . '/question/engine/bank.php' ) ; foreach ( question_bank :: get_all_qtypes ( ) as $ qtype ) { if ( strpos ( core_text :: strtolower ( $ qtype -> local_name ( ) ) , $ query ) !== false ) { $ found = true ; break ; } } if ( $ found ) { $ result = new stdClass ( ) ; $ result -> page = $ this ; $ result -> settings = array ( ) ; return array ( $ this -> name => $ result ) ; } else { return array ( ) ; } }
docstring: Search question types for the specified string
  
  @param string $query The string to search for in question types
  @return array
docstring_tokens: Search question types for the specified string