當前位置: 首頁>>代碼示例>>PHP>>正文


PHP question_engine::get_behaviour_required_behaviours方法代碼示例

本文整理匯總了PHP中question_engine::get_behaviour_required_behaviours方法的典型用法代碼示例。如果您正苦於以下問題:PHP question_engine::get_behaviour_required_behaviours方法的具體用法?PHP question_engine::get_behaviour_required_behaviours怎麽用?PHP question_engine::get_behaviour_required_behaviours使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在question_engine的用法示例。


在下文中一共展示了question_engine::get_behaviour_required_behaviours方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: load_other_required_plugins

 /**
  * @see plugintype_base::load_other_required_plugins().
  */
 protected function load_other_required_plugins()
 {
     parent::load_other_required_plugins();
     if (!empty($this->dependencies)) {
         return;
     }
     // Standard mechanism did not find anything, so try the legacy way.
     global $CFG;
     require_once $CFG->libdir . '/questionlib.php';
     $required = question_engine::get_behaviour_required_behaviours($this->name);
     foreach ($required as $other) {
         $this->dependencies['qbehaviour_' . $other] = ANY_VERSION;
     }
 }
開發者ID:rosenclever,項目名稱:moodle,代碼行數:17,代碼來源:pluginlib.php

示例2: foreach

// Add a row for each question type.
foreach ($sortedbehaviours as $behaviour => $behaviourname) {
    $row = array();
    // Question icon and name.
    $row[] = $behaviourname;
    // Count
    $row[] = $counts[$behaviour];
    // Question version number.
    $version = get_config('qbehaviour_' . $behaviour, 'version');
    if ($version) {
        $row[] = $version;
    } else {
        $row[] = html_writer::tag('span', get_string('nodatabase', 'admin'), array('class' => 'disabled'));
    }
    // Other question types required by this one.
    $requiredbehaviours = question_engine::get_behaviour_required_behaviours($behaviour);
    if (!empty($requiredbehaviours)) {
        $strrequiredbehaviours = array();
        foreach ($requiredbehaviours as $required) {
            $strrequiredbehaviours[] = $sortedbehaviours[$required];
        }
        $row[] = implode(', ', $strrequiredbehaviours);
    } else {
        $row[] = '';
    }
    // Are people allowed to create new questions of this type?
    $rowclass = '';
    if ($archetypal[$behaviour]) {
        $enabled = array_search($behaviour, $disabledbehaviours) === false;
        $icons = question_behaviour_enable_disable_icons($behaviour, $enabled);
        if (!$enabled) {
開發者ID:sebastiansanio,項目名稱:tallerdeprogramacion2fiuba,代碼行數:31,代碼來源:qbehaviours.php


注:本文中的question_engine::get_behaviour_required_behaviours方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。