Merge branch 'MDL-73084-master' of https://github.com/jleyva/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2021-12-02 19:27:54 +01:00
commit 42900a7550
3 changed files with 6 additions and 0 deletions

View File

@ -435,6 +435,7 @@ class core_enrol_external extends external_api {
'overviewfiles' => $overviewfiles,
'showactivitydates' => $course->showactivitydates,
'showcompletionconditions' => $course->showcompletionconditions,
'timemodified' => $course->timemodified,
];
if ($returnusercount) {
$courseresult['enrolledusercount'] = $enrolledusercount;
@ -483,6 +484,8 @@ class core_enrol_external extends external_api {
'overviewfiles' => new external_files('Overview files attached to this course.', VALUE_OPTIONAL),
'showactivitydates' => new external_value(PARAM_BOOL, 'Whether the activity dates are shown or not'),
'showcompletionconditions' => new external_value(PARAM_BOOL, 'Whether the activity completion conditions are shown or not'),
'timemodified' => new external_value(PARAM_INT, 'Last time course settings were updated (timestamp).',
VALUE_OPTIONAL),
)
)
);

View File

@ -546,6 +546,7 @@ class core_enrol_externallib_testcase extends externallib_advanced_testcase {
$this->assertTrue($courseenrol['hidden']);
$this->assertTrue($courseenrol['isfavourite']);
$this->assertEquals(2, $courseenrol['enrolledusercount']);
$this->assertEquals($course1->timemodified, $courseenrol['timemodified']);
} else {
// Check language pack. Should be empty since an incorrect one was used when creating the course.
$this->assertEmpty($courseenrol['lang']);
@ -559,6 +560,7 @@ class core_enrol_externallib_testcase extends externallib_advanced_testcase {
$this->assertFalse($courseenrol['hidden']);
$this->assertFalse($courseenrol['isfavourite']);
$this->assertEquals(1, $courseenrol['enrolledusercount']);
$this->assertEquals($course2->timemodified, $courseenrol['timemodified']);
}
}

View File

@ -5,6 +5,7 @@ information provided here is intended especially for developers.
* Final deprecation of the following webservice:
* core_enrol_edit_user_enrolment
* External function core_enrol_external::get_users_courses now returns the last time a course was modified (timemodified field)
=== 3.11 ===