diff --git a/course/externallib.php b/course/externallib.php index 4d8c7e8cc70..3e806227d19 100644 --- a/course/externallib.php +++ b/course/externallib.php @@ -217,6 +217,7 @@ class core_course_external extends external_api { 'id' => new external_value(PARAM_INT, 'activity id'), 'url' => new external_value(PARAM_URL, 'activity url', VALUE_OPTIONAL), 'name' => new external_value(PARAM_RAW, 'activity module name'), + 'instance' => new external_value(PARAM_INT, 'instance id', VALUE_OPTIONAL), 'description' => new external_value(PARAM_RAW, 'activity description', VALUE_OPTIONAL), 'visible' => new external_value(PARAM_INT, 'is the module visible', VALUE_OPTIONAL), 'modicon' => new external_value(PARAM_URL, 'activity icon url'), diff --git a/course/tests/externallib_test.php b/course/tests/externallib_test.php index a4e423450ba..a0c29f497e5 100644 --- a/course/tests/externallib_test.php +++ b/course/tests/externallib_test.php @@ -611,12 +611,14 @@ class core_course_externallib_testcase extends externallib_advanced_testcase { $formattedtext = format_text($cm->content, FORMAT_HTML, array('noclean' => true, 'para' => false, 'filter' => false)); $this->assertEquals($formattedtext, $module['description']); + $this->assertEquals($forumcm->instance, $module['instance']); $testexecuted = $testexecuted + 1; } else if ($module['id'] == $labelcm->id and $module['modname'] == 'label') { $cm = $modinfo->cms[$labelcm->id]; $formattedtext = format_text($cm->content, FORMAT_HTML, array('noclean' => true, 'para' => false, 'filter' => false)); $this->assertEquals($formattedtext, $module['description']); + $this->assertEquals($labelcm->instance, $module['instance']); $testexecuted = $testexecuted + 1; } }