本文整理匯總了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);
}