idx
int64
0
60.3k
question
stringlengths
92
4.62k
target
stringlengths
7
635
32,100
public static function list_course_module_competencies_in_course_module ( $ cmorid ) { static :: require_enabled ( ) ; $ cm = $ cmorid ; if ( ! is_object ( $ cmorid ) ) { $ cm = get_coursemodule_from_id ( '' , $ cmorid , 0 , true , MUST_EXIST ) ; } self :: validate_course_module ( $ cm ) ; $ context = context_module ::...
List all the competencies linked to a course module .
32,101
public static function list_courses_using_competency ( $ competencyid ) { static :: require_enabled ( ) ; $ courses = course_competency :: list_courses ( $ competencyid ) ; $ result = array ( ) ; foreach ( $ courses as $ id => $ course ) { $ context = context_course :: instance ( $ course -> id ) ; $ capabilities = arr...
List all the courses using a competency .
32,102
public static function count_proficient_competencies_in_course_for_user ( $ courseid , $ userid ) { static :: require_enabled ( ) ; self :: validate_course ( $ courseid ) ; $ context = context_course :: instance ( $ courseid ) ; $ capabilities = array ( 'moodle/competency:coursecompetencyview' , 'moodle/competency:cour...
Count the proficient competencies in a course for one user .
32,103
public static function count_competencies_in_course ( $ courseid ) { static :: require_enabled ( ) ; self :: validate_course ( $ courseid ) ; $ context = context_course :: instance ( $ courseid ) ; $ capabilities = array ( 'moodle/competency:coursecompetencyview' , 'moodle/competency:coursecompetencymanage' ) ; if ( ! ...
Count all the competencies in a course .
32,104
public static function list_course_competencies ( $ courseorid ) { static :: require_enabled ( ) ; $ course = $ courseorid ; if ( ! is_object ( $ courseorid ) ) { $ course = get_course ( $ courseorid ) ; } self :: validate_course ( $ course ) ; $ context = context_course :: instance ( $ course -> id ) ; $ capabilities ...
List the competencies associated to a course .
32,105
public static function get_user_competency ( $ userid , $ competencyid ) { static :: require_enabled ( ) ; $ existing = user_competency :: get_multiple ( $ userid , array ( $ competencyid ) ) ; $ uc = array_pop ( $ existing ) ; if ( ! $ uc ) { $ uc = user_competency :: create_relation ( $ userid , $ competencyid ) ; $ ...
Get a user competency .
32,106
public static function get_user_competency_by_id ( $ usercompetencyid ) { static :: require_enabled ( ) ; $ uc = new user_competency ( $ usercompetencyid ) ; if ( ! $ uc -> can_read ( ) ) { throw new required_capability_exception ( $ uc -> get_context ( ) , 'moodle/competency:usercompetencyview' , 'nopermissions' , '' ...
Get a user competency by ID .
32,107
public static function list_course_module_competencies ( $ cmorid ) { static :: require_enabled ( ) ; $ cm = $ cmorid ; if ( ! is_object ( $ cmorid ) ) { $ cm = get_coursemodule_from_id ( '' , $ cmorid , 0 , true , MUST_EXIST ) ; } self :: validate_course_module ( $ cm ) ; $ context = context_module :: instance ( $ cm ...
List the competencies associated to a course module .
32,108
public static function get_user_competency_in_course ( $ courseid , $ userid , $ competencyid ) { static :: require_enabled ( ) ; $ context = context_course :: instance ( $ courseid ) ; $ capabilities = array ( 'moodle/competency:coursecompetencyview' , 'moodle/competency:coursecompetencymanage' ) ; if ( ! has_any_capa...
Get a user competency in a course .
32,109
public static function list_user_competencies_in_course ( $ courseid , $ userid ) { static :: require_enabled ( ) ; $ context = context_course :: instance ( $ courseid ) ; $ onlyvisible = 1 ; $ capabilities = array ( 'moodle/competency:coursecompetencyview' , 'moodle/competency:coursecompetencymanage' ) ; if ( ! has_an...
List all the user competencies in a course .
32,110
public static function list_user_competencies_to_review ( $ skip = 0 , $ limit = 50 , $ userid = null ) { global $ DB , $ USER ; static :: require_enabled ( ) ; if ( $ userid === null ) { $ userid = $ USER -> id ; } $ capability = 'moodle/competency:usercompetencyreview' ; $ ucfields = user_competency :: get_sql_fields...
List the user competencies to review .
32,111
public static function add_competency_to_course_module ( $ cmorid , $ competencyid ) { static :: require_enabled ( ) ; $ cm = $ cmorid ; if ( ! is_object ( $ cmorid ) ) { $ cm = get_coursemodule_from_id ( '' , $ cmorid , 0 , true , MUST_EXIST ) ; } self :: validate_course_module ( $ cm ) ; $ context = context_module ::...
Add a competency to this course module .
32,112
public static function remove_competency_from_course_module ( $ cmorid , $ competencyid ) { static :: require_enabled ( ) ; $ cm = $ cmorid ; if ( ! is_object ( $ cmorid ) ) { $ cm = get_coursemodule_from_id ( '' , $ cmorid , 0 , true , MUST_EXIST ) ; } self :: validate_course_module ( $ cm ) ; $ context = context_modu...
Remove a competency from this course module .
32,113
public static function reorder_course_module_competency ( $ cmorid , $ competencyidfrom , $ competencyidto ) { static :: require_enabled ( ) ; $ cm = $ cmorid ; if ( ! is_object ( $ cmorid ) ) { $ cm = get_coursemodule_from_id ( '' , $ cmorid , 0 , true , MUST_EXIST ) ; } self :: validate_course_module ( $ cm ) ; $ con...
Move the course module competency up or down in the display list .
32,114
public static function set_course_module_competency_ruleoutcome ( $ coursemodulecompetencyorid , $ ruleoutcome ) { static :: require_enabled ( ) ; $ coursemodulecompetency = $ coursemodulecompetencyorid ; if ( ! is_object ( $ coursemodulecompetency ) ) { $ coursemodulecompetency = new course_module_competency ( $ cours...
Update ruleoutcome value for a course module competency .
32,115
public static function add_competency_to_course ( $ courseid , $ competencyid ) { static :: require_enabled ( ) ; self :: validate_course ( $ courseid ) ; $ context = context_course :: instance ( $ courseid ) ; require_capability ( 'moodle/competency:coursecompetencymanage' , $ context ) ; $ record = new stdClass ( ) ;...
Add a competency to this course .
32,116
public static function remove_competency_from_course ( $ courseid , $ competencyid ) { static :: require_enabled ( ) ; self :: validate_course ( $ courseid ) ; $ context = context_course :: instance ( $ courseid ) ; require_capability ( 'moodle/competency:coursecompetencymanage' , $ context ) ; $ record = new stdClass ...
Remove a competency from this course .
32,117
public static function reorder_course_competency ( $ courseid , $ competencyidfrom , $ competencyidto ) { static :: require_enabled ( ) ; self :: validate_course ( $ courseid ) ; $ context = context_course :: instance ( $ courseid ) ; require_capability ( 'moodle/competency:coursecompetencymanage' , $ context ) ; $ dow...
Move the course competency up or down in the display list .
32,118
public static function set_course_competency_ruleoutcome ( $ coursecompetencyorid , $ ruleoutcome ) { static :: require_enabled ( ) ; $ coursecompetency = $ coursecompetencyorid ; if ( ! is_object ( $ coursecompetency ) ) { $ coursecompetency = new course_competency ( $ coursecompetencyorid ) ; } $ courseid = $ coursec...
Update ruleoutcome value for a course competency .
32,119
public static function create_template ( stdClass $ record ) { static :: require_enabled ( ) ; $ template = new template ( 0 , $ record ) ; if ( ! $ template -> can_manage ( ) ) { throw new required_capability_exception ( $ template -> get_context ( ) , 'moodle/competency:templatemanage' , 'nopermissions' , '' ) ; } $ ...
Create a learning plan template from a record containing all the data for the class .
32,120
public static function delete_template ( $ id , $ deleteplans = true ) { global $ DB ; static :: require_enabled ( ) ; $ template = new template ( $ id ) ; if ( ! $ template -> can_manage ( ) ) { throw new required_capability_exception ( $ template -> get_context ( ) , 'moodle/competency:templatemanage' , 'nopermission...
Delete a learning plan template by id . If the learning plan template has associated cohorts they will be deleted .
32,121
public static function update_template ( $ record ) { global $ DB ; static :: require_enabled ( ) ; $ template = new template ( $ record -> id ) ; if ( ! $ template -> can_manage ( ) ) { throw new required_capability_exception ( $ template -> get_context ( ) , 'moodle/competency:templatemanage' , 'nopermissions' , '' )...
Update the details for a learning plan template .
32,122
public static function read_template ( $ id ) { static :: require_enabled ( ) ; $ template = new template ( $ id ) ; $ context = $ template -> get_context ( ) ; if ( ! $ template -> can_read ( ) ) { throw new required_capability_exception ( $ template -> get_context ( ) , 'moodle/competency:templateview' , 'nopermissio...
Read a the details for a single learning plan template and return a record .
32,123
public static function count_templates ( $ context , $ includes ) { global $ DB ; static :: require_enabled ( ) ; $ contexts = self :: get_related_contexts ( $ context , $ includes , array ( 'moodle/competency:templateview' , 'moodle/competency:templatemanage' ) ) ; if ( empty ( $ contexts ) ) { throw new required_capa...
Perform a search based on the provided filters and return how many results there are .
32,124
public static function count_templates_using_competency ( $ competencyid ) { static :: require_enabled ( ) ; $ context = context_system :: instance ( ) ; $ onlyvisible = 1 ; $ capabilities = array ( 'moodle/competency:templateview' , 'moodle/competency:templatemanage' ) ; if ( ! has_any_capability ( $ capabilities , $ ...
Count all the templates using a competency .
32,125
public static function list_templates_using_competency ( $ competencyid ) { static :: require_enabled ( ) ; $ context = context_system :: instance ( ) ; $ onlyvisible = 1 ; $ capabilities = array ( 'moodle/competency:templateview' , 'moodle/competency:templatemanage' ) ; if ( ! has_any_capability ( $ capabilities , $ c...
List all the learning plan templatesd using a competency .
32,126
public static function count_competencies_in_template ( $ templateorid ) { static :: require_enabled ( ) ; $ template = $ templateorid ; if ( ! is_object ( $ template ) ) { $ template = new template ( $ template ) ; } if ( ! $ template -> can_read ( ) ) { throw new required_capability_exception ( $ template -> get_cont...
Count all the competencies in a learning plan template .
32,127
public static function count_competencies_in_template_with_no_courses ( $ templateorid ) { $ template = $ templateorid ; if ( ! is_object ( $ template ) ) { $ template = new template ( $ template ) ; } if ( ! $ template -> can_read ( ) ) { throw new required_capability_exception ( $ template -> get_context ( ) , 'moodl...
Count all the competencies in a learning plan template with no linked courses .
32,128
public static function list_competencies_in_template ( $ templateorid ) { static :: require_enabled ( ) ; $ template = $ templateorid ; if ( ! is_object ( $ template ) ) { $ template = new template ( $ template ) ; } if ( ! $ template -> can_read ( ) ) { throw new required_capability_exception ( $ template -> get_conte...
List all the competencies in a template .
32,129
public static function add_competency_to_template ( $ templateid , $ competencyid ) { static :: require_enabled ( ) ; $ template = new template ( $ templateid ) ; if ( ! $ template -> can_manage ( ) ) { throw new required_capability_exception ( $ template -> get_context ( ) , 'moodle/competency:templatemanage' , 'noper...
Add a competency to this template .
32,130
public static function remove_competency_from_template ( $ templateid , $ competencyid ) { static :: require_enabled ( ) ; $ template = new template ( $ templateid ) ; if ( ! $ template -> can_manage ( ) ) { throw new required_capability_exception ( $ template -> get_context ( ) , 'moodle/competency:templatemanage' , '...
Remove a competency from this template .
32,131
public static function reorder_template_competency ( $ templateid , $ competencyidfrom , $ competencyidto ) { static :: require_enabled ( ) ; $ template = new template ( $ templateid ) ; if ( ! $ template -> can_manage ( ) ) { throw new required_capability_exception ( $ template -> get_context ( ) , 'moodle/competency:...
Move the template competency up or down in the display list .
32,132
public static function create_template_cohort ( $ templateorid , $ cohortorid ) { global $ DB ; static :: require_enabled ( ) ; $ template = $ templateorid ; if ( ! is_object ( $ template ) ) { $ template = new template ( $ template ) ; } require_capability ( 'moodle/competency:templatemanage' , $ template -> get_conte...
Create a relation between a template and a cohort .
32,133
public static function delete_template_cohort ( $ templateorid , $ cohortorid ) { global $ DB ; static :: require_enabled ( ) ; $ template = $ templateorid ; if ( ! is_object ( $ template ) ) { $ template = new template ( $ template ) ; } require_capability ( 'moodle/competency:templatemanage' , $ template -> get_conte...
Remove a relation between a template and a cohort .
32,134
public static function list_user_plans ( $ userid ) { global $ DB , $ USER ; static :: require_enabled ( ) ; $ select = 'userid = :userid' ; $ params = array ( 'userid' => $ userid ) ; $ context = context_user :: instance ( $ userid ) ; if ( ! plan :: can_read_user ( $ userid ) && ! plan :: can_read_user_draft ( $ user...
Lists user plans .
32,135
public static function list_plans_to_review ( $ skip = 0 , $ limit = 100 , $ userid = null ) { global $ DB , $ USER ; static :: require_enabled ( ) ; if ( $ userid === null ) { $ userid = $ USER -> id ; } $ planfields = plan :: get_sql_fields ( 'p' , 'plan_' ) ; $ tplfields = template :: get_sql_fields ( 't' , 'tpl_' )...
List the plans to review .
32,136
public static function create_plan ( stdClass $ record ) { global $ USER ; static :: require_enabled ( ) ; $ plan = new plan ( 0 , $ record ) ; if ( $ plan -> is_based_on_template ( ) ) { throw new coding_exception ( 'To create a plan from a template use api::create_plan_from_template().' ) ; } else if ( $ plan -> get ...
Creates a learning plan based on the provided data .
32,137
public static function create_plan_from_template ( $ templateorid , $ userid ) { static :: require_enabled ( ) ; $ template = $ templateorid ; if ( ! is_object ( $ template ) ) { $ template = new template ( $ template ) ; } if ( ! $ template -> can_read ( ) ) { throw new required_capability_exception ( $ template -> ge...
Create a learning plan from a template .
32,138
public static function create_plans_from_template_cohort ( $ templateorid , $ cohortid , $ recreateunlinked = false ) { global $ DB , $ CFG ; static :: require_enabled ( ) ; require_once ( $ CFG -> dirroot . '/cohort/lib.php' ) ; $ template = $ templateorid ; if ( ! is_object ( $ template ) ) { $ template = new templat...
Create learning plans from a template and cohort .
32,139
public static function unlink_plan_from_template ( $ planorid ) { global $ DB ; static :: require_enabled ( ) ; $ plan = $ planorid ; if ( ! is_object ( $ planorid ) ) { $ plan = new plan ( $ planorid ) ; } if ( ! $ plan -> can_manage ( ) ) { throw new required_capability_exception ( $ plan -> get_context ( ) , 'moodle...
Unlink a plan from its template .
32,140
public static function update_plan ( stdClass $ record ) { static :: require_enabled ( ) ; $ plan = new plan ( $ record -> id ) ; if ( ! $ plan -> can_manage ( ) ) { throw new required_capability_exception ( $ plan -> get_context ( ) , 'moodle/competency:planmanage' , 'nopermissions' , '' ) ; } else if ( $ plan -> get ...
Updates a plan .
32,141
public static function read_plan ( $ id ) { static :: require_enabled ( ) ; $ plan = new plan ( $ id ) ; if ( ! $ plan -> can_read ( ) ) { $ context = context_user :: instance ( $ plan -> get ( 'userid' ) ) ; throw new required_capability_exception ( $ context , 'moodle/competency:planview' , 'nopermissions' , '' ) ; }...
Returns a plan data .
32,142
public static function plan_viewed ( $ planorid ) { static :: require_enabled ( ) ; $ plan = $ planorid ; if ( ! is_object ( $ plan ) ) { $ plan = new plan ( $ plan ) ; } if ( ! $ plan -> can_read ( ) ) { $ context = context_user :: instance ( $ plan -> get ( 'userid' ) ) ; throw new required_capability_exception ( $ c...
Plan event viewed .
32,143
public static function delete_plan ( $ id ) { global $ DB ; static :: require_enabled ( ) ; $ plan = new plan ( $ id ) ; if ( ! $ plan -> can_manage ( ) ) { $ context = context_user :: instance ( $ plan -> get ( 'userid' ) ) ; throw new required_capability_exception ( $ context , 'moodle/competency:planmanage' , 'noper...
Deletes a plan .
32,144
public static function plan_cancel_review_request ( $ planorid ) { static :: require_enabled ( ) ; $ plan = $ planorid ; if ( ! is_object ( $ plan ) ) { $ plan = new plan ( $ plan ) ; } if ( ! $ plan -> can_read ( ) ) { throw new required_capability_exception ( $ plan -> get_context ( ) , 'moodle/competency:planview' ,...
Cancel the review of a plan .
32,145
public static function plan_start_review ( $ planorid ) { global $ USER ; static :: require_enabled ( ) ; $ plan = $ planorid ; if ( ! is_object ( $ plan ) ) { $ plan = new plan ( $ plan ) ; } if ( ! $ plan -> can_read ( ) ) { throw new required_capability_exception ( $ plan -> get_context ( ) , 'moodle/competency:plan...
Start the review of a plan .
32,146
public static function plan_stop_review ( $ planorid ) { static :: require_enabled ( ) ; $ plan = $ planorid ; if ( ! is_object ( $ plan ) ) { $ plan = new plan ( $ plan ) ; } if ( ! $ plan -> can_read ( ) ) { throw new required_capability_exception ( $ plan -> get_context ( ) , 'moodle/competency:planview' , 'nopermis...
Stop reviewing a plan .
32,147
public static function approve_plan ( $ planorid ) { static :: require_enabled ( ) ; $ plan = $ planorid ; if ( ! is_object ( $ plan ) ) { $ plan = new plan ( $ plan ) ; } if ( ! $ plan -> can_read ( ) ) { throw new required_capability_exception ( $ plan -> get_context ( ) , 'moodle/competency:planview' , 'nopermission...
Approve a plan .
32,148
public static function unapprove_plan ( $ planorid ) { static :: require_enabled ( ) ; $ plan = $ planorid ; if ( ! is_object ( $ plan ) ) { $ plan = new plan ( $ plan ) ; } if ( ! $ plan -> can_read ( ) ) { throw new required_capability_exception ( $ plan -> get_context ( ) , 'moodle/competency:planview' , 'nopermissi...
Unapprove a plan .
32,149
public static function complete_plan ( $ planorid ) { global $ DB ; static :: require_enabled ( ) ; $ plan = $ planorid ; if ( ! is_object ( $ planorid ) ) { $ plan = new plan ( $ planorid ) ; } if ( ! $ plan -> can_manage ( ) ) { throw new required_capability_exception ( $ plan -> get_context ( ) , 'moodle/competency:...
Complete a plan .
32,150
public static function reopen_plan ( $ planorid ) { global $ DB ; static :: require_enabled ( ) ; $ plan = $ planorid ; if ( ! is_object ( $ planorid ) ) { $ plan = new plan ( $ planorid ) ; } if ( ! $ plan -> can_manage ( ) ) { $ context = context_user :: instance ( $ plan -> get ( 'userid' ) ) ; throw new required_ca...
Reopen a plan .
32,151
public static function get_plan_competency ( $ planorid , $ competencyid ) { static :: require_enabled ( ) ; $ plan = $ planorid ; if ( ! is_object ( $ planorid ) ) { $ plan = new plan ( $ planorid ) ; } if ( ! user_competency :: can_read_user ( $ plan -> get ( 'userid' ) ) ) { throw new required_capability_exception (...
Get a single competency from the user plan .
32,152
public static function list_plans_with_competency ( $ userid , $ competencyorid ) { global $ USER ; static :: require_enabled ( ) ; $ competencyid = $ competencyorid ; $ competency = null ; if ( is_object ( $ competencyid ) ) { $ competency = $ competencyid ; $ competencyid = $ competency -> get ( 'id' ) ; } $ plans = ...
List the plans with a competency .
32,153
public static function list_plan_competencies ( $ planorid ) { static :: require_enabled ( ) ; $ plan = $ planorid ; if ( ! is_object ( $ planorid ) ) { $ plan = new plan ( $ planorid ) ; } if ( ! $ plan -> can_read ( ) ) { $ context = context_user :: instance ( $ plan -> get ( 'userid' ) ) ; throw new required_capabil...
List the competencies in a user plan .
32,154
public static function add_competency_to_plan ( $ planid , $ competencyid ) { static :: require_enabled ( ) ; $ plan = new plan ( $ planid ) ; if ( ! $ plan -> can_manage ( ) ) { throw new required_capability_exception ( $ plan -> get_context ( ) , 'moodle/competency:planmanage' , 'nopermissions' , '' ) ; } else if ( $...
Add a competency to a plan .
32,155
public static function remove_competency_from_plan ( $ planid , $ competencyid ) { static :: require_enabled ( ) ; $ plan = new plan ( $ planid ) ; if ( ! $ plan -> can_manage ( ) ) { $ context = context_user :: instance ( $ plan -> get ( 'userid' ) ) ; throw new required_capability_exception ( $ context , 'moodle/comp...
Remove a competency from a plan .
32,156
public static function reorder_plan_competency ( $ planid , $ competencyidfrom , $ competencyidto ) { static :: require_enabled ( ) ; $ plan = new plan ( $ planid ) ; if ( ! $ plan -> can_manage ( ) ) { $ context = context_user :: instance ( $ plan -> get ( 'userid' ) ) ; throw new required_capability_exception ( $ con...
Move the plan competency up or down in the display list .
32,157
public static function user_competency_cancel_review_request ( $ userid , $ competencyid ) { static :: require_enabled ( ) ; $ context = context_user :: instance ( $ userid ) ; $ uc = user_competency :: get_record ( array ( 'userid' => $ userid , 'competencyid' => $ competencyid ) ) ; if ( ! $ uc || ! $ uc -> can_read ...
Cancel a user competency review request .
32,158
public static function user_competency_request_review ( $ userid , $ competencyid ) { static :: require_enabled ( ) ; $ uc = user_competency :: get_record ( array ( 'userid' => $ userid , 'competencyid' => $ competencyid ) ) ; if ( ! $ uc ) { $ uc = user_competency :: create_relation ( $ userid , $ competencyid ) ; $ u...
Request a user competency review .
32,159
public static function user_competency_start_review ( $ userid , $ competencyid ) { global $ USER ; static :: require_enabled ( ) ; $ context = context_user :: instance ( $ userid ) ; $ uc = user_competency :: get_record ( array ( 'userid' => $ userid , 'competencyid' => $ competencyid ) ) ; if ( ! $ uc || ! $ uc -> ca...
Start a user competency review .
32,160
public static function user_competency_stop_review ( $ userid , $ competencyid ) { static :: require_enabled ( ) ; $ context = context_user :: instance ( $ userid ) ; $ uc = user_competency :: get_record ( array ( 'userid' => $ userid , 'competencyid' => $ competencyid ) ) ; if ( ! $ uc || ! $ uc -> can_read ( ) ) { th...
Stop a user competency review .
32,161
public static function list_related_competencies ( $ competencyid ) { static :: require_enabled ( ) ; $ competency = new competency ( $ competencyid ) ; if ( ! has_any_capability ( array ( 'moodle/competency:competencyview' , 'moodle/competency:competencymanage' ) , $ competency -> get_context ( ) ) ) { throw new requi...
List all the related competencies .
32,162
public static function add_related_competency ( $ competencyid , $ relatedcompetencyid ) { static :: require_enabled ( ) ; $ competency1 = new competency ( $ competencyid ) ; $ competency2 = new competency ( $ relatedcompetencyid ) ; require_capability ( 'moodle/competency:competencymanage' , $ competency1 -> get_conte...
Add a related competency .
32,163
public static function remove_related_competency ( $ competencyid , $ relatedcompetencyid ) { static :: require_enabled ( ) ; $ competency = new competency ( $ competencyid ) ; require_capability ( 'moodle/competency:competencymanage' , $ competency -> get_context ( ) ) ; $ relatedcompetency = related_competency :: get...
Remove a related competency .
32,164
public static function read_user_evidence ( $ id ) { static :: require_enabled ( ) ; $ userevidence = new user_evidence ( $ id ) ; if ( ! $ userevidence -> can_read ( ) ) { $ context = $ userevidence -> get_context ( ) ; throw new required_capability_exception ( $ context , 'moodle/competency:userevidenceview' , 'noper...
Read a user evidence .
32,165
public static function list_user_evidence ( $ userid ) { static :: require_enabled ( ) ; if ( ! user_evidence :: can_read_user ( $ userid ) ) { $ context = context_user :: instance ( $ userid ) ; throw new required_capability_exception ( $ context , 'moodle/competency:userevidenceview' , 'nopermissions' , '' ) ; } $ ev...
List the user evidence of a user .
32,166
public static function create_user_evidence_competency ( $ userevidenceorid , $ competencyid ) { global $ USER ; static :: require_enabled ( ) ; $ userevidence = $ userevidenceorid ; if ( ! is_object ( $ userevidence ) ) { $ userevidence = self :: read_user_evidence ( $ userevidence ) ; } if ( ! $ userevidence -> can_m...
Link a user evidence with a competency .
32,167
public static function delete_user_evidence_competency ( $ userevidenceorid , $ competencyid ) { global $ USER ; static :: require_enabled ( ) ; $ userevidence = $ userevidenceorid ; if ( ! is_object ( $ userevidence ) ) { $ userevidence = self :: read_user_evidence ( $ userevidence ) ; } if ( ! $ userevidence -> can_m...
Delete a relationship between a user evidence and a competency .
32,168
public static function request_review_of_user_evidence_linked_competencies ( $ id ) { $ userevidence = new user_evidence ( $ id ) ; $ context = $ userevidence -> get_context ( ) ; $ userid = $ userevidence -> get ( 'userid' ) ; if ( ! $ userevidence -> can_manage ( ) ) { throw new required_capability_exception ( $ cont...
Send request review for user evidence competencies .
32,169
protected static function duplicate_competency_tree ( $ frameworkid , $ tree , $ oldparent = 0 , $ newparent = 0 ) { $ matchids = array ( ) ; foreach ( $ tree as $ node ) { if ( $ node -> competency -> get ( 'parentid' ) == $ oldparent ) { $ parentid = $ node -> competency -> get ( 'id' ) ; $ competency = new competenc...
Recursively duplicate competencies from a tree we start duplicating from parents to children to have a correct path . This method does not copy the related competencies .
32,170
protected static function migrate_competency_tree_rules ( $ tree , $ matchids ) { foreach ( $ tree as $ node ) { $ oldcompid = $ node -> competency -> get ( 'id' ) ; if ( $ node -> competency -> get ( 'ruletype' ) && array_key_exists ( $ oldcompid , $ matchids ) ) { try { $ competency = $ matchids [ $ oldcompid ] ; $ c...
Recursively migrate competency rules .
32,171
protected static function archive_user_competencies_in_plan ( $ plan ) { if ( $ plan -> get ( 'status' ) == plan :: STATUS_COMPLETE ) { throw new coding_exception ( 'The plan is already completed.' ) ; } $ competencies = $ plan -> get_competencies ( ) ; $ usercompetencies = user_competency :: get_multiple ( $ plan -> g...
Archive user competencies in a plan .
32,172
protected static function remove_archived_user_competencies_in_plan ( $ plan ) { $ competencies = $ plan -> get_competencies ( ) ; $ usercompetenciesplan = user_competency_plan :: get_multiple ( $ plan -> get ( 'userid' ) , $ plan -> get ( 'id' ) , $ competencies ) ; foreach ( $ usercompetenciesplan as $ ucpkey => $ uc...
Delete archived user competencies in a plan .
32,173
public static function list_evidence ( $ userid = 0 , $ competencyid = 0 , $ planid = 0 , $ sort = 'timecreated' , $ order = 'DESC' , $ skip = 0 , $ limit = 0 ) { static :: require_enabled ( ) ; if ( ! user_competency :: can_read_user ( $ userid ) ) { $ context = context_user :: instance ( $ userid ) ; throw new requir...
List all the evidence for a user competency .
32,174
public static function list_evidence_in_course ( $ userid = 0 , $ courseid = 0 , $ competencyid = 0 , $ sort = 'timecreated' , $ order = 'DESC' , $ skip = 0 , $ limit = 0 ) { static :: require_enabled ( ) ; if ( ! user_competency :: can_read_user_in_course ( $ userid , $ courseid ) ) { $ context = context_user :: insta...
List all the evidence for a user competency in a course .
32,175
public static function read_evidence ( $ evidenceid ) { static :: require_enabled ( ) ; $ evidence = new evidence ( $ evidenceid ) ; $ uc = new user_competency ( $ evidence -> get ( 'usercompetencyid' ) ) ; if ( ! $ uc -> can_read ( ) ) { throw new required_capability_exception ( $ uc -> get_context ( ) , 'moodle/compe...
Read an evidence .
32,176
public static function delete_evidence ( $ evidenceorid ) { $ evidence = $ evidenceorid ; if ( ! is_object ( $ evidence ) ) { $ evidence = new evidence ( $ evidenceorid ) ; } $ uc = new user_competency ( $ evidence -> get ( 'usercompetencyid' ) ) ; if ( ! evidence :: can_delete_user ( $ uc -> get ( 'userid' ) ) ) { thr...
Delete an evidence .
32,177
protected static function apply_competency_rules_from_usercompetency ( user_competency $ usercompetency , competency $ competency = null ) { if ( ! $ usercompetency -> get ( 'proficiency' ) ) { throw new coding_exception ( 'The user competency passed is not completed.' ) ; } if ( $ competency === null ) { $ competency ...
Apply the competency rules from a user competency .
32,178
public static function observe_course_module_completion_updated ( \ core \ event \ course_module_completion_updated $ event ) { if ( ! static :: is_enabled ( ) ) { return ; } $ eventdata = $ event -> get_record_snapshot ( 'course_modules_completion' , $ event -> objectid ) ; if ( $ eventdata -> completionstate == COMPL...
Observe when a course module is marked as completed .
32,179
public static function observe_course_completed ( \ core \ event \ course_completed $ event ) { if ( ! static :: is_enabled ( ) ) { return ; } $ sql = 'courseid = :courseid AND ruleoutcome != :nooutcome' ; $ params = array ( 'courseid' => $ event -> courseid , 'nooutcome' => course_competency :: OUTCOME_NONE ) ; $ cour...
Observe when a course is marked as completed .
32,180
public static function hook_course_module_deleted ( stdClass $ cm ) { global $ DB ; $ DB -> delete_records ( course_module_competency :: TABLE , array ( 'cmid' => $ cm -> id ) ) ; }
Action to perform when a course module is deleted .
32,181
public static function hook_course_deleted ( stdClass $ course ) { global $ DB ; $ DB -> delete_records ( course_competency :: TABLE , array ( 'courseid' => $ course -> id ) ) ; $ DB -> delete_records ( course_competency_settings :: TABLE , array ( 'courseid' => $ course -> id ) ) ; $ DB -> delete_records ( user_compet...
Action to perform when a course is deleted .
32,182
public static function hook_cohort_deleted ( \ stdClass $ cohort ) { global $ DB ; $ DB -> delete_records ( template_cohort :: TABLE , array ( 'cohortid' => $ cohort -> id ) ) ; }
Action to perform when a cohort is deleted .
32,183
public static function grade_competency ( $ userid , $ competencyid , $ grade , $ note = null ) { global $ USER ; static :: require_enabled ( ) ; $ uc = static :: get_user_competency ( $ userid , $ competencyid ) ; $ context = $ uc -> get_context ( ) ; if ( ! user_competency :: can_grade_user ( $ uc -> get ( 'userid' )...
Manually grade a user competency .
32,184
public static function grade_competency_in_plan ( $ planorid , $ competencyid , $ grade , $ note = null ) { global $ USER ; static :: require_enabled ( ) ; $ plan = $ planorid ; if ( ! is_object ( $ planorid ) ) { $ plan = new plan ( $ planorid ) ; } $ context = $ plan -> get_context ( ) ; if ( ! user_competency :: can...
Manually grade a user competency from the plans page .
32,185
public static function grade_competency_in_course ( $ courseorid , $ userid , $ competencyid , $ grade , $ note = null ) { global $ USER , $ DB ; static :: require_enabled ( ) ; $ course = $ courseorid ; if ( ! is_object ( $ courseorid ) ) { $ course = $ DB -> get_record ( 'course' , array ( 'id' => $ courseorid ) ) ; ...
Manually grade a user course competency from the course page .
32,186
public static function count_plans_for_template ( $ templateorid , $ status = 0 ) { static :: require_enabled ( ) ; $ template = $ templateorid ; if ( ! is_object ( $ template ) ) { $ template = new template ( $ template ) ; } if ( ! $ template -> can_read ( ) ) { throw new required_capability_exception ( $ template ->...
Count the plans in the template filtered by status .
32,187
public static function count_user_competency_plans_for_template ( $ templateorid , $ proficiency = null ) { static :: require_enabled ( ) ; $ template = $ templateorid ; if ( ! is_object ( $ template ) ) { $ template = new template ( $ template ) ; } if ( ! $ template -> can_read ( ) ) { throw new required_capability_e...
Count the user - completency - plans in the template optionally filtered by proficiency .
32,188
public static function list_plans_for_template ( $ templateorid , $ status = 0 , $ skip = 0 , $ limit = 100 ) { $ template = $ templateorid ; if ( ! is_object ( $ template ) ) { $ template = new template ( $ template ) ; } if ( ! $ template -> can_read ( ) ) { throw new required_capability_exception ( $ template -> get...
List the plans in the template filtered by status .
32,189
public static function get_least_proficient_competencies_for_course ( $ courseid , $ skip = 0 , $ limit = 100 ) { static :: require_enabled ( ) ; $ coursecontext = context_course :: instance ( $ courseid ) ; if ( ! has_any_capability ( array ( 'moodle/competency:coursecompetencyview' , 'moodle/competency:coursecompeten...
Get the most often not completed competency for this course .
32,190
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 ) ; } if ( ! $ template -> can_read ( ) ) { throw new required_...
Get the most often not completed competency for this template .
32,191
public static function template_viewed ( $ templateorid ) { static :: require_enabled ( ) ; $ template = $ templateorid ; if ( ! is_object ( $ template ) ) { $ template = new template ( $ template ) ; } if ( ! $ template -> can_read ( ) ) { throw new required_capability_exception ( $ template -> get_context ( ) , 'mood...
Template event viewed .
32,192
public static function read_course_competency_settings ( $ courseid ) { static :: require_enabled ( ) ; if ( ! course_competency_settings :: can_read ( $ courseid ) ) { $ context = context_course :: instance ( $ courseid ) ; throw new required_capability_exception ( $ context , 'moodle/competency:coursecompetencyview' ...
Get the competency settings for a course .
32,193
public static function update_course_competency_settings ( $ courseid , $ settings ) { static :: require_enabled ( ) ; $ settings = ( object ) $ settings ; $ pushratingstouserplans = isset ( $ settings -> pushratingstouserplans ) ? $ settings -> pushratingstouserplans : false ; if ( ! course_competency_settings :: can_...
Update the competency settings for a course .
32,194
public function progress_bar ( array $ items ) { foreach ( $ items as & $ item ) { $ text = $ item [ 'text' ] ; unset ( $ item [ 'text' ] ) ; if ( array_key_exists ( 'link' , $ item ) ) { $ link = $ item [ 'link' ] ; unset ( $ item [ 'link' ] ) ; $ item = html_writer :: link ( $ link , $ text , $ item ) ; } else { $ it...
Renderers a progress bar for the backup or restore given the items that make it up .
32,195
public function backup_details_nonstandard ( $ nextstageurl , array $ details ) { $ html = html_writer :: start_tag ( 'div' , array ( 'class' => 'backup-restore nonstandardformat' ) ) ; $ html .= html_writer :: start_tag ( 'div' , array ( 'class' => 'backup-section' ) ) ; $ html .= $ this -> output -> heading ( get_str...
Displays the general information about a backup file with non - standard format
32,196
public function backup_details_unknown ( moodle_url $ nextstageurl ) { $ html = html_writer :: start_div ( 'unknownformat' ) ; $ html .= $ this -> output -> heading ( get_string ( 'errorinvalidformat' , 'backup' ) , 2 ) ; $ html .= $ this -> output -> notification ( get_string ( 'errorinvalidformatinfo' , 'backup' ) , ...
Displays the general information about a backup file with unknown format
32,197
public function import_course_selector ( moodle_url $ nextstageurl , import_course_search $ courses = null ) { $ html = html_writer :: start_tag ( 'div' , array ( 'class' => 'import-course-selector backup-restore' ) ) ; $ html .= html_writer :: start_tag ( 'form' , array ( 'method' => 'post' , 'action' => $ nextstageur...
Displays the import course selector
32,198
protected function backup_detail_input ( $ label , $ type , $ name , $ value , array $ attributes = array ( ) , $ description = null ) { if ( ! empty ( $ description ) ) { $ description = html_writer :: tag ( 'span' , $ description , array ( 'class' => 'description' ) ) ; } else { $ description = '' ; } return $ this -...
Created a detailed pairing with an input
32,199
protected function backup_detail_select ( $ label , $ name , $ options , $ selected = '' , $ nothing = false , array $ attributes = array ( ) , $ description = null ) { if ( ! empty ( $ description ) ) { $ description = html_writer :: tag ( 'span' , $ description , array ( 'class' => 'description' ) ) ; } else { $ desc...
Creates a detailed pairing with a select