本文整理汇总了PHP中assign::get_user_grades_for_gradebook方法的典型用法代码示例。如果您正苦于以下问题:PHP assign::get_user_grades_for_gradebook方法的具体用法?PHP assign::get_user_grades_for_gradebook怎么用?PHP assign::get_user_grades_for_gradebook使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类assign
的用法示例。
在下文中一共展示了assign::get_user_grades_for_gradebook方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assign_get_user_grades
/**
* Return grade for given user or all users.
*
* @param stdClass $assign record of assign with an additional cmidnumber
* @param int $userid optional user id, 0 means all users
* @return array array of grades, false if none
*/
function assign_get_user_grades($assign, $userid = 0)
{
global $CFG;
require_once $CFG->dirroot . '/mod/assign/locallib.php';
$cm = get_coursemodule_from_instance('assign', $assign->id, 0, false, MUST_EXIST);
$context = context_module::instance($cm->id);
$assignment = new assign($context, null, null);
$assignment->set_instance($assign);
return $assignment->get_user_grades_for_gradebook($userid);
}
示例2: assign_get_user_grades
/**
* Return grade for given user or all users.
*
* @param stdClass $assign record of assign with an additional cmidnumber
* @param int $userid optional user id, 0 means all users
* @return array array of grades, false if none
*/
function assign_get_user_grades($assign, $userid=0) {
global $CFG;
require_once($CFG->dirroot . '/mod/assign/locallib.php');
$assignment = new assign(null, null, null);
$assignment->set_instance($assign);
return $assignment->get_user_grades_for_gradebook($userid);
}