Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Class for user_competency_course persistence.

Copyright: 2016 Jun Pataleta
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 293 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: user_competency_course  - X-Ref

Class for loading/storing user_competency_course from the DB.

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

return: array

get_competency()   X-Ref
Return the competency Object.

return: competency Competency Object

get_context()   X-Ref
Get the context.

return: context The context.

create_relation($userid, $competencyid, $courseid)   X-Ref
Create a new user_competency_course object.

Note, this is intended to be used to create a blank relation, for instance when
the record was not found in the database. This does not save the model.

return: \core_competency\user_competency_course
param: int $userid The user ID.
param: int $competencyid The competency ID.
param: int $courseid The course ID.

validate_userid($value)   X-Ref
Validate the user ID.

return: true|lang_string
param: int $value The value.

validate_competencyid($value)   X-Ref
Validate the competency ID.

return: true|lang_string
param: int $value The value.

validate_courseid($value)   X-Ref
Validate course ID.

return: true|lang_string
param: int $value The course ID.

validate_proficiency($value)   X-Ref
Validate the proficiency.

return: true|lang_string
param: int $value The value.

validate_grade($value)   X-Ref
Validate the grade.

return: true|lang_string
param: int $value The value.

get_multiple($userid, $courseid, array $competenciesorids = null)   X-Ref
Get multiple user_competency_course for a user.

return: \core_competency\user_competency_course[]
param: int $userid
param: int $courseid
param: array  $competenciesorids Limit search to those competencies, or competency IDs.

count_proficient_competencies($courseid, $userid)   X-Ref
Count the proficient competencies in this course for one user.

return: int
param: int $courseid The course id
param: int $userid The user id

get_least_proficient_competencies_for_course($courseid, $skip = 0, $limit = 0)   X-Ref
Get the list of competencies that were completed the least times in a course.

return: competency[]
param: int $courseid
param: int $skip The number of competencies to skip
param: int $limit The max number of competencies to return