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


PHP api::read_competency方法代码示例

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


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

示例1: __construct

 /**
  * Construct this renderable.
  *
  * @param int $competencyid
  */
 public function __construct($competencyid)
 {
     $this->competency = api::read_competency($competencyid);
     $this->context = $this->competency->get_context();
     $this->relatedcompetencies = api::list_related_competencies($competencyid);
 }
开发者ID:evltuma,项目名称:moodle,代码行数:11,代码来源:related_competencies.php

示例2: grade_competency_in_course

 /**
  * Grade a competency in a course.
  *
  * @param int $courseid The course id
  * @param int $userid The user id
  * @param int $competencyid The competency id
  * @param int $grade The new grade value
  * @param string $note A note to add to the evidence
  * @return bool
  */
 public static function grade_competency_in_course($courseid, $userid, $competencyid, $grade, $note = null)
 {
     global $USER, $PAGE, $DB;
     $params = self::validate_parameters(self::grade_competency_in_course_parameters(), array('courseid' => $courseid, 'userid' => $userid, 'competencyid' => $competencyid, 'grade' => $grade, 'note' => $note));
     $course = $DB->get_record('course', array('id' => $params['courseid']));
     $context = context_course::instance($course->id);
     self::validate_context($context);
     $output = $PAGE->get_renderer('core');
     $evidence = api::grade_competency_in_course($params['courseid'], $params['userid'], $params['competencyid'], $params['grade'], $params['note']);
     $competency = api::read_competency($params['competencyid']);
     $scale = $competency->get_scale();
     $exporter = new evidence_exporter($evidence, array('actionuser' => $USER, 'scale' => $scale, 'usercompetency' => null, 'usercompetencyplan' => null));
     return $exporter->export($output);
 }
开发者ID:evltuma,项目名称:moodle,代码行数:24,代码来源:external.php

示例3: redirect

}
// Get competency.
$competency = null;
if (!empty($id)) {
    $competency = \core_competency\api::read_competency($id);
    if (empty($competencyframework)) {
        $competencyframework = $competency->get_framework();
    }
}
// Get parent competency, if any.
$parent = null;
if ($competency) {
    $parent = $competency->get_parent();
} else {
    if ($parentid) {
        $parent = \core_competency\api::read_competency($parentid);
    }
}
// Get page URL.
$urloptions = ['id' => $id, 'competencyframeworkid' => $competencyframework->get_id(), 'parentid' => $parentid, 'pagecontextid' => $pagecontextid];
$url = new moodle_url("/admin/tool/lp/editcompetency.php", $urloptions);
// Set up the page.
list($title, $subtitle, $returnurl) = \tool_lp\page_helper::setup_for_competency($pagecontextid, $url, $competencyframework, $competency, $parent);
// Set up the form.
$formoptions = ['competencyframework' => $competencyframework, 'parent' => $parent, 'persistent' => $competency, 'pagecontextid' => $pagecontextid];
$form = new \tool_lp\form\competency($url->out(false), $formoptions);
// Form cancelled.
if ($form->is_cancelled()) {
    redirect($returnurl);
}
// Get form data.
开发者ID:evltuma,项目名称:moodle,代码行数:31,代码来源:editcompetency.php

示例4: data_for_related_competencies_section

 /**
  * Data to render in the related competencies section.
  *
  * @param int $competencyid
  * @return array Related competencies and whether to show delete action button or not.
  */
 public static function data_for_related_competencies_section($competencyid)
 {
     global $PAGE;
     $params = self::validate_parameters(self::data_for_related_competencies_section_parameters(), array('competencyid' => $competencyid));
     $competency = api::read_competency($params['competencyid']);
     self::validate_context($competency->get_context());
     $renderable = new \tool_lp\output\related_competencies($params['competencyid']);
     $renderer = $PAGE->get_renderer('tool_lp');
     return $renderable->export_for_template($renderer);
 }
开发者ID:evltuma,项目名称:moodle,代码行数:16,代码来源:external.php


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