I'm trying to customize the file build/mm.bundle.js
this is the code:
angular.module('mm.core.course')
.factory('$mmCourse', function($mmSite, $translate, $q, $log) {
$log = $log.getInstance('$mmCourse');
var self = {},
mods = ["assign", "assignment", "book", "chat", "choice", "data", "database", "date", "external-tool",
"feedback", "file", "folder", "forum", "glossary", "ims", "imscp", "label", "lesson", "lti", "page", "quiz",
"resource", "scorm", "survey", "url", "wiki", "workshop"
];
self.getModule = function(courseid, moduleid, sectionid) {
if (!moduleid) {
return $q.reject();
}
$log.debug('Getting module ' + moduleid + ' in course ' + courseid + ' and section ' +sectionid);
var params = {
courseid: courseid,
options: [
{
name: 'cmid',
value: moduleid
}
]
},
preSets = {
cacheKey: getModuleCacheKey(moduleid)
};
if (sectionid) {
params.options.push({
name: 'sectionid',
value: sectionid
});
}
return $mmSite.read('core_course_get_contents', params, preSets).then(function(sections) {
var section,
module;
for (var i = 0; i < sections.length; i++) {
section = sections[i];
console.log(sections[i]); //IT IS NOT WORK
for (var j = 0; j < section.modules.length; j++) {
module = section.modules[i];
if (module.id === moduleid) {
console.log(module.id); //IT IS NOT WORK
return module;
}
}
}
return $q.reject();
});
};
why JavaScript code can not be customized?
Thanks!