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


PHP api::list_courses_using_competency方法代码示例

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


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

示例1: __construct

 /**
  * Construct this renderable.
  *
  * @param \core_competency\competency $competency Competency persistent.
  * @param \core_competency\competency_framework $framework framework persistent.
  * @param boolean $includerelated Include or not related competencies.
  * @param boolean $includecourses Include or not competency courses.
  */
 public function __construct($competency, $framework, $includerelated, $includecourses)
 {
     $this->competency = $competency;
     $this->framework = $framework;
     if ($includerelated) {
         $this->relatedcompetencies = api::list_related_competencies($competency->get_id());
     }
     if ($includecourses) {
         $this->courses = api::list_courses_using_competency($competency->get_id());
     }
 }
开发者ID:evltuma,项目名称:moodle,代码行数:19,代码来源:competency_summary.php

示例2: list_courses_using_competency

 /**
  * Count the courses (visible to this user) that use this competency.
  *
  * @param int $competencyid Competency id.
  * @return array
  */
 public static function list_courses_using_competency($competencyid)
 {
     global $PAGE;
     $params = self::validate_parameters(self::list_courses_using_competency_parameters(), array('id' => $competencyid));
     $competency = api::read_competency($params['id']);
     self::validate_context($competency->get_context());
     $output = $PAGE->get_renderer('tool_lp');
     $results = array();
     $courses = api::list_courses_using_competency($params['id']);
     foreach ($courses as $course) {
         $context = context_course::instance($course->id);
         $exporter = new course_summary_exporter($course, array('context' => $context));
         $result = $exporter->export($output);
         array_push($results, $result);
     }
     return $results;
 }
开发者ID:evltuma,项目名称:moodle,代码行数:23,代码来源:external.php

示例3: export_for_template

 /**
  * Export this data so it can be used as the context for a mustache template.
  *
  * @param \renderer_base $output
  * @return stdClass
  */
 public function export_for_template(renderer_base $output)
 {
     $data = new stdClass();
     $data->template = (new template_exporter($this->template))->export($output);
     $data->pagecontextid = $this->pagecontext->id;
     $data->competencies = array();
     $contextcache = array();
     $frameworkcache = array();
     foreach ($this->competencies as $competency) {
         if (!isset($contextcache[$competency->get_competencyframeworkid()])) {
             $contextcache[$competency->get_competencyframeworkid()] = $competency->get_context();
         }
         $context = $contextcache[$competency->get_competencyframeworkid()];
         if (!isset($frameworkcache[$competency->get_competencyframeworkid()])) {
             $frameworkcache[$competency->get_competencyframeworkid()] = $competency->get_framework();
         }
         $framework = $frameworkcache[$competency->get_competencyframeworkid()];
         $courses = api::list_courses_using_competency($competency->get_id());
         $relatedcompetencies = api::list_related_competencies($competency->get_id());
         $related = array('competency' => $competency, 'linkedcourses' => $courses, 'context' => $context, 'relatedcompetencies' => $relatedcompetencies, 'framework' => $framework);
         $exporter = new competency_summary_exporter(null, $related);
         $record = $exporter->export($output);
         array_push($data->competencies, $record);
     }
     $data->pluginbaseurl = (new moodle_url('/admin/tool/lp'))->out(false);
     $data->canmanagecompetencyframeworks = $this->canmanagecompetencyframeworks;
     $data->canmanagetemplatecompetencies = $this->canmanagetemplatecompetencies;
     $data->manageurl = $this->manageurl->out(true);
     $exporter = new template_statistics_exporter($this->templatestatistics);
     $data->statistics = $exporter->export($output);
     $data->showcompetencylinks = true;
     return $data;
 }
开发者ID:evltuma,项目名称:moodle,代码行数:39,代码来源:template_competencies_page.php


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