diff --git a/course/amd/build/repository.min.js b/course/amd/build/repository.min.js
index 4fc5fff0f1e..3c301ffbb76 100644
--- a/course/amd/build/repository.min.js
+++ b/course/amd/build/repository.min.js
@@ -1,2 +1,2 @@
-define ("core_course/repository",["jquery","core/ajax"],function(a,b){return{getEnrolledCoursesByTimelineClassification:function getEnrolledCoursesByTimelineClassification(a,c,d,e){var f={classification:a};if("undefined"!=typeof c){f.limit=c}if("undefined"!=typeof d){f.offset=d}if("undefined"!=typeof e){f.sort=e}return b.call([{methodname:"core_course_get_enrolled_courses_by_timeline_classification",args:f}])[0]},getLastAccessedCourses:function getLastAccessedCourses(a,c,d,e){var f={};if("undefined"!=typeof a){f.limit=c}if("undefined"!=typeof c){f.limit=c}if("undefined"!=typeof d){f.offset=d}if("undefined"!=typeof e){f.sort=e}return b.call([{methodname:"core_course_get_recent_courses",args:f}])[0]}}});
+define ("core_course/repository",["jquery","core/ajax"],function(a,b){return{getEnrolledCoursesByTimelineClassification:function getEnrolledCoursesByTimelineClassification(a,c,d,e){var f={classification:a};if("undefined"!=typeof c){f.limit=c}if("undefined"!=typeof d){f.offset=d}if("undefined"!=typeof e){f.sort=e}return b.call([{methodname:"core_course_get_enrolled_courses_by_timeline_classification",args:f}])[0]},getLastAccessedCourses:function getLastAccessedCourses(a,c,d,e){var f={};if("undefined"!=typeof a){f.userid=a}if("undefined"!=typeof c){f.limit=c}if("undefined"!=typeof d){f.offset=d}if("undefined"!=typeof e){f.sort=e}return b.call([{methodname:"core_course_get_recent_courses",args:f}])[0]}}});
//# sourceMappingURL=repository.min.js.map
diff --git a/course/amd/build/repository.min.js.map b/course/amd/build/repository.min.js.map
index 11f07a12948..21f6694971f 100644
--- a/course/amd/build/repository.min.js.map
+++ b/course/amd/build/repository.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../src/repository.js"],"names":["define","$","Ajax","getEnrolledCoursesByTimelineClassification","classification","limit","offset","sort","args","call","methodname","getLastAccessedCourses","userid"],"mappings":"AAsBAA,O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,CAAE,gCADF,CAEVF,IAAI,CAAEA,CAFI,CAKG,CAAV,EAAqB,CAArB,CACV,CAEM,CAIV,CA9EK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to handle course ajax actions.\n *\n * @module core_course/repository\n * @copyright 2018 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax'], function($, Ajax) {\n\n /**\n * Get the list of courses that the logged in user is enrolled in for a given\n * timeline classification.\n *\n * @param {string} classification past, inprogress, or future\n * @param {int} limit Only return this many results\n * @param {int} offset Skip this many results from the start of the result set\n * @param {string} sort Column to sort by and direction, e.g. 'shortname asc'\n * @return {object} jQuery promise resolved with courses.\n */\n var getEnrolledCoursesByTimelineClassification = function(classification, limit, offset, sort) {\n var args = {\n classification: classification\n };\n\n if (typeof limit !== 'undefined') {\n args.limit = limit;\n }\n\n if (typeof offset !== 'undefined') {\n args.offset = offset;\n }\n\n if (typeof sort !== 'undefined') {\n args.sort = sort;\n }\n\n var request = {\n methodname: 'core_course_get_enrolled_courses_by_timeline_classification',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Get the list of courses that the user has most recently accessed.\n *\n * @method getLastAccessedCourses\n * @param {int} userid User from which the courses will be obtained\n * @param {int} limit Only return this many results\n * @param {int} offset Skip this many results from the start of the result set\n * @param {string} sort Column to sort by and direction, e.g. 'shortname asc'\n * @return {promise} Resolved with an array of courses\n */\n var getLastAccessedCourses = function(userid, limit, offset, sort) {\n var args = {};\n\n if (typeof userid !== 'undefined') {\n args.limit = limit;\n }\n\n if (typeof limit !== 'undefined') {\n args.limit = limit;\n }\n\n if (typeof offset !== 'undefined') {\n args.offset = offset;\n }\n\n if (typeof sort !== 'undefined') {\n args.sort = sort;\n }\n\n var request = {\n methodname: 'core_course_get_recent_courses',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n return {\n getEnrolledCoursesByTimelineClassification: getEnrolledCoursesByTimelineClassification,\n getLastAccessedCourses: getLastAccessedCourses\n };\n});\n"],"file":"repository.min.js"}
\ No newline at end of file
+{"version":3,"sources":["../src/repository.js"],"names":["define","$","Ajax","getEnrolledCoursesByTimelineClassification","classification","limit","offset","sort","args","call","methodname","getLastAccessedCourses","userid"],"mappings":"AAsBAA,OAAM,0BAAC,CAAC,QAAD,CAAW,WAAX,CAAD,CAA0B,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CA0E9C,MAAO,CACHC,0CAA0C,CA/DG,QAA7CA,CAAAA,0CAA6C,CAASC,CAAT,CAAyBC,CAAzB,CAAgCC,CAAhC,CAAwCC,CAAxC,CAA8C,CAC3F,GAAIC,CAAAA,CAAI,CAAG,CACPJ,cAAc,CAAEA,CADT,CAAX,CAIA,GAAqB,WAAjB,QAAOC,CAAAA,CAAX,CAAkC,CAC9BG,CAAI,CAACH,KAAL,CAAaA,CAChB,CAED,GAAsB,WAAlB,QAAOC,CAAAA,CAAX,CAAmC,CAC/BE,CAAI,CAACF,MAAL,CAAcA,CACjB,CAED,GAAoB,WAAhB,QAAOC,CAAAA,CAAX,CAAiC,CAC7BC,CAAI,CAACD,IAAL,CAAYA,CACf,CAOD,MAAOL,CAAAA,CAAI,CAACO,IAAL,CAAU,CALH,CACVC,UAAU,CAAE,6DADF,CAEVF,IAAI,CAAEA,CAFI,CAKG,CAAV,EAAqB,CAArB,CACV,CAuCM,CAEHG,sBAAsB,CA7BG,QAAzBA,CAAAA,sBAAyB,CAASC,CAAT,CAAiBP,CAAjB,CAAwBC,CAAxB,CAAgCC,CAAhC,CAAsC,CAC/D,GAAIC,CAAAA,CAAI,CAAG,EAAX,CAEA,GAAsB,WAAlB,QAAOI,CAAAA,CAAX,CAAmC,CAC/BJ,CAAI,CAACI,MAAL,CAAcA,CACjB,CAED,GAAqB,WAAjB,QAAOP,CAAAA,CAAX,CAAkC,CAC9BG,CAAI,CAACH,KAAL,CAAaA,CAChB,CAED,GAAsB,WAAlB,QAAOC,CAAAA,CAAX,CAAmC,CAC/BE,CAAI,CAACF,MAAL,CAAcA,CACjB,CAED,GAAoB,WAAhB,QAAOC,CAAAA,CAAX,CAAiC,CAC7BC,CAAI,CAACD,IAAL,CAAYA,CACf,CAOD,MAAOL,CAAAA,CAAI,CAACO,IAAL,CAAU,CALH,CACVC,UAAU,CAAE,gCADF,CAEVF,IAAI,CAAEA,CAFI,CAKG,CAAV,EAAqB,CAArB,CACV,CAEM,CAIV,CA9EK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to handle course ajax actions.\n *\n * @module core_course/repository\n * @copyright 2018 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax'], function($, Ajax) {\n\n /**\n * Get the list of courses that the logged in user is enrolled in for a given\n * timeline classification.\n *\n * @param {string} classification past, inprogress, or future\n * @param {int} limit Only return this many results\n * @param {int} offset Skip this many results from the start of the result set\n * @param {string} sort Column to sort by and direction, e.g. 'shortname asc'\n * @return {object} jQuery promise resolved with courses.\n */\n var getEnrolledCoursesByTimelineClassification = function(classification, limit, offset, sort) {\n var args = {\n classification: classification\n };\n\n if (typeof limit !== 'undefined') {\n args.limit = limit;\n }\n\n if (typeof offset !== 'undefined') {\n args.offset = offset;\n }\n\n if (typeof sort !== 'undefined') {\n args.sort = sort;\n }\n\n var request = {\n methodname: 'core_course_get_enrolled_courses_by_timeline_classification',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Get the list of courses that the user has most recently accessed.\n *\n * @method getLastAccessedCourses\n * @param {int} userid User from which the courses will be obtained\n * @param {int} limit Only return this many results\n * @param {int} offset Skip this many results from the start of the result set\n * @param {string} sort Column to sort by and direction, e.g. 'shortname asc'\n * @return {promise} Resolved with an array of courses\n */\n var getLastAccessedCourses = function(userid, limit, offset, sort) {\n var args = {};\n\n if (typeof userid !== 'undefined') {\n args.userid = userid;\n }\n\n if (typeof limit !== 'undefined') {\n args.limit = limit;\n }\n\n if (typeof offset !== 'undefined') {\n args.offset = offset;\n }\n\n if (typeof sort !== 'undefined') {\n args.sort = sort;\n }\n\n var request = {\n methodname: 'core_course_get_recent_courses',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n return {\n getEnrolledCoursesByTimelineClassification: getEnrolledCoursesByTimelineClassification,\n getLastAccessedCourses: getLastAccessedCourses\n };\n});\n"],"file":"repository.min.js"}
\ No newline at end of file
diff --git a/course/amd/src/repository.js b/course/amd/src/repository.js
index 98b67d5a24d..6340eab31b1 100644
--- a/course/amd/src/repository.js
+++ b/course/amd/src/repository.js
@@ -71,7 +71,7 @@ define(['jquery', 'core/ajax'], function($, Ajax) {
var args = {};
if (typeof userid !== 'undefined') {
- args.limit = limit;
+ args.userid = userid;
}
if (typeof limit !== 'undefined') {