本文整理汇总了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;
}
}
示例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) {