Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [Versions 401 and 403]

Class for loading/storing competency frameworks from the DB.

Copyright: 2015 Damyon Wiese
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 507 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: competency_framework  - X-Ref

Class for loading/storing competency frameworks from the DB.

get_context()   X-Ref
Get the context.

return: context The context

define_properties()   X-Ref
Return the definition of the properties of this model.

return: array

before_validate()   X-Ref
Hook to execute before validate.

return: void

get_depth()   X-Ref
Return the current depth of a competency framework.

return: int

get_scale()   X-Ref
Return the scale.

return: \grade_scale

get_taxonomy($level)   X-Ref
Get the constant name for a level.

param: int $level The level of the term.
return: string

get_taxonomies()   X-Ref
Return the taxonomy constants indexed by level.

return: array Contains the list of taxonomy constants indexed by level.

has_user_competencies()   X-Ref
Returns true when some competencies of the framework have user competencies.

This is useful to determine if the framework, or part of it, should be locked down.

return: boolean

set_taxonomies($taxonomies)   X-Ref
Convenience method to set taxonomies from an array or string.

param: string|array $taxonomies A string, or an array where the values are the term constants.

validate_contextid($value)   X-Ref
Validate the context ID.

param: int $value The context ID.
return: bool|lang_string

validate_idnumber($value)   X-Ref
Validate the id number.

param: string $value The id number.
return: bool|lang_string

validate_scaleid($value)   X-Ref
Validate the scale ID.

param: string $value The scale ID.
return: bool|lang_string

validate_scaleconfiguration($value)   X-Ref
Validate the scale configuration.

param: string $value The scale configuration.
return: bool|lang_string

validate_taxonomies($value)   X-Ref
Validate taxonomies.

param: mixed $value The taxonomies.
return: true|lang_string

get_default_grade_from_scale_configuration($config)   X-Ref
Extract the default grade from a scale configuration.

Returns an array where the first element is the grade, and the second
is a boolean representing whether or not this grade is considered 'proficient'.

param: string $config JSON encoded config.
return: array(int grade, int proficient)

get_proficiency_of_grade_from_scale_configuration($config, $grade)   X-Ref
Extract the proficiency of a grade from a scale configuration.

param: string $config JSON encoded config.
param: int $grade The grade.
return: int Representing a boolean

get_taxonomy_from_constant($constant)   X-Ref
Get the string of a taxonomy from a constant

param: string $constant The taxonomy constant.
return: lang_string

get_taxonomies_list()   X-Ref
Get the list of all taxonomies.

return: array Where the key is the taxonomy constant, and the value its translation.

get_unused_idnumber($idnumber)   X-Ref
Get a uniq idnumber.

param: string $idnumber the framework idnumber
return: string

can_manage()   X-Ref
Whether or not the current user can manage the framework.

return: bool

can_manage_context($context)   X-Ref
Whether or not the current user can manage the framework.

param: context $context
return: bool

can_read()   X-Ref
Whether or not the current user can read the framework.

return: bool

can_read_context($context)   X-Ref
Whether or not the current user can read the framework.

param: context $context
return: bool