Skip to content

Commit

Permalink
MDL-68437 course: ws support to optionally fetch only active users
Browse files Browse the repository at this point in the history
Modifies the 'core_course_get_enrolled_users_by_cmid' webservice and
the generic js methods that call this webservice and enables defining
whether the ws should only return the active users or all enrolled
users in the course.
  • Loading branch information
Mihail Geshoski committed Sep 29, 2022
1 parent 8f492a8 commit 383e189
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 10 deletions.
2 changes: 1 addition & 1 deletion course/amd/build/repository.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion course/amd/build/repository.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion course/amd/src/repository.js
Expand Up @@ -134,14 +134,16 @@ const getLastAccessedCourses = (userid, limit, offset, sort) => {
*
* @param {Number} cmid Course Module from which the users will be obtained
* @param {Number} groupID Group ID from which the users will be obtained
* @param {Boolean} onlyActive Whether to fetch only the active enrolled users or all enrolled users in the course.
* @returns {Promise} Promise containing a list of users
*/
const getEnrolledUsersFromCourseModuleID = (cmid, groupID) => {
const getEnrolledUsersFromCourseModuleID = (cmid, groupID, onlyActive = false) => {
var request = {
methodname: 'core_course_get_enrolled_users_by_cmid',
args: {
cmid: cmid,
groupid: groupID,
onlyactive: onlyActive,
},
};

Expand Down

0 comments on commit 383e189

Please sign in to comment.