本文整理汇总了PHP中grading_manager::set_component方法的典型用法代码示例。如果您正苦于以下问题:PHP grading_manager::set_component方法的具体用法?PHP grading_manager::set_component怎么用?PHP grading_manager::set_component使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grading_manager
的用法示例。
在下文中一共展示了grading_manager::set_component方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_grading_manager
/**
* Factory method returning an instance of the grading manager
*
* There are basically ways how to use this factory method. If the area record
* id is known to the caller, get the manager for that area by providing just
* the id. If the area record id is not know, the context, component and area name
* can be provided. Note that null values are allowed in the second case as the context,
* component and the area name can be set explicitly later.
*
* @category grading
* @example $manager = get_grading_manager($areaid);
* @example $manager = get_grading_manager(context_system::instance());
* @example $manager = get_grading_manager($context, 'mod_assignment', 'submission');
* @param stdClass|int|null $context_or_areaid if $areaid is passed, no other parameter is needed
* @param string|null $component the frankenstyle name of the component
* @param string|null $area the name of the gradable area
* @return grading_manager
*/
function get_grading_manager($context_or_areaid = null, $component = null, $area = null)
{
global $DB;
$manager = new grading_manager();
if (is_object($context_or_areaid)) {
$context = $context_or_areaid;
} else {
$context = null;
if (is_numeric($context_or_areaid)) {
$manager->load($context_or_areaid);
return $manager;
}
}
if (!is_null($context)) {
$manager->set_context($context);
}
if (!is_null($component)) {
$manager->set_component($component);
}
if (!is_null($area)) {
$manager->set_area($area);
}
return $manager;
}