commit
39efa76f5f
|
@ -2473,9 +2473,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"com-darryncampbell-cordova-plugin-intent": {
|
"com-darryncampbell-cordova-plugin-intent": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.7",
|
||||||
"resolved": "https://registry.npmjs.org/com-darryncampbell-cordova-plugin-intent/-/com-darryncampbell-cordova-plugin-intent-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/com-darryncampbell-cordova-plugin-intent/-/com-darryncampbell-cordova-plugin-intent-1.1.7.tgz",
|
||||||
"integrity": "sha512-h+V54+qCFY1h5csX8lAKTxBn5DdbP/8/sm7vS6X0WZPI+OTKycxeoJC+oGtPHhlvTh4gSEVW5/MkDqANRcmaug=="
|
"integrity": "sha512-e+CIaOTpZ7r178tmCijZcm/o5nJIWVnQaUrwm5xwX1zc5zutVCtz1oH3xqq6gzNk05C9i7n96xdenODHMYpiMw=="
|
||||||
},
|
},
|
||||||
"combined-stream": {
|
"combined-stream": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
|
@ -2817,18 +2817,18 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cordova-android-support-gradle-release": {
|
"cordova-android-support-gradle-release": {
|
||||||
"version": "2.0.1",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/cordova-android-support-gradle-release/-/cordova-android-support-gradle-release-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/cordova-android-support-gradle-release/-/cordova-android-support-gradle-release-3.0.0.tgz",
|
||||||
"integrity": "sha512-HlX75PN8b9y3LIlAFLQspSbO7dr7hTRi2/n4A2Hz4AHb7NxiVt6VU+6j+JcseDveVdddh1sKMZd0xPtFMVNjXA==",
|
"integrity": "sha512-vyiqQ6N9Qb+4xRizWSpUX/LyJ1HaDN0piWc8xoS9Hx9YodIS3vyi1UpQyfLQmCixoeLVcRieKXjuSMXnUrv1dw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"semver": "5.1.0",
|
"q": "^1.4.1",
|
||||||
"xml2js": "~0.4.19"
|
"semver": "5.6.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"semver": {
|
"semver": {
|
||||||
"version": "5.1.0",
|
"version": "5.6.0",
|
||||||
"resolved": "http://registry.npmjs.org/semver/-/semver-5.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
|
||||||
"integrity": "sha1-hfLPhVBGXE3wAM99hvawVBBqueU="
|
"integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -8579,7 +8579,7 @@
|
||||||
},
|
},
|
||||||
"pegjs": {
|
"pegjs": {
|
||||||
"version": "0.10.0",
|
"version": "0.10.0",
|
||||||
"resolved": "http://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz",
|
||||||
"integrity": "sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0="
|
"integrity": "sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0="
|
||||||
},
|
},
|
||||||
"performance-now": {
|
"performance-now": {
|
||||||
|
@ -8815,6 +8815,11 @@
|
||||||
"integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=",
|
"integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"q": {
|
||||||
|
"version": "1.5.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz",
|
||||||
|
"integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc="
|
||||||
|
},
|
||||||
"qs": {
|
"qs": {
|
||||||
"version": "6.5.2",
|
"version": "6.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
|
||||||
|
@ -9607,7 +9612,8 @@
|
||||||
"sax": {
|
"sax": {
|
||||||
"version": "1.2.4",
|
"version": "1.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
|
||||||
|
"dev": true
|
||||||
},
|
},
|
||||||
"scss-tokenizer": {
|
"scss-tokenizer": {
|
||||||
"version": "0.2.3",
|
"version": "0.2.3",
|
||||||
|
@ -12207,6 +12213,7 @@
|
||||||
"version": "0.4.19",
|
"version": "0.4.19",
|
||||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz",
|
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz",
|
||||||
"integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==",
|
"integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==",
|
||||||
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"sax": ">=0.6.0",
|
"sax": ">=0.6.0",
|
||||||
"xmlbuilder": "~9.0.1"
|
"xmlbuilder": "~9.0.1"
|
||||||
|
@ -12215,7 +12222,8 @@
|
||||||
"xmlbuilder": {
|
"xmlbuilder": {
|
||||||
"version": "9.0.7",
|
"version": "9.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
|
||||||
"integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0="
|
"integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=",
|
||||||
|
"dev": true
|
||||||
},
|
},
|
||||||
"xmldom": {
|
"xmldom": {
|
||||||
"version": "0.1.27",
|
"version": "0.1.27",
|
||||||
|
|
|
@ -16,7 +16,6 @@ import { Injectable, Injector } from '@angular/core';
|
||||||
import { CoreCourseOptionsHandler, CoreCourseOptionsHandlerData } from '@core/course/providers/options-delegate';
|
import { CoreCourseOptionsHandler, CoreCourseOptionsHandlerData } from '@core/course/providers/options-delegate';
|
||||||
import { CoreCourseProvider } from '@core/course/providers/course';
|
import { CoreCourseProvider } from '@core/course/providers/course';
|
||||||
import { CoreGradesProvider } from './grades';
|
import { CoreGradesProvider } from './grades';
|
||||||
import { CoreGradesHelperProvider } from './helper';
|
|
||||||
import { CoreCoursesProvider } from '@core/courses/providers/courses';
|
import { CoreCoursesProvider } from '@core/courses/providers/courses';
|
||||||
import { CoreGradesCourseComponent } from '../components/course/course';
|
import { CoreGradesCourseComponent } from '../components/course/course';
|
||||||
|
|
||||||
|
@ -28,8 +27,7 @@ export class CoreGradesCourseOptionHandler implements CoreCourseOptionsHandler {
|
||||||
name = 'CoreGrades';
|
name = 'CoreGrades';
|
||||||
priority = 400;
|
priority = 400;
|
||||||
|
|
||||||
constructor(private gradesProvider: CoreGradesProvider, private coursesProvider: CoreCoursesProvider,
|
constructor(private gradesProvider: CoreGradesProvider, private coursesProvider: CoreCoursesProvider) {}
|
||||||
private gradesHelper: CoreGradesHelperProvider) {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should invalidate the data to determine if the handler is enabled for a certain course.
|
* Should invalidate the data to determine if the handler is enabled for a certain course.
|
||||||
|
@ -100,20 +98,6 @@ export class CoreGradesCourseOptionHandler implements CoreCourseOptionsHandler {
|
||||||
* @return {Promise<any>} Promise resolved when done.
|
* @return {Promise<any>} Promise resolved when done.
|
||||||
*/
|
*/
|
||||||
prefetch(course: any): Promise<any> {
|
prefetch(course: any): Promise<any> {
|
||||||
return this.gradesProvider.getCourseGradesTable(course.id, undefined, undefined, true).then((table) => {
|
return this.gradesProvider.getCourseGradesTable(course.id, undefined, undefined, true);
|
||||||
const promises = [];
|
|
||||||
|
|
||||||
table = this.gradesHelper.formatGradesTable(table);
|
|
||||||
|
|
||||||
if (table && table.rows) {
|
|
||||||
table.rows.forEach((row) => {
|
|
||||||
if (row.itemtype != 'category') {
|
|
||||||
promises.push(this.gradesHelper.getGradeItem(course.id, row.id, undefined, undefined, true));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return Promise.all(promises);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue