Merge pull request #2251 from crazyserver/MOBILE-3314

MOBILE-3314 assign: Check grade access before prefetch
main
Juan Leyva 2020-01-29 11:33:50 +01:00 committed by GitHub
commit 90fecdefa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -443,7 +443,11 @@ export class AddonModAssignPrefetchHandler extends CoreCourseActivityPrefetchHan
// Prefetch grade items.
if (userId) {
promises.push(this.gradesHelper.getGradeModuleItems(courseId, moduleId, userId, undefined, siteId, true));
promises.push(this.courseProvider.getModuleBasicGradeInfo(moduleId, siteId).then((gradeInfo) => {
if (gradeInfo) {
promises.push(this.gradesHelper.getGradeModuleItems(courseId, moduleId, userId, undefined, siteId, true));
}
}));
}
// Prefetch feedback.

View File

@ -24,7 +24,6 @@ import { CoreGroupsProvider } from '@providers/groups';
import { CoreTextUtilsProvider } from '@providers/utils/text';
import { CoreCourseActivityPrefetchHandlerBase } from '@core/course/classes/activity-prefetch-handler';
import { CoreCourseHelperProvider } from '@core/course/providers/helper';
import { CoreGradesHelperProvider } from '@core/grades/providers/helper';
import { CoreUserProvider } from '@core/user/providers/user';
import { AddonModWikiProvider } from './wiki';
import { AddonModWikiSyncProvider } from './wiki-sync';
@ -55,7 +54,6 @@ export class AddonModWikiPrefetchHandler extends CoreCourseActivityPrefetchHandl
protected textUtils: CoreTextUtilsProvider,
protected courseHelper: CoreCourseHelperProvider,
protected groupsProvider: CoreGroupsProvider,
protected gradesHelper: CoreGradesHelperProvider,
protected syncProvider: AddonModWikiSyncProvider) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper,