We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79ea974 commit 8b431fbCopy full SHA for 8b431fb
www/addons/mod/assign/services/assign_offline.js
@@ -119,9 +119,13 @@ angular.module('mm.addons.mod_assign')
119
promises.push(self.getAssignSubmissionsGrade(assignId, siteId));
120
121
return $q.all(promises).then(function(objects) {
122
- return objects.reduce(function(a, b) {
123
- return a.length > 0 || b.length > 0;
124
- }, []);
+ for (var i = 0; i < objects.length; i++) {
+ var result = objects[i];
+ if (result && result.length) {
125
+ return true;
126
+ }
127
128
+ return false;
129
}).catch(function() {
130
// No offline data found.
131
return false;
0 commit comments