本文整理匯總了PHP中grade_helper::outcomeinfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP grade_helper::outcomeinfo方法的具體用法?PHP grade_helper::outcomeinfo怎麽用?PHP grade_helper::outcomeinfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類grade_helper
的用法示例。
在下文中一共展示了grade_helper::outcomeinfo方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_info_outcomes
/**
* Get information on outcomes
* @param int $courseid
* @return grade_plugin_info
*/
public static function get_info_outcomes($courseid)
{
global $CFG, $SITE;
if (self::$outcomeinfo !== null) {
return self::$outcomeinfo;
}
$context = context_course::instance($courseid);
$canmanage = has_capability('moodle/grade:manage', $context);
$canupdate = has_capability('moodle/course:update', $context);
if (!empty($CFG->enableoutcomes) && ($canmanage || $canupdate)) {
$outcomes = array();
if ($canupdate) {
if ($courseid != $SITE->id) {
$url = new moodle_url('/grade/edit/outcome/course.php', array('id' => $courseid));
$outcomes['course'] = new grade_plugin_info('course', $url, get_string('outcomescourse', 'grades'));
}
$url = new moodle_url('/grade/edit/outcome/index.php', array('id' => $courseid));
$outcomes['edit'] = new grade_plugin_info('edit', $url, get_string('editoutcomes', 'grades'));
$url = new moodle_url('/grade/edit/outcome/import.php', array('courseid' => $courseid));
$outcomes['import'] = new grade_plugin_info('import', $url, get_string('importoutcomes', 'grades'));
} else {
if ($courseid != $SITE->id) {
$url = new moodle_url('/grade/edit/outcome/course.php', array('id' => $courseid));
$outcomes['edit'] = new grade_plugin_info('edit', $url, get_string('outcomescourse', 'grades'));
}
}
self::$outcomeinfo = $outcomes;
} else {
self::$outcomeinfo = false;
}
return self::$outcomeinfo;
}