本文整理汇总了PHP中question_engine::load_behaviour_class方法的典型用法代码示例。如果您正苦于以下问题:PHP question_engine::load_behaviour_class方法的具体用法?PHP question_engine::load_behaviour_class怎么用?PHP question_engine::load_behaviour_class使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类question_engine
的用法示例。
在下文中一共展示了question_engine::load_behaviour_class方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_load_behaviour_class_missing
public function test_load_behaviour_class_missing()
{
// Set expectation.
$this->setExpectedException('moodle_exception');
// Exercise SUT
question_engine::load_behaviour_class('nonexistantbehaviour');
}
示例2: make_behaviour
public function make_behaviour(question_attempt $qa, $preferredbehaviour) {
question_engine::load_behaviour_class('informationitem');
return new qbehaviour_informationitem($qa, $preferredbehaviour);
}
示例3: __construct
/**
* @param string $behaviourtype the type of behaviour we are providing a fallback for.
*/
public function __construct($behaviour)
{
question_engine::load_behaviour_class($behaviour);
$this->behaviourclass = 'qbehaviour_' . $behaviour;
}
示例4: make_behaviour
public function make_behaviour(question_attempt $qa, $preferredbehaviour)
{
question_engine::load_behaviour_class('manualgraded');
return new qbehaviour_manualgraded($qa, $preferredbehaviour);
}
示例5: test_load_behaviour_class_missing
/**
* @expectedException moodle_exception
*/
public function test_load_behaviour_class_missing()
{
// Exercise SUT
question_engine::load_behaviour_class('nonexistantbehaviour');
}