当前位置: 首页>>代码示例>>PHP>>正文


PHP completion_info::has_criteria方法代码示例

本文整理汇总了PHP中completion_info::has_criteria方法的典型用法代码示例。如果您正苦于以下问题:PHP completion_info::has_criteria方法的具体用法?PHP completion_info::has_criteria怎么用?PHP completion_info::has_criteria使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在completion_info的用法示例。


在下文中一共展示了completion_info::has_criteria方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: completion_report_extend_navigation

/**
 * This function extends the navigation with the report items
 *
 * @param navigation_node $navigation The navigation node to extend
 * @param stdClass $course The course to object for the report
 * @param stdClass $context The context of the course
 */
function completion_report_extend_navigation($navigation, $course, $context)
{
    global $CFG, $OUTPUT;
    if (has_capability('coursereport/completion:view', $context)) {
        $completion = new completion_info($course);
        if ($completion->is_enabled() && $completion->has_criteria()) {
            $url = new moodle_url('/course/report/completion/index.php', array('course' => $course->id));
            $navigation->add(get_string('pluginname', 'coursereport_completion'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
        }
    }
}
开发者ID:vuchannguyen,项目名称:web,代码行数:18,代码来源:lib.php

示例2: array

// Check permissions
require_login($course);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
require_capability('coursereport/completion:view', $context);
// Get group mode
$group = groups_get_course_group($course, true);
// Supposed to verify group
if ($group === 0 && $course->groupmode == SEPARATEGROUPS) {
    require_capability('moodle/site:accessallgroups', $context);
}
/**
 * Load data
 */
// Get criteria for course
$completion = new completion_info($course);
if (!$completion->has_criteria()) {
    print_error('err_nocriteria', 'completion', $CFG->wwwroot . '/course/report.php?id=' . $course->id);
}
// Get criteria and put in correct order
$criteria = array();
foreach ($completion->get_criteria(COMPLETION_CRITERIA_TYPE_COURSE) as $criterion) {
    $criteria[] = $criterion;
}
foreach ($completion->get_criteria(COMPLETION_CRITERIA_TYPE_ACTIVITY) as $criterion) {
    $criteria[] = $criterion;
}
foreach ($completion->get_criteria() as $criterion) {
    if (!in_array($criterion->criteriatype, array(COMPLETION_CRITERIA_TYPE_COURSE, COMPLETION_CRITERIA_TYPE_ACTIVITY))) {
        $criteria[] = $criterion;
    }
}
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:31,代码来源:index.php

示例3: die

<?php

if (!defined('MOODLE_INTERNAL')) {
    die('Direct access to this script is forbidden.');
    // It must be included from a Moodle page
}
require_once $CFG->libdir . '/completionlib.php';
if (has_capability('coursereport/completion:view', $context)) {
    $completion = new completion_info($course);
    if ($completion->is_enabled() && $completion->has_criteria()) {
        echo '<p>';
        echo '<a href="' . $CFG->wwwroot . '/course/report/completion/index.php?coursetest=' . $course->id . '">' . get_string('coursecompletion') . '</a>';
        echo '</p>';
    }
}
开发者ID:vuchannguyen,项目名称:web,代码行数:15,代码来源:mod.php


注:本文中的completion_info::has_criteria方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。