Merge branch 'MDL-65078-36' of git://github.com/peterRd/moodle into MOODLE_36_STABLE

This commit is contained in:
Adrian Greeve
2019-07-24 09:53:55 +08:00
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -1205,7 +1205,7 @@ class api {
$result = array();
// TODO We could improve the performance of this into one single query.
$coursemodulecompetencies = course_competency::list_course_module_competencies($cm->id);
$coursemodulecompetencies = course_module_competency::list_course_module_competencies($cm->id);
$competencies = course_module_competency::list_competencies($cm->id);
// Build the return values.
+10
View File
@@ -2757,6 +2757,16 @@ class core_competency_api_testcase extends advanced_testcase {
$result = api::list_course_module_competencies_in_course_module($cm->id);
$this->assertEquals($result[0]->get('competencyid'), $c->get('id'));
$this->assertEquals($result[1]->get('competencyid'), $c2->get('id'));
// Now get the course competency and coursemodule competency together.
$result = api::list_course_module_competencies($cm->id);
// Now we should have an array and each element of the array should have a competency and
// a coursemodulecompetency.
foreach ($result as $instance) {
$cmc = $instance['coursemodulecompetency'];
$c = $instance['competency'];
$this->assertEquals($cmc->get('competencyid'), $c->get('id'));
}
}
/**