本文整理汇总了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;
}