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);
    }