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


PHP api::get_plan_competency方法代码示例

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


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

示例1: export_for_template

 /**
  * Export the data.
  *
  * @param renderer_base $output
  * @return stdClass
  */
 public function export_for_template(\renderer_base $output)
 {
     global $DB;
     $plan = api::read_plan($this->planid);
     $pc = api::get_plan_competency($plan, $this->competencyid);
     $competency = $pc->competency;
     $usercompetency = $pc->usercompetency;
     $usercompetencyplan = $pc->usercompetencyplan;
     if (empty($competency)) {
         throw new \invalid_parameter_exception('Invalid params. The competency does not belong to the plan.');
     }
     $relatedcompetencies = api::list_related_competencies($competency->get_id());
     $userid = $plan->get_userid();
     $user = $DB->get_record('user', array('id' => $userid));
     $evidence = api::list_evidence($userid, $this->competencyid, $plan->get_id());
     $params = array('competency' => $competency, 'usercompetency' => $usercompetency, 'usercompetencyplan' => $usercompetencyplan, 'evidence' => $evidence, 'user' => $user, 'plan' => $plan, 'relatedcompetencies' => $relatedcompetencies);
     $exporter = new user_competency_summary_in_plan_exporter(null, $params);
     $data = $exporter->export($output);
     return $data;
 }
开发者ID:gabrielrosset,项目名称:moodle,代码行数:26,代码来源:user_competency_summary_in_plan.php

示例2: user_competency_plan_viewed

 /**
  * Log user competency plan viewed event.
  *
  * @param int $competencyid The competency ID.
  * @param int $userid The user ID.
  * @param int $planid The plan ID.
  * @return boolean
  */
 public static function user_competency_plan_viewed($competencyid, $userid, $planid)
 {
     $params = self::validate_parameters(self::user_competency_viewed_in_plan_parameters(), array('competencyid' => $competencyid, 'userid' => $userid, 'planid' => $planid));
     $pl = api::get_plan_competency($params['planid'], $params['competencyid']);
     $result = api::user_competency_plan_viewed($pl->usercompetencyplan);
     return $result;
 }
开发者ID:evltuma,项目名称:moodle,代码行数:15,代码来源:external.php

示例3: require_login

require_login(null, false);
if (isguestuser()) {
    throw new require_login_exception('Guests are not allowed here.');
}
\core_competency\api::require_enabled();
$params = array('userid' => $userid, 'competencyid' => $competencyid);
$params['planid'] = $planid;
$plan = \core_competency\api::read_plan($planid);
$url = new moodle_url('/admin/tool/lp/user_competency_in_plan.php', $params);
$competency = new \core_competency\competency($competencyid);
$framework = $competency->get_framework();
list($title, $subtitle) = \tool_lp\page_helper::setup_for_plan($userid, $url, $plan);
$output = $PAGE->get_renderer('tool_lp');
echo $output->header();
echo $output->heading($title);
// User competency plan navigation.
$baseurl = new moodle_url('/admin/tool/lp/user_competency_in_plan.php');
$nav = new \tool_lp\output\competency_plan_navigation($userid, $competencyid, $planid, $baseurl);
echo $output->render($nav);
$page = new \tool_lp\output\user_competency_summary_in_plan($competencyid, $planid);
echo $output->render($page);
// Trigger the viewed event.
$pc = \core_competency\api::get_plan_competency($plan, $competency->get_id());
if ($plan->get_status() == \core_competency\plan::STATUS_COMPLETE) {
    $usercompetencyplan = $pc->usercompetencyplan;
    \core_competency\api::user_competency_plan_viewed($usercompetencyplan);
} else {
    $usercompetency = $pc->usercompetency;
    \core_competency\api::user_competency_viewed_in_plan($usercompetency, $plan->get_id());
}
echo $output->footer();
开发者ID:evltuma,项目名称:moodle,代码行数:31,代码来源:user_competency_in_plan.php


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