예제 #1
0
 /**
  * Get the most often not completed competency for this template.
  *
  * Requires moodle/competency:templateview capability at the system context.
  *
  * @param mixed $templateorid The id or the template.
  * @param int $skip The number of records to skip
  * @param int $limit The max number of records to return
  * @return competency[]
  */
 public static function get_least_proficient_competencies_for_template($templateorid, $skip = 0, $limit = 100)
 {
     static::require_enabled();
     $template = $templateorid;
     if (!is_object($template)) {
         $template = new template($template);
     }
     // First we do a permissions check.
     if (!$template->can_read()) {
         throw new required_capability_exception($template->get_context(), 'moodle/competency:templateview', 'nopermissions', '');
     }
     return user_competency_plan::get_least_proficient_competencies_for_template($template->get_id(), $skip, $limit);
 }