From 217116d414588c6cb3faa9d566d44b28fbbe0a3e Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Fri, 11 Nov 2011 12:18:02 +0100 Subject: [PATCH] MDL-29108 Improving get_grading_method() documentation As a response to Sam's review (10) --- grade/grading/lib.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/grade/grading/lib.php b/grade/grading/lib.php index 1dc89814651..09ce1005dc7 100644 --- a/grade/grading/lib.php +++ b/grade/grading/lib.php @@ -29,9 +29,18 @@ defined('MOODLE_INTERNAL') || die(); /** * Factory method returning an instance of the grading manager * - * @param stdClass|int $context or $areaid - * @param string $component the frankenstyle name of the component - * @param string $area the name of the gradable area + * 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. + * + * @example $manager = get_grading_manager($areaid); + * @example $manager = get_grading_manager(get_system_context()); + * @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) { -- 2.43.0