commit
783b7fe3a8
|
@ -24,7 +24,7 @@ import { AddonCompetencyProvider } from '../providers/competency';
|
|||
@Injectable()
|
||||
export class AddonCompetencyCourseOptionHandler implements CoreCourseOptionsHandler {
|
||||
name = 'AddonCompetency';
|
||||
priority = 700;
|
||||
priority = 300;
|
||||
|
||||
constructor(private competencyProvider: AddonCompetencyProvider) {}
|
||||
|
||||
|
|
|
@ -261,8 +261,9 @@ export class CoreCourseOptionsDelegate extends CoreDelegate {
|
|||
course.id = parseInt(course.id, 10);
|
||||
|
||||
const accessData = {
|
||||
type: isGuest ? CoreCourseProvider.ACCESS_GUEST : CoreCourseProvider.ACCESS_DEFAULT
|
||||
};
|
||||
type: isGuest ? CoreCourseProvider.ACCESS_GUEST : CoreCourseProvider.ACCESS_DEFAULT
|
||||
},
|
||||
handlersToDisplay: CoreCourseOptionsHandlerToDisplay[] = [];
|
||||
|
||||
if (navOptions) {
|
||||
course.navOptions = navOptions;
|
||||
|
@ -275,8 +276,7 @@ export class CoreCourseOptionsDelegate extends CoreDelegate {
|
|||
// Call getHandlersForAccess to make sure the handlers have been loaded.
|
||||
return this.getHandlersForAccess(course.id, refresh, accessData, course.navOptions, course.admOptions);
|
||||
}).then(() => {
|
||||
const handlersToDisplay: CoreCourseOptionsHandlerToDisplay[] = [],
|
||||
promises = [];
|
||||
const promises = [];
|
||||
|
||||
this.coursesHandlers[course.id].enabledHandlers.forEach((handler) => {
|
||||
promises.push(Promise.resolve(handler.getDisplayData(injector, course)).then((data) => {
|
||||
|
@ -291,6 +291,9 @@ export class CoreCourseOptionsDelegate extends CoreDelegate {
|
|||
}));
|
||||
});
|
||||
|
||||
return Promise.all(promises);
|
||||
}).then(() => {
|
||||
|
||||
// Sort them by priority.
|
||||
handlersToDisplay.sort((a, b) => {
|
||||
return b.priority - a.priority;
|
||||
|
|
Loading…
Reference in New Issue