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


PHP grading_manager::load方法代碼示例

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


在下文中一共展示了grading_manager::load方法的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;
}
開發者ID:evltuma,項目名稱:moodle,代碼行數:42,代碼來源:lib.php


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