当前位置: 首页>>代码示例>>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;未经允许,请勿转载。