forked from CIT/Vmeda.Online
		
	
						commit
						eb36ee048c
					
				| @ -33,7 +33,7 @@ | |||||||
|     <preference name="AndroidPersistentFileLocation" value="Compatibility" /> |     <preference name="AndroidPersistentFileLocation" value="Compatibility" /> | ||||||
|     <preference name="iosPersistentFileLocation" value="Compatibility" /> |     <preference name="iosPersistentFileLocation" value="Compatibility" /> | ||||||
|     <preference name="SplashScreen" value="screen" /> |     <preference name="SplashScreen" value="screen" /> | ||||||
|     <preference name="SplashScreenDelay" value="3000" /> |     <preference name="SplashScreenDelay" value="10000" /> | ||||||
|     <preference name="SplashMaintainAspectRatio" value="true" /> |     <preference name="SplashMaintainAspectRatio" value="true" /> | ||||||
|     <feature name="StatusBar"> |     <feature name="StatusBar"> | ||||||
|         <param name="ios-package" onload="true" value="CDVStatusBar" /> |         <param name="ios-package" onload="true" value="CDVStatusBar" /> | ||||||
|  | |||||||
							
								
								
									
										38
									
								
								gulpfile.js
									
									
									
									
									
								
							
							
						
						
									
										38
									
								
								gulpfile.js
									
									
									
									
									
								
							| @ -6,6 +6,8 @@ var gulp = require('gulp'), | |||||||
|     slash = require('gulp-slash'), |     slash = require('gulp-slash'), | ||||||
|     clipEmptyFiles = require('gulp-clip-empty-files'), |     clipEmptyFiles = require('gulp-clip-empty-files'), | ||||||
|     gutil = require('gulp-util'), |     gutil = require('gulp-util'), | ||||||
|  |     flatten = require('gulp-flatten'), | ||||||
|  |     npmPath = require('path'), | ||||||
|     File = gutil.File, |     File = gutil.File, | ||||||
|     license = '' + |     license = '' + | ||||||
|         '// (C) Copyright 2015 Martin Dougiamas\n' + |         '// (C) Copyright 2015 Martin Dougiamas\n' + | ||||||
| @ -185,6 +187,22 @@ function buildLangs(filenames, langPaths, buildDest, done) { | |||||||
|     }); |     }); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | // Delete a folder and all its contents.
 | ||||||
|  | function deleteFolderRecursive(path) { | ||||||
|  |   if (fs.existsSync(path)) { | ||||||
|  |     fs.readdirSync(path).forEach(function(file) { | ||||||
|  |       var curPath = npmPath.join(path, file); | ||||||
|  |       if (fs.lstatSync(curPath).isDirectory()) { | ||||||
|  |         deleteFolderRecursive(curPath); | ||||||
|  |       } else { | ||||||
|  |         fs.unlinkSync(curPath); | ||||||
|  |       } | ||||||
|  |     }); | ||||||
|  | 
 | ||||||
|  |     fs.rmdirSync(path); | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
| // List of app lang files. To be used only if cannot get it from filesystem.
 | // List of app lang files. To be used only if cannot get it from filesystem.
 | ||||||
| var appLangFiles = ['ar.json', 'bg.json', 'ca.json', 'cs.json', 'da.json', 'de.json', 'en.json', 'es-mx.json', 'es.json', 'eu.json', | var appLangFiles = ['ar.json', 'bg.json', 'ca.json', 'cs.json', 'da.json', 'de.json', 'en.json', 'es-mx.json', 'es.json', 'eu.json', | ||||||
|     'fa.json', 'fr.json', 'he.json', 'hu.json', 'it.json', 'ja.json', 'nl.json', 'pl.json', 'pt-br.json', 'pt.json', 'ro.json', |     'fa.json', 'fr.json', 'he.json', 'hu.json', 'it.json', 'ja.json', 'nl.json', 'pl.json', 'pt-br.json', 'pt.json', 'ro.json', | ||||||
| @ -269,3 +287,23 @@ gulp.task('config', function(done) { | |||||||
|         .pipe(gulp.dest(paths.src)) |         .pipe(gulp.dest(paths.src)) | ||||||
|         .on('end', done); |         .on('end', done); | ||||||
| }); | }); | ||||||
|  | 
 | ||||||
|  | var templatesSrc = [ | ||||||
|  |         './src/components/**/*.html', | ||||||
|  |         './src/core/**/components/**/*.html', | ||||||
|  |         './src/core/**/component/**/*.html', | ||||||
|  |         // Only some addon components are injected to compile to decrease load time. Copy only the ones that are needed.
 | ||||||
|  |         './src/addon/mod/assign/components/**/*.html' | ||||||
|  |     ], | ||||||
|  |     templatesDest = './www/templates'; | ||||||
|  | 
 | ||||||
|  | // Copy component templates to www to make compile-html work in AOT.
 | ||||||
|  | gulp.task('copy-component-templates', function(done) { | ||||||
|  |     deleteFolderRecursive(templatesDest); | ||||||
|  | 
 | ||||||
|  |     gulp.src(templatesSrc) | ||||||
|  |         .pipe(flatten()) | ||||||
|  |         .pipe(gulp.dest(templatesDest)) | ||||||
|  |         .on('end', done); | ||||||
|  | }); | ||||||
|  | 
 | ||||||
|  | |||||||
							
								
								
									
										5119
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										5119
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										33
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										33
									
								
								package.json
									
									
									
									
									
								
							| @ -27,21 +27,23 @@ | |||||||
|     "clean": "ionic-app-scripts clean", |     "clean": "ionic-app-scripts clean", | ||||||
|     "build": "ionic-app-scripts build", |     "build": "ionic-app-scripts build", | ||||||
|     "lint": "ionic-app-scripts lint", |     "lint": "ionic-app-scripts lint", | ||||||
|     "ionic:build": "ionic-app-scripts build", |     "ionic:build": "node --max-old-space-size=16384 ./node_modules/@ionic/app-scripts/bin/ionic-app-scripts.js build", | ||||||
|     "ionic:serve": "gulp watch | ionic-app-scripts serve", |     "ionic:serve": "gulp watch | ionic-app-scripts serve", | ||||||
|     "ionic:build:before": "gulp", |     "ionic:build:before": "gulp", | ||||||
|     "ionic:watch:before": "gulp" |     "ionic:watch:before": "gulp", | ||||||
|  |     "ionic:build:after": "gulp copy-component-templates", | ||||||
|  |     "postionic:build": "gulp copy-component-templates" | ||||||
|   }, |   }, | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "@angular/animations": "^5.2.5", |     "@angular/animations": "5.2.10", | ||||||
|     "@angular/common": "5.0.0", |     "@angular/common": "5.2.10", | ||||||
|     "@angular/compiler": "5.0.0", |     "@angular/compiler": "5.2.10", | ||||||
|     "@angular/compiler-cli": "5.0.0", |     "@angular/compiler-cli": "5.2.10", | ||||||
|     "@angular/core": "5.0.0", |     "@angular/core": "5.2.10", | ||||||
|     "@angular/forms": "5.0.0", |     "@angular/forms": "5.2.10", | ||||||
|     "@angular/http": "5.0.0", |     "@angular/http": "5.2.10", | ||||||
|     "@angular/platform-browser": "5.0.0", |     "@angular/platform-browser": "5.2.10", | ||||||
|     "@angular/platform-browser-dynamic": "5.0.0", |     "@angular/platform-browser-dynamic": "5.2.10", | ||||||
|     "@ionic-native/badge": "^4.5.3", |     "@ionic-native/badge": "^4.5.3", | ||||||
|     "@ionic-native/camera": "^4.5.2", |     "@ionic-native/camera": "^4.5.2", | ||||||
|     "@ionic-native/clipboard": "^4.3.2", |     "@ionic-native/clipboard": "^4.3.2", | ||||||
| @ -71,27 +73,26 @@ | |||||||
|     "@types/node": "^8.0.47", |     "@types/node": "^8.0.47", | ||||||
|     "@types/promise.prototype.finally": "^2.0.2", |     "@types/promise.prototype.finally": "^2.0.2", | ||||||
|     "chart.js": "^2.7.2", |     "chart.js": "^2.7.2", | ||||||
|     "electron-builder-squirrel-windows": "^19.3.0", |  | ||||||
|     "electron-windows-notifications": "^1.1.13", |  | ||||||
|     "font-awesome": "4.7.0", |     "font-awesome": "4.7.0", | ||||||
|     "ionic-angular": "^3.9.2", |     "ionic-angular": "^3.9.2", | ||||||
|     "ionicons": "3.0.0", |     "ionicons": "3.0.0", | ||||||
|     "jszip": "^3.1.4", |     "jszip": "^3.1.4", | ||||||
|     "moment": "^2.19.1", |     "moment": "^2.19.1", | ||||||
|     "promise.prototype.finally": "^3.0.1", |     "promise.prototype.finally": "^3.0.1", | ||||||
|     "rxjs": "5.5.2", |     "rxjs": "5.5.11", | ||||||
|     "sw-toolbox": "3.6.0", |     "sw-toolbox": "3.6.0", | ||||||
|     "ts-md5": "^1.2.2", |     "ts-md5": "^1.2.2", | ||||||
|     "zone.js": "0.8.18" |     "zone.js": "0.8.26" | ||||||
|   }, |   }, | ||||||
|   "devDependencies": { |   "devDependencies": { | ||||||
|     "@ionic/app-scripts": "3.1.9", |     "@ionic/app-scripts": "3.1.9", | ||||||
|     "gulp": "^3.9.1", |     "gulp": "^3.9.1", | ||||||
|     "gulp-clip-empty-files": "^0.1.2", |     "gulp-clip-empty-files": "^0.1.2", | ||||||
|  |     "gulp-flatten": "^0.4.0", | ||||||
|     "gulp-rename": "^1.2.2", |     "gulp-rename": "^1.2.2", | ||||||
|     "gulp-slash": "^1.1.3", |     "gulp-slash": "^1.1.3", | ||||||
|     "through": "^2.3.8", |     "through": "^2.3.8", | ||||||
|     "typescript": "2.4.2", |     "typescript": "~2.6.2", | ||||||
|     "webpack-merge": "^4.1.2" |     "webpack-merge": "^4.1.2" | ||||||
|   }, |   }, | ||||||
|   "browser": { |   "browser": { | ||||||
|  | |||||||
| @ -30,11 +30,12 @@ export const ADDON_BADGES_PROVIDERS: any[] = [ | |||||||
|     ], |     ], | ||||||
|     imports: [ |     imports: [ | ||||||
|     ], |     ], | ||||||
|     providers: ADDON_BADGES_PROVIDERS.concat([ |     providers: [ | ||||||
|  |         AddonBadgesProvider, | ||||||
|         AddonBadgesUserHandler, |         AddonBadgesUserHandler, | ||||||
|         AddonBadgesMyBadgesLinkHandler, |         AddonBadgesMyBadgesLinkHandler, | ||||||
|         AddonBadgesBadgeLinkHandler |         AddonBadgesBadgeLinkHandler | ||||||
|     ]) |     ] | ||||||
| }) | }) | ||||||
| export class AddonBadgesModule { | export class AddonBadgesModule { | ||||||
|     constructor(userDelegate: CoreUserDelegate, userHandler: AddonBadgesUserHandler, |     constructor(userDelegate: CoreUserDelegate, userHandler: AddonBadgesUserHandler, | ||||||
|  | |||||||
| @ -33,9 +33,11 @@ export const ADDON_CALENDAR_PROVIDERS: any[] = [ | |||||||
|     ], |     ], | ||||||
|     imports: [ |     imports: [ | ||||||
|     ], |     ], | ||||||
|     providers: ADDON_CALENDAR_PROVIDERS.concat([ |     providers: [ | ||||||
|  |         AddonCalendarProvider, | ||||||
|  |         AddonCalendarHelperProvider, | ||||||
|         AddonCalendarMainMenuHandler |         AddonCalendarMainMenuHandler | ||||||
|     ]) |     ] | ||||||
| }) | }) | ||||||
| export class AddonCalendarModule { | export class AddonCalendarModule { | ||||||
|     constructor(mainMenuDelegate: CoreMainMenuDelegate, calendarHandler: AddonCalendarMainMenuHandler, |     constructor(mainMenuDelegate: CoreMainMenuDelegate, calendarHandler: AddonCalendarMainMenuHandler, | ||||||
|  | |||||||
| @ -35,11 +35,13 @@ export const ADDON_COMPETENCY_PROVIDERS: any[] = [ | |||||||
|     imports: [ |     imports: [ | ||||||
|         AddonCompetencyComponentsModule |         AddonCompetencyComponentsModule | ||||||
|     ], |     ], | ||||||
|     providers: ADDON_COMPETENCY_PROVIDERS.concat([ |     providers: [ | ||||||
|  |         AddonCompetencyProvider, | ||||||
|  |         AddonCompetencyHelperProvider, | ||||||
|         AddonCompetencyCourseOptionHandler, |         AddonCompetencyCourseOptionHandler, | ||||||
|         AddonCompetencyMainMenuHandler, |         AddonCompetencyMainMenuHandler, | ||||||
|         AddonCompetencyUserHandler |         AddonCompetencyUserHandler | ||||||
|     ]) |     ] | ||||||
| }) | }) | ||||||
| export class AddonCompetencyModule { | export class AddonCompetencyModule { | ||||||
|     constructor(mainMenuDelegate: CoreMainMenuDelegate, mainMenuHandler: AddonCompetencyMainMenuHandler, |     constructor(mainMenuDelegate: CoreMainMenuDelegate, mainMenuHandler: AddonCompetencyMainMenuHandler, | ||||||
|  | |||||||
| @ -24,7 +24,7 @@ import { AddonCompetencyHelperProvider } from '../../providers/helper'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-competency-course', |     selector: 'addon-competency-course', | ||||||
|     templateUrl: 'course.html', |     templateUrl: 'addon-competency-course.html', | ||||||
| }) | }) | ||||||
| export class AddonCompetencyCourseComponent { | export class AddonCompetencyCourseComponent { | ||||||
|     @ViewChild(Content) content: Content; |     @ViewChild(Content) content: Content; | ||||||
|  | |||||||
| @ -29,9 +29,11 @@ export const ADDON_FILES_PROVIDERS: any[] = [ | |||||||
|     ], |     ], | ||||||
|     imports: [ |     imports: [ | ||||||
|     ], |     ], | ||||||
|     providers: ADDON_FILES_PROVIDERS.concat([ |     providers: [ | ||||||
|  |         AddonFilesProvider, | ||||||
|  |         AddonFilesHelperProvider, | ||||||
|         AddonFilesMainMenuHandler |         AddonFilesMainMenuHandler | ||||||
|     ]) |     ] | ||||||
| }) | }) | ||||||
| export class AddonFilesModule { | export class AddonFilesModule { | ||||||
|     constructor(mainMenuDelegate: CoreMainMenuDelegate, filesHandler: AddonFilesMainMenuHandler) { |     constructor(mainMenuDelegate: CoreMainMenuDelegate, filesHandler: AddonFilesMainMenuHandler) { | ||||||
|  | |||||||
| @ -25,6 +25,8 @@ export const ADDON_MESSAGEOUTPUT_PROVIDERS: any[] = [ | |||||||
|     ], |     ], | ||||||
|     imports: [ |     imports: [ | ||||||
|     ], |     ], | ||||||
|     providers: ADDON_MESSAGEOUTPUT_PROVIDERS |     providers: [ | ||||||
|  |         AddonMessageOutputDelegate | ||||||
|  |     ] | ||||||
| }) | }) | ||||||
| export class AddonMessageOutputModule {} | export class AddonMessageOutputModule {} | ||||||
|  | |||||||
| @ -26,7 +26,7 @@ import { CoreEventsProvider } from '@providers/events'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-messages-contacts', |     selector: 'addon-messages-contacts', | ||||||
|     templateUrl: 'contacts.html', |     templateUrl: 'addon-messages-contacts.html', | ||||||
| }) | }) | ||||||
| export class AddonMessagesContactsComponent { | export class AddonMessagesContactsComponent { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -28,7 +28,7 @@ import { AddonPushNotificationsDelegate } from '@addon/pushnotifications/provide | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-messages-discussions', |     selector: 'addon-messages-discussions', | ||||||
|     templateUrl: 'discussions.html', |     templateUrl: 'addon-messages-discussions.html', | ||||||
| }) | }) | ||||||
| export class AddonMessagesDiscussionsComponent implements OnDestroy { | export class AddonMessagesDiscussionsComponent implements OnDestroy { | ||||||
|     protected newMessagesObserver: any; |     protected newMessagesObserver: any; | ||||||
|  | |||||||
| @ -50,7 +50,10 @@ export const ADDON_MESSAGES_PROVIDERS: any[] = [ | |||||||
|     ], |     ], | ||||||
|     imports: [ |     imports: [ | ||||||
|     ], |     ], | ||||||
|     providers: ADDON_MESSAGES_PROVIDERS.concat([ |     providers: [ | ||||||
|  |         AddonMessagesProvider, | ||||||
|  |         AddonMessagesOfflineProvider, | ||||||
|  |         AddonMessagesSyncProvider, | ||||||
|         AddonMessagesMainMenuHandler, |         AddonMessagesMainMenuHandler, | ||||||
|         AddonMessagesSendMessageUserHandler, |         AddonMessagesSendMessageUserHandler, | ||||||
|         AddonMessagesAddContactUserHandler, |         AddonMessagesAddContactUserHandler, | ||||||
| @ -59,7 +62,7 @@ export const ADDON_MESSAGES_PROVIDERS: any[] = [ | |||||||
|         AddonMessagesIndexLinkHandler, |         AddonMessagesIndexLinkHandler, | ||||||
|         AddonMessagesSyncCronHandler, |         AddonMessagesSyncCronHandler, | ||||||
|         AddonMessagesSettingsHandler |         AddonMessagesSettingsHandler | ||||||
|     ]) |     ] | ||||||
| }) | }) | ||||||
| export class AddonMessagesModule { | export class AddonMessagesModule { | ||||||
|     constructor(mainMenuDelegate: CoreMainMenuDelegate, mainmenuHandler: AddonMessagesMainMenuHandler, |     constructor(mainMenuDelegate: CoreMainMenuDelegate, mainmenuHandler: AddonMessagesMainMenuHandler, | ||||||
|  | |||||||
| @ -48,13 +48,19 @@ export const ADDON_MOD_ASSIGN_PROVIDERS: any[] = [ | |||||||
|         AddonModAssignSubmissionModule, |         AddonModAssignSubmissionModule, | ||||||
|         AddonModAssignFeedbackModule |         AddonModAssignFeedbackModule | ||||||
|     ], |     ], | ||||||
|     providers: ADDON_MOD_ASSIGN_PROVIDERS.concat([ |     providers: [ | ||||||
|  |         AddonModAssignProvider, | ||||||
|  |         AddonModAssignOfflineProvider, | ||||||
|  |         AddonModAssignSyncProvider, | ||||||
|  |         AddonModAssignHelperProvider, | ||||||
|  |         AddonModAssignFeedbackDelegate, | ||||||
|  |         AddonModAssignSubmissionDelegate, | ||||||
|         AddonModAssignDefaultFeedbackHandler, |         AddonModAssignDefaultFeedbackHandler, | ||||||
|         AddonModAssignDefaultSubmissionHandler, |         AddonModAssignDefaultSubmissionHandler, | ||||||
|         AddonModAssignModuleHandler, |         AddonModAssignModuleHandler, | ||||||
|         AddonModAssignPrefetchHandler, |         AddonModAssignPrefetchHandler, | ||||||
|         AddonModAssignSyncCronHandler |         AddonModAssignSyncCronHandler | ||||||
|     ]) |     ] | ||||||
| }) | }) | ||||||
| export class AddonModAssignModule { | export class AddonModAssignModule { | ||||||
|     constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModAssignModuleHandler, |     constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModAssignModuleHandler, | ||||||
|  | |||||||
							
								
								
									
										178
									
								
								src/addon/mod/assign/classes/base-feedback-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										178
									
								
								src/addon/mod/assign/classes/base-feedback-handler.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,178 @@ | |||||||
|  | // (C) Copyright 2015 Martin Dougiamas
 | ||||||
|  | //
 | ||||||
|  | // Licensed under the Apache License, Version 2.0 (the "License");
 | ||||||
|  | // you may not use this file except in compliance with the License.
 | ||||||
|  | // You may obtain a copy of the License at
 | ||||||
|  | //
 | ||||||
|  | //     http://www.apache.org/licenses/LICENSE-2.0
 | ||||||
|  | //
 | ||||||
|  | // Unless required by applicable law or agreed to in writing, software
 | ||||||
|  | // distributed under the License is distributed on an "AS IS" BASIS,
 | ||||||
|  | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | ||||||
|  | // See the License for the specific language governing permissions and
 | ||||||
|  | // limitations under the License.
 | ||||||
|  | 
 | ||||||
|  | import { Injector } from '@angular/core'; | ||||||
|  | import { TranslateService } from '@ngx-translate/core'; | ||||||
|  | import { AddonModAssignFeedbackHandler } from '../providers/feedback-delegate'; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * Base handler for feedback plugins. | ||||||
|  |  * | ||||||
|  |  * This class is needed because parent classes cannot have @Injectable in Angular v6, so the default handler cannot be a | ||||||
|  |  * parent class. | ||||||
|  |  */ | ||||||
|  | export class AddonModAssignBaseFeedbackHandler implements AddonModAssignFeedbackHandler { | ||||||
|  |     name = 'AddonModAssignBaseFeedbackHandler'; | ||||||
|  |     type = 'base'; | ||||||
|  | 
 | ||||||
|  |     constructor(protected translate: TranslateService) { } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Discard the draft data of the feedback plugin. | ||||||
|  |      * | ||||||
|  |      * @param {number} assignId The assignment ID. | ||||||
|  |      * @param {number} userId User ID. | ||||||
|  |      * @param {string} [siteId] Site ID. If not defined, current site. | ||||||
|  |      * @return {void|Promise<any>} If the function is async, it should return a Promise resolved when done. | ||||||
|  |      */ | ||||||
|  |     discardDraft(assignId: number, userId: number, siteId?: string): void | Promise<any> { | ||||||
|  |         // Nothing to do.
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Return the Component to use to display the plugin data. | ||||||
|  |      * It's recommended to return the class of the component, but you can also return an instance of the component. | ||||||
|  |      * | ||||||
|  |      * @param {Injector} injector Injector. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @return {any|Promise<any>} The component (or promise resolved with component) to use, undefined if not found. | ||||||
|  |      */ | ||||||
|  |     getComponent(injector: Injector, plugin: any): any | Promise<any> { | ||||||
|  |         // Nothing to do.
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Return the draft saved data of the feedback plugin. | ||||||
|  |      * | ||||||
|  |      * @param {number} assignId The assignment ID. | ||||||
|  |      * @param {number} userId User ID. | ||||||
|  |      * @param {string} [siteId] Site ID. If not defined, current site. | ||||||
|  |      * @return {any|Promise<any>} Data (or promise resolved with the data). | ||||||
|  |      */ | ||||||
|  |     getDraft(assignId: number, userId: number, siteId?: string): any | Promise<any> { | ||||||
|  |         // Nothing to do.
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Get files used by this plugin. | ||||||
|  |      * The files returned by this function will be prefetched when the user prefetches the assign. | ||||||
|  |      * | ||||||
|  |      * @param {any} assign The assignment. | ||||||
|  |      * @param {any} submission The submission. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @param {string} [siteId] Site ID. If not defined, current site. | ||||||
|  |      * @return {any[]|Promise<any[]>} The files (or promise resolved with the files). | ||||||
|  |      */ | ||||||
|  |     getPluginFiles(assign: any, submission: any, plugin: any, siteId?: string): any[] | Promise<any[]> { | ||||||
|  |         return []; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Get a readable name to use for the plugin. | ||||||
|  |      * | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @return {string} The plugin name. | ||||||
|  |      */ | ||||||
|  |     getPluginName(plugin: any): string { | ||||||
|  |         // Check if there's a translated string for the plugin.
 | ||||||
|  |         const translationId = 'addon.mod_assign_feedback_' + plugin.type + '.pluginname', | ||||||
|  |             translation = this.translate.instant(translationId); | ||||||
|  | 
 | ||||||
|  |         if (translationId != translation) { | ||||||
|  |             // Translation found, use it.
 | ||||||
|  |             return translation; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         // Fallback to WS string.
 | ||||||
|  |         if (plugin.name) { | ||||||
|  |             return plugin.name; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Check if the feedback data has changed for this plugin. | ||||||
|  |      * | ||||||
|  |      * @param {any} assign The assignment. | ||||||
|  |      * @param {any} submission The submission. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @param {any} inputData Data entered by the user for the feedback. | ||||||
|  |      * @return {boolean|Promise<boolean>} Boolean (or promise resolved with boolean): whether the data has changed. | ||||||
|  |      */ | ||||||
|  |     hasDataChanged(assign: any, submission: any, plugin: any, inputData: any): boolean | Promise<boolean> { | ||||||
|  |         return false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Check whether the plugin has draft data stored. | ||||||
|  |      * | ||||||
|  |      * @param {number} assignId The assignment ID. | ||||||
|  |      * @param {number} userId User ID. | ||||||
|  |      * @param {string} [siteId] Site ID. If not defined, current site. | ||||||
|  |      * @return {boolean|Promise<boolean>} Boolean or promise resolved with boolean: whether the plugin has draft data. | ||||||
|  |      */ | ||||||
|  |     hasDraftData(assignId: number, userId: number, siteId?: string): boolean | Promise<boolean> { | ||||||
|  |         return false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Whether or not the handler is enabled on a site level. | ||||||
|  |      * | ||||||
|  |      * @return {boolean|Promise<boolean>} True or promise resolved with true if enabled. | ||||||
|  |      */ | ||||||
|  |     isEnabled(): boolean | Promise<boolean> { | ||||||
|  |         return true; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Prefetch any required data for the plugin. | ||||||
|  |      * This should NOT prefetch files. Files to be prefetched should be returned by the getPluginFiles function. | ||||||
|  |      * | ||||||
|  |      * @param {any} assign The assignment. | ||||||
|  |      * @param {any} submission The submission. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @param {string} [siteId] Site ID. If not defined, current site. | ||||||
|  |      * @return {Promise<any>} Promise resolved when done. | ||||||
|  |      */ | ||||||
|  |     prefetch(assign: any, submission: any, plugin: any, siteId?: string): Promise<any> { | ||||||
|  |         return Promise.resolve(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Prepare and add to pluginData the data to send to the server based on the draft data saved. | ||||||
|  |      * | ||||||
|  |      * @param {number} assignId The assignment ID. | ||||||
|  |      * @param {number} userId User ID. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @param {any} pluginData Object where to store the data to send. | ||||||
|  |      * @param {string} [siteId] Site ID. If not defined, current site. | ||||||
|  |      * @return {void|Promise<any>} If the function is async, it should return a Promise resolved when done. | ||||||
|  |      */ | ||||||
|  |     prepareFeedbackData(assignId: number, userId: number, plugin: any, pluginData: any, siteId?: string): void | Promise<any> { | ||||||
|  |         // Nothing to do.
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Save draft data of the feedback plugin. | ||||||
|  |      * | ||||||
|  |      * @param {number} assignId The assignment ID. | ||||||
|  |      * @param {number} userId User ID. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @param {any} data The data to save. | ||||||
|  |      * @param {string} [siteId] Site ID. If not defined, current site. | ||||||
|  |      * @return {void|Promise<any>} If the function is async, it should return a Promise resolved when done. | ||||||
|  |      */ | ||||||
|  |     saveDraft(assignId: number, userId: number, plugin: any, data: any, siteId?: string): void | Promise<any> { | ||||||
|  |         // Nothing to do.
 | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										235
									
								
								src/addon/mod/assign/classes/base-submission-handler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										235
									
								
								src/addon/mod/assign/classes/base-submission-handler.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,235 @@ | |||||||
|  | // (C) Copyright 2015 Martin Dougiamas
 | ||||||
|  | //
 | ||||||
|  | // Licensed under the Apache License, Version 2.0 (the "License");
 | ||||||
|  | // you may not use this file except in compliance with the License.
 | ||||||
|  | // You may obtain a copy of the License at
 | ||||||
|  | //
 | ||||||
|  | //     http://www.apache.org/licenses/LICENSE-2.0
 | ||||||
|  | //
 | ||||||
|  | // Unless required by applicable law or agreed to in writing, software
 | ||||||
|  | // distributed under the License is distributed on an "AS IS" BASIS,
 | ||||||
|  | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | ||||||
|  | // See the License for the specific language governing permissions and
 | ||||||
|  | // limitations under the License.
 | ||||||
|  | 
 | ||||||
|  | import { Injector } from '@angular/core'; | ||||||
|  | import { TranslateService } from '@ngx-translate/core'; | ||||||
|  | import { AddonModAssignSubmissionHandler } from '../providers/submission-delegate'; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * Base handler for submission plugins. | ||||||
|  |  * | ||||||
|  |  * This class is needed because parent classes cannot have @Injectable in Angular v6, so the default handler cannot be a | ||||||
|  |  * parent class. | ||||||
|  |  */ | ||||||
|  | export class AddonModAssignBaseSubmissionHandler implements AddonModAssignSubmissionHandler { | ||||||
|  |     name = 'AddonModAssignBaseSubmissionHandler'; | ||||||
|  |     type = 'base'; | ||||||
|  | 
 | ||||||
|  |     constructor(protected translate: TranslateService) { } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Whether the plugin can be edited in offline for existing submissions. In general, this should return false if the | ||||||
|  |      * plugin uses Moodle filters. The reason is that the app only prefetches filtered data, and the user should edit | ||||||
|  |      * unfiltered data. | ||||||
|  |      * | ||||||
|  |      * @param {any} assign The assignment. | ||||||
|  |      * @param {any} submission The submission. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @return {boolean|Promise<boolean>} Boolean or promise resolved with boolean: whether it can be edited in offline. | ||||||
|  |      */ | ||||||
|  |     canEditOffline(assign: any, submission: any, plugin: any): boolean | Promise<boolean> { | ||||||
|  |         return false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Should clear temporary data for a cancelled submission. | ||||||
|  |      * | ||||||
|  |      * @param {any} assign The assignment. | ||||||
|  |      * @param {any} submission The submission. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @param {any} inputData Data entered by the user for the submission. | ||||||
|  |      */ | ||||||
|  |     clearTmpData(assign: any, submission: any, plugin: any, inputData: any): void { | ||||||
|  |         // Nothing to do.
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * This function will be called when the user wants to create a new submission based on the previous one. | ||||||
|  |      * It should add to pluginData the data to send to server based in the data in plugin (previous attempt). | ||||||
|  |      * | ||||||
|  |      * @param {any} assign The assignment. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @param {any} pluginData Object where to store the data to send. | ||||||
|  |      * @param {number} [userId] User ID. If not defined, site's current user. | ||||||
|  |      * @param {string} [siteId] Site ID. If not defined, current site. | ||||||
|  |      * @return {void|Promise<any>} If the function is async, it should return a Promise resolved when done. | ||||||
|  |      */ | ||||||
|  |     copySubmissionData(assign: any, plugin: any, pluginData: any, userId?: number, siteId?: string): void | Promise<any> { | ||||||
|  |         // Nothing to do.
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Delete any stored data for the plugin and submission. | ||||||
|  |      * | ||||||
|  |      * @param {any} assign The assignment. | ||||||
|  |      * @param {any} submission The submission. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @param {any} offlineData Offline data stored. | ||||||
|  |      * @param {string} [siteId] Site ID. If not defined, current site. | ||||||
|  |      * @return {void|Promise<any>} If the function is async, it should return a Promise resolved when done. | ||||||
|  |      */ | ||||||
|  |     deleteOfflineData(assign: any, submission: any, plugin: any, offlineData: any, siteId?: string): void | Promise<any> { | ||||||
|  |         // Nothing to do.
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Return the Component to use to display the plugin data, either in read or in edit mode. | ||||||
|  |      * It's recommended to return the class of the component, but you can also return an instance of the component. | ||||||
|  |      * | ||||||
|  |      * @param {Injector} injector Injector. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @param {boolean} [edit] Whether the user is editing. | ||||||
|  |      * @return {any|Promise<any>} The component (or promise resolved with component) to use, undefined if not found. | ||||||
|  |      */ | ||||||
|  |     getComponent(injector: Injector, plugin: any, edit?: boolean): any | Promise<any> { | ||||||
|  |         // Nothing to do.
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Get files used by this plugin. | ||||||
|  |      * The files returned by this function will be prefetched when the user prefetches the assign. | ||||||
|  |      * | ||||||
|  |      * @param {any} assign The assignment. | ||||||
|  |      * @param {any} submission The submission. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @param {string} [siteId] Site ID. If not defined, current site. | ||||||
|  |      * @return {any[]|Promise<any[]>} The files (or promise resolved with the files). | ||||||
|  |      */ | ||||||
|  |     getPluginFiles(assign: any, submission: any, plugin: any, siteId?: string): any[] | Promise<any[]> { | ||||||
|  |         return []; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Get a readable name to use for the plugin. | ||||||
|  |      * | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @return {string} The plugin name. | ||||||
|  |      */ | ||||||
|  |     getPluginName(plugin: any): string { | ||||||
|  |         // Check if there's a translated string for the plugin.
 | ||||||
|  |         const translationId = 'addon.mod_assign_submission_' + plugin.type + '.pluginname', | ||||||
|  |             translation = this.translate.instant(translationId); | ||||||
|  | 
 | ||||||
|  |         if (translationId != translation) { | ||||||
|  |             // Translation found, use it.
 | ||||||
|  |             return translation; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         // Fallback to WS string.
 | ||||||
|  |         if (plugin.name) { | ||||||
|  |             return plugin.name; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Get the size of data (in bytes) this plugin will send to copy a previous submission. | ||||||
|  |      * | ||||||
|  |      * @param {any} assign The assignment. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @return {number|Promise<number>} The size (or promise resolved with size). | ||||||
|  |      */ | ||||||
|  |     getSizeForCopy(assign: any, plugin: any): number | Promise<number> { | ||||||
|  |         return 0; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Get the size of data (in bytes) this plugin will send to add or edit a submission. | ||||||
|  |      * | ||||||
|  |      * @param {any} assign The assignment. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @return {number|Promise<number>} The size (or promise resolved with size). | ||||||
|  |      */ | ||||||
|  |     getSizeForEdit(assign: any, plugin: any): number | Promise<number> { | ||||||
|  |         return 0; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Check if the submission data has changed for this plugin. | ||||||
|  |      * | ||||||
|  |      * @param {any} assign The assignment. | ||||||
|  |      * @param {any} submission The submission. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @param {any} inputData Data entered by the user for the submission. | ||||||
|  |      * @return {boolean|Promise<boolean>} Boolean (or promise resolved with boolean): whether the data has changed. | ||||||
|  |      */ | ||||||
|  |     hasDataChanged(assign: any, submission: any, plugin: any, inputData: any): boolean | Promise<boolean> { | ||||||
|  |         return false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Whether or not the handler is enabled on a site level. | ||||||
|  |      * | ||||||
|  |      * @return {boolean|Promise<boolean>} True or promise resolved with true if enabled. | ||||||
|  |      */ | ||||||
|  |     isEnabled(): boolean | Promise<boolean> { | ||||||
|  |         return true; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Whether or not the handler is enabled for edit on a site level. | ||||||
|  |      * @return {boolean|Promise<boolean>} Whether or not the handler is enabled for edit on a site level. | ||||||
|  |      */ | ||||||
|  |     isEnabledForEdit(): boolean | Promise<boolean> { | ||||||
|  |         return false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Prefetch any required data for the plugin. | ||||||
|  |      * This should NOT prefetch files. Files to be prefetched should be returned by the getPluginFiles function. | ||||||
|  |      * | ||||||
|  |      * @param {any} assign The assignment. | ||||||
|  |      * @param {any} submission The submission. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @param {string} [siteId] Site ID. If not defined, current site. | ||||||
|  |      * @return {Promise<any>} Promise resolved when done. | ||||||
|  |      */ | ||||||
|  |     prefetch(assign: any, submission: any, plugin: any, siteId?: string): Promise<any> { | ||||||
|  |         return Promise.resolve(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Prepare and add to pluginData the data to send to the server based on the input data. | ||||||
|  |      * | ||||||
|  |      * @param {any} assign The assignment. | ||||||
|  |      * @param {any} submission The submission. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @param {any} inputData Data entered by the user for the submission. | ||||||
|  |      * @param {any} pluginData Object where to store the data to send. | ||||||
|  |      * @param {boolean} [offline] Whether the user is editing in offline. | ||||||
|  |      * @param {number} [userId] User ID. If not defined, site's current user. | ||||||
|  |      * @param {string} [siteId] Site ID. If not defined, current site. | ||||||
|  |      * @return {void|Promise<any>} If the function is async, it should return a Promise resolved when done. | ||||||
|  |      */ | ||||||
|  |     prepareSubmissionData?(assign: any, submission: any, plugin: any, inputData: any, pluginData: any, offline?: boolean, | ||||||
|  |             userId?: number, siteId?: string): void | Promise<any> { | ||||||
|  |         // Nothing to do.
 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Prepare and add to pluginData the data to send to the server based on the offline data stored. | ||||||
|  |      * This will be used when performing a synchronization. | ||||||
|  |      * | ||||||
|  |      * @param {any} assign The assignment. | ||||||
|  |      * @param {any} submission The submission. | ||||||
|  |      * @param {any} plugin The plugin object. | ||||||
|  |      * @param {any} offlineData Offline data stored. | ||||||
|  |      * @param {any} pluginData Object where to store the data to send. | ||||||
|  |      * @param {string} [siteId] Site ID. If not defined, current site. | ||||||
|  |      * @return {void|Promise<any>} If the function is async, it should return a Promise resolved when done. | ||||||
|  |      */ | ||||||
|  |     prepareSyncData?(assign: any, submission: any, plugin: any, offlineData: any, pluginData: any, siteId?: string) | ||||||
|  |             : void | Promise<any> { | ||||||
|  |         // Nothing to do.
 | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -23,7 +23,7 @@ import { CoreDynamicComponent } from '@components/dynamic-component/dynamic-comp | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-assign-feedback-plugin', |     selector: 'addon-mod-assign-feedback-plugin', | ||||||
|     templateUrl: 'feedback-plugin.html', |     templateUrl: 'addon-mod-assign-feedback-plugin.html', | ||||||
| }) | }) | ||||||
| export class AddonModAssignFeedbackPluginComponent implements OnInit { | export class AddonModAssignFeedbackPluginComponent implements OnInit { | ||||||
|     @ViewChild(CoreDynamicComponent) dynamicComponent: CoreDynamicComponent; |     @ViewChild(CoreDynamicComponent) dynamicComponent: CoreDynamicComponent; | ||||||
|  | |||||||
| @ -29,7 +29,7 @@ import { AddonModAssignSubmissionComponent } from '../submission/submission'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-assign-index', |     selector: 'addon-mod-assign-index', | ||||||
|     templateUrl: 'index.html', |     templateUrl: 'addon-mod-assign-index.html', | ||||||
| }) | }) | ||||||
| export class AddonModAssignIndexComponent extends CoreCourseModuleMainActivityComponent { | export class AddonModAssignIndexComponent extends CoreCourseModuleMainActivityComponent { | ||||||
|     @ViewChild(AddonModAssignSubmissionComponent) submissionComponent: AddonModAssignSubmissionComponent; |     @ViewChild(AddonModAssignSubmissionComponent) submissionComponent: AddonModAssignSubmissionComponent; | ||||||
|  | |||||||
| @ -23,7 +23,7 @@ import { CoreDynamicComponent } from '@components/dynamic-component/dynamic-comp | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-assign-submission-plugin', |     selector: 'addon-mod-assign-submission-plugin', | ||||||
|     templateUrl: 'submission-plugin.html', |     templateUrl: 'addon-mod-assign-submission-plugin.html', | ||||||
| }) | }) | ||||||
| export class AddonModAssignSubmissionPluginComponent implements OnInit { | export class AddonModAssignSubmissionPluginComponent implements OnInit { | ||||||
|     @ViewChild(CoreDynamicComponent) dynamicComponent: CoreDynamicComponent; |     @ViewChild(CoreDynamicComponent) dynamicComponent: CoreDynamicComponent; | ||||||
|  | |||||||
| @ -42,7 +42,7 @@ import { AddonModAssignSubmissionPluginComponent } from '../submission-plugin/su | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-assign-submission', |     selector: 'addon-mod-assign-submission', | ||||||
|     templateUrl: 'submission.html', |     templateUrl: 'addon-mod-assign-submission.html', | ||||||
| }) | }) | ||||||
| export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy { | export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy { | ||||||
|     @ViewChild(CoreTabsComponent) tabs: CoreTabsComponent; |     @ViewChild(CoreTabsComponent) tabs: CoreTabsComponent; | ||||||
|  | |||||||
| @ -28,7 +28,7 @@ import { AddonModAssignFeedbackCommentsHandler } from '../providers/handler'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-assign-feedback-comments', |     selector: 'addon-mod-assign-feedback-comments', | ||||||
|     templateUrl: 'comments.html' |     templateUrl: 'addon-mod-assign-feedback-comments.html' | ||||||
| }) | }) | ||||||
| export class AddonModAssignFeedbackCommentsComponent extends AddonModAssignFeedbackPluginComponentBase implements OnInit { | export class AddonModAssignFeedbackCommentsComponent extends AddonModAssignFeedbackPluginComponentBase implements OnInit { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -22,7 +22,7 @@ import { AddonModAssignFeedbackPluginComponentBase } from '../../../classes/feed | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-assign-feedback-edit-pdf', |     selector: 'addon-mod-assign-feedback-edit-pdf', | ||||||
|     templateUrl: 'editpdf.html' |     templateUrl: 'addon-mod-assign-feedback-editpdf.html' | ||||||
| }) | }) | ||||||
| export class AddonModAssignFeedbackEditPdfComponent extends AddonModAssignFeedbackPluginComponentBase implements OnInit { | export class AddonModAssignFeedbackEditPdfComponent extends AddonModAssignFeedbackPluginComponentBase implements OnInit { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -22,7 +22,7 @@ import { AddonModAssignFeedbackPluginComponentBase } from '../../../classes/feed | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-assign-feedback-file', |     selector: 'addon-mod-assign-feedback-file', | ||||||
|     templateUrl: 'file.html' |     templateUrl: 'addon-mod-assign-feedback-file.html' | ||||||
| }) | }) | ||||||
| export class AddonModAssignFeedbackFileComponent extends AddonModAssignFeedbackPluginComponentBase implements OnInit { | export class AddonModAssignFeedbackFileComponent extends AddonModAssignFeedbackPluginComponentBase implements OnInit { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -12,165 +12,19 @@ | |||||||
| // See the License for the specific language governing permissions and
 | // See the License for the specific language governing permissions and
 | ||||||
| // limitations under the License.
 | // limitations under the License.
 | ||||||
| 
 | 
 | ||||||
| import { Injectable, Injector } from '@angular/core'; | import { Injectable } from '@angular/core'; | ||||||
| import { TranslateService } from '@ngx-translate/core'; | import { TranslateService } from '@ngx-translate/core'; | ||||||
| import { AddonModAssignFeedbackHandler } from './feedback-delegate'; | import { AddonModAssignBaseFeedbackHandler } from '../classes/base-feedback-handler'; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Default handler used when a feedback plugin doesn't have a specific implementation. |  * Default handler used when a feedback plugin doesn't have a specific implementation. | ||||||
|  */ |  */ | ||||||
| @Injectable() | @Injectable() | ||||||
| export class AddonModAssignDefaultFeedbackHandler implements AddonModAssignFeedbackHandler { | export class AddonModAssignDefaultFeedbackHandler extends AddonModAssignBaseFeedbackHandler { | ||||||
|     name = 'AddonModAssignDefaultFeedbackHandler'; |     name = 'AddonModAssignDefaultFeedbackHandler'; | ||||||
|     type = 'default'; |     type = 'default'; | ||||||
| 
 | 
 | ||||||
|     constructor(protected translate: TranslateService) { } |     constructor(protected translate: TranslateService) { | ||||||
| 
 |         super(translate); | ||||||
|     /** |  | ||||||
|      * Discard the draft data of the feedback plugin. |  | ||||||
|      * |  | ||||||
|      * @param {number} assignId The assignment ID. |  | ||||||
|      * @param {number} userId User ID. |  | ||||||
|      * @param {string} [siteId] Site ID. If not defined, current site. |  | ||||||
|      * @return {void|Promise<any>} If the function is async, it should return a Promise resolved when done. |  | ||||||
|      */ |  | ||||||
|     discardDraft(assignId: number, userId: number, siteId?: string): void | Promise<any> { |  | ||||||
|         // Nothing to do.
 |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Return the Component to use to display the plugin data. |  | ||||||
|      * It's recommended to return the class of the component, but you can also return an instance of the component. |  | ||||||
|      * |  | ||||||
|      * @param {Injector} injector Injector. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @return {any|Promise<any>} The component (or promise resolved with component) to use, undefined if not found. |  | ||||||
|      */ |  | ||||||
|     getComponent(injector: Injector, plugin: any): any | Promise<any> { |  | ||||||
|         // Nothing to do.
 |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Return the draft saved data of the feedback plugin. |  | ||||||
|      * |  | ||||||
|      * @param {number} assignId The assignment ID. |  | ||||||
|      * @param {number} userId User ID. |  | ||||||
|      * @param {string} [siteId] Site ID. If not defined, current site. |  | ||||||
|      * @return {any|Promise<any>} Data (or promise resolved with the data). |  | ||||||
|      */ |  | ||||||
|     getDraft(assignId: number, userId: number, siteId?: string): any | Promise<any> { |  | ||||||
|         // Nothing to do.
 |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Get files used by this plugin. |  | ||||||
|      * The files returned by this function will be prefetched when the user prefetches the assign. |  | ||||||
|      * |  | ||||||
|      * @param {any} assign The assignment. |  | ||||||
|      * @param {any} submission The submission. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @param {string} [siteId] Site ID. If not defined, current site. |  | ||||||
|      * @return {any[]|Promise<any[]>} The files (or promise resolved with the files). |  | ||||||
|      */ |  | ||||||
|     getPluginFiles(assign: any, submission: any, plugin: any, siteId?: string): any[] | Promise<any[]> { |  | ||||||
|         return []; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Get a readable name to use for the plugin. |  | ||||||
|      * |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @return {string} The plugin name. |  | ||||||
|      */ |  | ||||||
|     getPluginName(plugin: any): string { |  | ||||||
|         // Check if there's a translated string for the plugin.
 |  | ||||||
|         const translationId = 'addon.mod_assign_feedback_' + plugin.type + '.pluginname', |  | ||||||
|             translation = this.translate.instant(translationId); |  | ||||||
| 
 |  | ||||||
|         if (translationId != translation) { |  | ||||||
|             // Translation found, use it.
 |  | ||||||
|             return translation; |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         // Fallback to WS string.
 |  | ||||||
|         if (plugin.name) { |  | ||||||
|             return plugin.name; |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Check if the feedback data has changed for this plugin. |  | ||||||
|      * |  | ||||||
|      * @param {any} assign The assignment. |  | ||||||
|      * @param {any} submission The submission. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @param {any} inputData Data entered by the user for the feedback. |  | ||||||
|      * @return {boolean|Promise<boolean>} Boolean (or promise resolved with boolean): whether the data has changed. |  | ||||||
|      */ |  | ||||||
|     hasDataChanged(assign: any, submission: any, plugin: any, inputData: any): boolean | Promise<boolean> { |  | ||||||
|         return false; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Check whether the plugin has draft data stored. |  | ||||||
|      * |  | ||||||
|      * @param {number} assignId The assignment ID. |  | ||||||
|      * @param {number} userId User ID. |  | ||||||
|      * @param {string} [siteId] Site ID. If not defined, current site. |  | ||||||
|      * @return {boolean|Promise<boolean>} Boolean or promise resolved with boolean: whether the plugin has draft data. |  | ||||||
|      */ |  | ||||||
|     hasDraftData(assignId: number, userId: number, siteId?: string): boolean | Promise<boolean> { |  | ||||||
|         return false; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Whether or not the handler is enabled on a site level. |  | ||||||
|      * |  | ||||||
|      * @return {boolean|Promise<boolean>} True or promise resolved with true if enabled. |  | ||||||
|      */ |  | ||||||
|     isEnabled(): boolean | Promise<boolean> { |  | ||||||
|         return true; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Prefetch any required data for the plugin. |  | ||||||
|      * This should NOT prefetch files. Files to be prefetched should be returned by the getPluginFiles function. |  | ||||||
|      * |  | ||||||
|      * @param {any} assign The assignment. |  | ||||||
|      * @param {any} submission The submission. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @param {string} [siteId] Site ID. If not defined, current site. |  | ||||||
|      * @return {Promise<any>} Promise resolved when done. |  | ||||||
|      */ |  | ||||||
|     prefetch(assign: any, submission: any, plugin: any, siteId?: string): Promise<any> { |  | ||||||
|         return Promise.resolve(); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Prepare and add to pluginData the data to send to the server based on the draft data saved. |  | ||||||
|      * |  | ||||||
|      * @param {number} assignId The assignment ID. |  | ||||||
|      * @param {number} userId User ID. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @param {any} pluginData Object where to store the data to send. |  | ||||||
|      * @param {string} [siteId] Site ID. If not defined, current site. |  | ||||||
|      * @return {void|Promise<any>} If the function is async, it should return a Promise resolved when done. |  | ||||||
|      */ |  | ||||||
|     prepareFeedbackData(assignId: number, userId: number, plugin: any, pluginData: any, siteId?: string): void | Promise<any> { |  | ||||||
|         // Nothing to do.
 |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Save draft data of the feedback plugin. |  | ||||||
|      * |  | ||||||
|      * @param {number} assignId The assignment ID. |  | ||||||
|      * @param {number} userId User ID. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @param {any} data The data to save. |  | ||||||
|      * @param {string} [siteId] Site ID. If not defined, current site. |  | ||||||
|      * @return {void|Promise<any>} If the function is async, it should return a Promise resolved when done. |  | ||||||
|      */ |  | ||||||
|     saveDraft(assignId: number, userId: number, plugin: any, data: any, siteId?: string): void | Promise<any> { |  | ||||||
|         // Nothing to do.
 |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -12,222 +12,19 @@ | |||||||
| // See the License for the specific language governing permissions and
 | // See the License for the specific language governing permissions and
 | ||||||
| // limitations under the License.
 | // limitations under the License.
 | ||||||
| 
 | 
 | ||||||
| import { Injectable, Injector } from '@angular/core'; | import { Injectable } from '@angular/core'; | ||||||
| import { TranslateService } from '@ngx-translate/core'; | import { TranslateService } from '@ngx-translate/core'; | ||||||
| import { AddonModAssignSubmissionHandler } from './submission-delegate'; | import { AddonModAssignBaseSubmissionHandler } from '../classes/base-submission-handler'; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Default handler used when a submission plugin doesn't have a specific implementation. |  * Default handler used when a submission plugin doesn't have a specific implementation. | ||||||
|  */ |  */ | ||||||
| @Injectable() | @Injectable() | ||||||
| export class AddonModAssignDefaultSubmissionHandler implements AddonModAssignSubmissionHandler { | export class AddonModAssignDefaultSubmissionHandler extends AddonModAssignBaseSubmissionHandler { | ||||||
|     name = 'AddonModAssignDefaultSubmissionHandler'; |     name = 'AddonModAssignDefaultSubmissionHandler'; | ||||||
|     type = 'default'; |     type = 'default'; | ||||||
| 
 | 
 | ||||||
|     constructor(protected translate: TranslateService) { } |     constructor(protected translate: TranslateService) { | ||||||
| 
 |         super(translate); | ||||||
|     /** |     } // Nothing to do.
 | ||||||
|      * Whether the plugin can be edited in offline for existing submissions. In general, this should return false if the |  | ||||||
|      * plugin uses Moodle filters. The reason is that the app only prefetches filtered data, and the user should edit |  | ||||||
|      * unfiltered data. |  | ||||||
|      * |  | ||||||
|      * @param {any} assign The assignment. |  | ||||||
|      * @param {any} submission The submission. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @return {boolean|Promise<boolean>} Boolean or promise resolved with boolean: whether it can be edited in offline. |  | ||||||
|      */ |  | ||||||
|     canEditOffline(assign: any, submission: any, plugin: any): boolean | Promise<boolean> { |  | ||||||
|         return false; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Should clear temporary data for a cancelled submission. |  | ||||||
|      * |  | ||||||
|      * @param {any} assign The assignment. |  | ||||||
|      * @param {any} submission The submission. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @param {any} inputData Data entered by the user for the submission. |  | ||||||
|      */ |  | ||||||
|     clearTmpData(assign: any, submission: any, plugin: any, inputData: any): void { |  | ||||||
|         // Nothing to do.
 |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * This function will be called when the user wants to create a new submission based on the previous one. |  | ||||||
|      * It should add to pluginData the data to send to server based in the data in plugin (previous attempt). |  | ||||||
|      * |  | ||||||
|      * @param {any} assign The assignment. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @param {any} pluginData Object where to store the data to send. |  | ||||||
|      * @param {number} [userId] User ID. If not defined, site's current user. |  | ||||||
|      * @param {string} [siteId] Site ID. If not defined, current site. |  | ||||||
|      * @return {void|Promise<any>} If the function is async, it should return a Promise resolved when done. |  | ||||||
|      */ |  | ||||||
|     copySubmissionData(assign: any, plugin: any, pluginData: any, userId?: number, siteId?: string): void | Promise<any> { |  | ||||||
|         // Nothing to do.
 |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Delete any stored data for the plugin and submission. |  | ||||||
|      * |  | ||||||
|      * @param {any} assign The assignment. |  | ||||||
|      * @param {any} submission The submission. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @param {any} offlineData Offline data stored. |  | ||||||
|      * @param {string} [siteId] Site ID. If not defined, current site. |  | ||||||
|      * @return {void|Promise<any>} If the function is async, it should return a Promise resolved when done. |  | ||||||
|      */ |  | ||||||
|     deleteOfflineData(assign: any, submission: any, plugin: any, offlineData: any, siteId?: string): void | Promise<any> { |  | ||||||
|         // Nothing to do.
 |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Return the Component to use to display the plugin data, either in read or in edit mode. |  | ||||||
|      * It's recommended to return the class of the component, but you can also return an instance of the component. |  | ||||||
|      * |  | ||||||
|      * @param {Injector} injector Injector. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @param {boolean} [edit] Whether the user is editing. |  | ||||||
|      * @return {any|Promise<any>} The component (or promise resolved with component) to use, undefined if not found. |  | ||||||
|      */ |  | ||||||
|     getComponent(injector: Injector, plugin: any, edit?: boolean): any | Promise<any> { |  | ||||||
|         // Nothing to do.
 |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Get files used by this plugin. |  | ||||||
|      * The files returned by this function will be prefetched when the user prefetches the assign. |  | ||||||
|      * |  | ||||||
|      * @param {any} assign The assignment. |  | ||||||
|      * @param {any} submission The submission. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @param {string} [siteId] Site ID. If not defined, current site. |  | ||||||
|      * @return {any[]|Promise<any[]>} The files (or promise resolved with the files). |  | ||||||
|      */ |  | ||||||
|     getPluginFiles(assign: any, submission: any, plugin: any, siteId?: string): any[] | Promise<any[]> { |  | ||||||
|         return []; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Get a readable name to use for the plugin. |  | ||||||
|      * |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @return {string} The plugin name. |  | ||||||
|      */ |  | ||||||
|     getPluginName(plugin: any): string { |  | ||||||
|         // Check if there's a translated string for the plugin.
 |  | ||||||
|         const translationId = 'addon.mod_assign_submission_' + plugin.type + '.pluginname', |  | ||||||
|             translation = this.translate.instant(translationId); |  | ||||||
| 
 |  | ||||||
|         if (translationId != translation) { |  | ||||||
|             // Translation found, use it.
 |  | ||||||
|             return translation; |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         // Fallback to WS string.
 |  | ||||||
|         if (plugin.name) { |  | ||||||
|             return plugin.name; |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Get the size of data (in bytes) this plugin will send to copy a previous submission. |  | ||||||
|      * |  | ||||||
|      * @param {any} assign The assignment. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @return {number|Promise<number>} The size (or promise resolved with size). |  | ||||||
|      */ |  | ||||||
|     getSizeForCopy(assign: any, plugin: any): number | Promise<number> { |  | ||||||
|         return 0; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Get the size of data (in bytes) this plugin will send to add or edit a submission. |  | ||||||
|      * |  | ||||||
|      * @param {any} assign The assignment. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @return {number|Promise<number>} The size (or promise resolved with size). |  | ||||||
|      */ |  | ||||||
|     getSizeForEdit(assign: any, plugin: any): number | Promise<number> { |  | ||||||
|         return 0; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Check if the submission data has changed for this plugin. |  | ||||||
|      * |  | ||||||
|      * @param {any} assign The assignment. |  | ||||||
|      * @param {any} submission The submission. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @param {any} inputData Data entered by the user for the submission. |  | ||||||
|      * @return {boolean|Promise<boolean>} Boolean (or promise resolved with boolean): whether the data has changed. |  | ||||||
|      */ |  | ||||||
|     hasDataChanged(assign: any, submission: any, plugin: any, inputData: any): boolean | Promise<boolean> { |  | ||||||
|         return false; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Whether or not the handler is enabled on a site level. |  | ||||||
|      * |  | ||||||
|      * @return {boolean|Promise<boolean>} True or promise resolved with true if enabled. |  | ||||||
|      */ |  | ||||||
|     isEnabled(): boolean | Promise<boolean> { |  | ||||||
|         return true; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Whether or not the handler is enabled for edit on a site level. |  | ||||||
|      * @return {boolean|Promise<boolean>} Whether or not the handler is enabled for edit on a site level. |  | ||||||
|      */ |  | ||||||
|     isEnabledForEdit(): boolean | Promise<boolean> { |  | ||||||
|         return false; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Prefetch any required data for the plugin. |  | ||||||
|      * This should NOT prefetch files. Files to be prefetched should be returned by the getPluginFiles function. |  | ||||||
|      * |  | ||||||
|      * @param {any} assign The assignment. |  | ||||||
|      * @param {any} submission The submission. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @param {string} [siteId] Site ID. If not defined, current site. |  | ||||||
|      * @return {Promise<any>} Promise resolved when done. |  | ||||||
|      */ |  | ||||||
|     prefetch(assign: any, submission: any, plugin: any, siteId?: string): Promise<any> { |  | ||||||
|         return Promise.resolve(); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Prepare and add to pluginData the data to send to the server based on the input data. |  | ||||||
|      * |  | ||||||
|      * @param {any} assign The assignment. |  | ||||||
|      * @param {any} submission The submission. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @param {any} inputData Data entered by the user for the submission. |  | ||||||
|      * @param {any} pluginData Object where to store the data to send. |  | ||||||
|      * @param {boolean} [offline] Whether the user is editing in offline. |  | ||||||
|      * @param {number} [userId] User ID. If not defined, site's current user. |  | ||||||
|      * @param {string} [siteId] Site ID. If not defined, current site. |  | ||||||
|      * @return {void|Promise<any>} If the function is async, it should return a Promise resolved when done. |  | ||||||
|      */ |  | ||||||
|     prepareSubmissionData?(assign: any, submission: any, plugin: any, inputData: any, pluginData: any, offline?: boolean, |  | ||||||
|             userId?: number, siteId?: string): void | Promise<any> { |  | ||||||
|         // Nothing to do.
 |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|      * Prepare and add to pluginData the data to send to the server based on the offline data stored. |  | ||||||
|      * This will be used when performing a synchronization. |  | ||||||
|      * |  | ||||||
|      * @param {any} assign The assignment. |  | ||||||
|      * @param {any} submission The submission. |  | ||||||
|      * @param {any} plugin The plugin object. |  | ||||||
|      * @param {any} offlineData Offline data stored. |  | ||||||
|      * @param {any} pluginData Object where to store the data to send. |  | ||||||
|      * @param {string} [siteId] Site ID. If not defined, current site. |  | ||||||
|      * @return {void|Promise<any>} If the function is async, it should return a Promise resolved when done. |  | ||||||
|      */ |  | ||||||
|     prepareSyncData?(assign: any, submission: any, plugin: any, offlineData: any, pluginData: any, siteId?: string) |  | ||||||
|             : void | Promise<any> { |  | ||||||
|         // Nothing to do.
 |  | ||||||
|     } |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -22,7 +22,7 @@ import { AddonModAssignSubmissionPluginComponent } from '../../../classes/submis | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-assign-submission-comments', |     selector: 'addon-mod-assign-submission-comments', | ||||||
|     templateUrl: 'comments.html' |     templateUrl: 'addon-mod-assign-submission-comments.html' | ||||||
| }) | }) | ||||||
| export class AddonModAssignSubmissionCommentsComponent extends AddonModAssignSubmissionPluginComponent { | export class AddonModAssignSubmissionCommentsComponent extends AddonModAssignSubmissionPluginComponent { | ||||||
|     @ViewChild(CoreCommentsCommentsComponent) commentsComponent: CoreCommentsCommentsComponent; |     @ViewChild(CoreCommentsCommentsComponent) commentsComponent: CoreCommentsCommentsComponent; | ||||||
|  | |||||||
| @ -26,7 +26,7 @@ import { AddonModAssignSubmissionPluginComponent } from '../../../classes/submis | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-assign-submission-file', |     selector: 'addon-mod-assign-submission-file', | ||||||
|     templateUrl: 'file.html' |     templateUrl: 'addon-mod-assign-submission-file.html' | ||||||
| }) | }) | ||||||
| export class AddonModAssignSubmissionFileComponent extends AddonModAssignSubmissionPluginComponent implements OnInit { | export class AddonModAssignSubmissionFileComponent extends AddonModAssignSubmissionPluginComponent implements OnInit { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -25,7 +25,7 @@ import { AddonModAssignSubmissionPluginComponent } from '../../../classes/submis | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-assign-submission-online-text', |     selector: 'addon-mod-assign-submission-online-text', | ||||||
|     templateUrl: 'onlinetext.html' |     templateUrl: 'addon-mod-assign-submission-onlinetext.html' | ||||||
| }) | }) | ||||||
| export class AddonModAssignSubmissionOnlineTextComponent extends AddonModAssignSubmissionPluginComponent implements OnInit { | export class AddonModAssignSubmissionOnlineTextComponent extends AddonModAssignSubmissionPluginComponent implements OnInit { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -33,11 +33,12 @@ export const ADDON_MOD_BOOK_PROVIDERS: any[] = [ | |||||||
|     imports: [ |     imports: [ | ||||||
|         AddonModBookComponentsModule |         AddonModBookComponentsModule | ||||||
|     ], |     ], | ||||||
|     providers: ADDON_MOD_BOOK_PROVIDERS.concat([ |     providers: [ | ||||||
|  |         AddonModBookProvider, | ||||||
|         AddonModBookModuleHandler, |         AddonModBookModuleHandler, | ||||||
|         AddonModBookLinkHandler, |         AddonModBookLinkHandler, | ||||||
|         AddonModBookPrefetchHandler |         AddonModBookPrefetchHandler | ||||||
|     ]) |     ] | ||||||
| }) | }) | ||||||
| export class AddonModBookModule { | export class AddonModBookModule { | ||||||
|     constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModBookModuleHandler, |     constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModBookModuleHandler, | ||||||
|  | |||||||
| @ -26,7 +26,7 @@ import { AddonModBookTocPopoverComponent } from '../../components/toc-popover/to | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-book-index', |     selector: 'addon-mod-book-index', | ||||||
|     templateUrl: 'index.html', |     templateUrl: 'addon-mod-assign-submission-index.html', | ||||||
| }) | }) | ||||||
| export class AddonModBookIndexComponent extends CoreCourseModuleMainResourceComponent { | export class AddonModBookIndexComponent extends CoreCourseModuleMainResourceComponent { | ||||||
|     component = AddonModBookProvider.COMPONENT; |     component = AddonModBookProvider.COMPONENT; | ||||||
|  | |||||||
| @ -19,7 +19,7 @@ import { Component, Input, Output, EventEmitter } from '@angular/core'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-book-navigation-arrows', |     selector: 'addon-mod-book-navigation-arrows', | ||||||
|     templateUrl: 'navigation-arrows.html' |     templateUrl: 'addon-mod-assign-submission-navigation-arrows.html' | ||||||
| }) | }) | ||||||
| export class AddonModBookNavigationArrowsComponent { | export class AddonModBookNavigationArrowsComponent { | ||||||
|     @Input() previous?: string; // Previous chapter ID.
 |     @Input() previous?: string; // Previous chapter ID.
 | ||||||
|  | |||||||
| @ -21,7 +21,7 @@ import { AddonModBookTocChapter } from '../../providers/book'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-book-toc-popover', |     selector: 'addon-mod-book-toc-popover', | ||||||
|     templateUrl: 'toc-popover.html' |     templateUrl: 'addon-mod-assign-submission-toc-popover.html' | ||||||
| }) | }) | ||||||
| export class AddonModBookTocPopoverComponent { | export class AddonModBookTocPopoverComponent { | ||||||
|     chapters: AddonModBookTocChapter[]; |     chapters: AddonModBookTocChapter[]; | ||||||
|  | |||||||
| @ -31,10 +31,11 @@ export const ADDON_MOD_CHAT_PROVIDERS: any[] = [ | |||||||
|     imports: [ |     imports: [ | ||||||
|         AddonModChatComponentsModule |         AddonModChatComponentsModule | ||||||
|     ], |     ], | ||||||
|     providers: ADDON_MOD_CHAT_PROVIDERS.concat([ |     providers: [ | ||||||
|  |         AddonModChatProvider, | ||||||
|         AddonModChatLinkHandler, |         AddonModChatLinkHandler, | ||||||
|         AddonModChatModuleHandler, |         AddonModChatModuleHandler, | ||||||
|     ]) |     ] | ||||||
| }) | }) | ||||||
| export class AddonModChatModule { | export class AddonModChatModule { | ||||||
|     constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModChatModuleHandler, |     constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModChatModuleHandler, | ||||||
|  | |||||||
| @ -24,7 +24,7 @@ import * as moment from 'moment'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-chat-index', |     selector: 'addon-mod-chat-index', | ||||||
|     templateUrl: 'index.html', |     templateUrl: 'addon-mod-assign-submission-index.html', | ||||||
| }) | }) | ||||||
| export class AddonModChatIndexComponent extends CoreCourseModuleMainActivityComponent { | export class AddonModChatIndexComponent extends CoreCourseModuleMainActivityComponent { | ||||||
|     component = AddonModChatProvider.COMPONENT; |     component = AddonModChatProvider.COMPONENT; | ||||||
|  | |||||||
| @ -40,12 +40,15 @@ export const ADDON_MOD_CHOICE_PROVIDERS: any[] = [ | |||||||
|     imports: [ |     imports: [ | ||||||
|         AddonModChoiceComponentsModule |         AddonModChoiceComponentsModule | ||||||
|     ], |     ], | ||||||
|     providers: ADDON_MOD_CHOICE_PROVIDERS.concat([ |     providers: [ | ||||||
|  |         AddonModChoiceProvider, | ||||||
|  |         AddonModChoiceSyncProvider, | ||||||
|  |         AddonModChoiceOfflineProvider, | ||||||
|         AddonModChoiceModuleHandler, |         AddonModChoiceModuleHandler, | ||||||
|         AddonModChoicePrefetchHandler, |         AddonModChoicePrefetchHandler, | ||||||
|         AddonModChoiceLinkHandler, |         AddonModChoiceLinkHandler, | ||||||
|         AddonModChoiceSyncCronHandler |         AddonModChoiceSyncCronHandler | ||||||
|     ]) |     ] | ||||||
| }) | }) | ||||||
| export class AddonModChoiceModule { | export class AddonModChoiceModule { | ||||||
|     constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModChoiceModuleHandler, |     constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModChoiceModuleHandler, | ||||||
|  | |||||||
| @ -25,7 +25,7 @@ import * as moment from 'moment'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-choice-index', |     selector: 'addon-mod-choice-index', | ||||||
|     templateUrl: 'index.html', |     templateUrl: 'addon-mod-choice-index.html', | ||||||
| }) | }) | ||||||
| export class AddonModChoiceIndexComponent extends CoreCourseModuleMainActivityComponent { | export class AddonModChoiceIndexComponent extends CoreCourseModuleMainActivityComponent { | ||||||
|     component = AddonModChoiceProvider.COMPONENT; |     component = AddonModChoiceProvider.COMPONENT; | ||||||
|  | |||||||
| @ -23,7 +23,7 @@ import { CoreUserProvider } from '@core/user/providers/user'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-data-action', |     selector: 'addon-mod-data-action', | ||||||
|     templateUrl: 'action.html', |     templateUrl: 'addon-mod-data-action.html', | ||||||
| }) | }) | ||||||
| export class AddonModDataActionComponent implements OnInit { | export class AddonModDataActionComponent implements OnInit { | ||||||
|     @Input() mode: string; // The render mode.
 |     @Input() mode: string; // The render mode.
 | ||||||
|  | |||||||
| @ -22,7 +22,7 @@ import { CoreDynamicComponent } from '@components/dynamic-component/dynamic-comp | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-data-field-plugin', |     selector: 'addon-mod-data-field-plugin', | ||||||
|     templateUrl: 'field-plugin.html', |     templateUrl: 'addon-mod-data-field-plugin.html', | ||||||
| }) | }) | ||||||
| export class AddonModDataFieldPluginComponent implements OnInit, OnChanges { | export class AddonModDataFieldPluginComponent implements OnInit, OnChanges { | ||||||
|     @ViewChild(CoreDynamicComponent) dynamicComponent: CoreDynamicComponent; |     @ViewChild(CoreDynamicComponent) dynamicComponent: CoreDynamicComponent; | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ import * as moment from 'moment'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-data-index', |     selector: 'addon-mod-data-index', | ||||||
|     templateUrl: 'index.html', |     templateUrl: 'addon-mod-data-index.html', | ||||||
| }) | }) | ||||||
| export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComponent { | export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComponent { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -51,7 +51,12 @@ export const ADDON_MOD_DATA_PROVIDERS: any[] = [ | |||||||
|         AddonModDataComponentsModule, |         AddonModDataComponentsModule, | ||||||
|         AddonModDataFieldModule |         AddonModDataFieldModule | ||||||
|     ], |     ], | ||||||
|     providers: ADDON_MOD_DATA_PROVIDERS.concat([ |     providers: [ | ||||||
|  |         AddonModDataProvider, | ||||||
|  |         AddonModDataHelperProvider, | ||||||
|  |         AddonModDataSyncProvider, | ||||||
|  |         AddonModDataOfflineProvider, | ||||||
|  |         AddonModDataFieldsDelegate, | ||||||
|         AddonModDataModuleHandler, |         AddonModDataModuleHandler, | ||||||
|         AddonModDataPrefetchHandler, |         AddonModDataPrefetchHandler, | ||||||
|         AddonModDataLinkHandler, |         AddonModDataLinkHandler, | ||||||
| @ -61,7 +66,7 @@ export const ADDON_MOD_DATA_PROVIDERS: any[] = [ | |||||||
|         AddonModDataEditLinkHandler, |         AddonModDataEditLinkHandler, | ||||||
|         AddonModDataSyncCronHandler, |         AddonModDataSyncCronHandler, | ||||||
|         AddonModDataDefaultFieldHandler |         AddonModDataDefaultFieldHandler | ||||||
|     ]) |     ] | ||||||
| }) | }) | ||||||
| export class AddonModDataModule { | export class AddonModDataModule { | ||||||
|     constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModDataModuleHandler, |     constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModDataModuleHandler, | ||||||
|  | |||||||
| @ -20,7 +20,7 @@ import { AddonModDataFieldPluginComponent } from '../../../classes/field-plugin- | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-data-field-checkbox', |     selector: 'addon-mod-data-field-checkbox', | ||||||
|     templateUrl: 'checkbox.html' |     templateUrl: 'addon-mod-data-field-checkbox.html' | ||||||
| }) | }) | ||||||
| export class AddonModDataFieldCheckboxComponent extends AddonModDataFieldPluginComponent { | export class AddonModDataFieldCheckboxComponent extends AddonModDataFieldPluginComponent { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -21,7 +21,7 @@ import { AddonModDataFieldPluginComponent } from '../../../classes/field-plugin- | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-data-field-date', |     selector: 'addon-mod-data-field-date', | ||||||
|     templateUrl: 'date.html' |     templateUrl: 'addon-mod-data-field-date.html' | ||||||
| }) | }) | ||||||
| export class AddonModDataFieldDateComponent extends AddonModDataFieldPluginComponent { | export class AddonModDataFieldDateComponent extends AddonModDataFieldPluginComponent { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -22,7 +22,7 @@ import { AddonModDataProvider } from '../../../providers/data'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-data-field-file', |     selector: 'addon-mod-data-field-file', | ||||||
|     templateUrl: 'file.html' |     templateUrl: 'addon-mod-data-field-file.html' | ||||||
| }) | }) | ||||||
| export class AddonModDataFieldFileComponent extends AddonModDataFieldPluginComponent { | export class AddonModDataFieldFileComponent extends AddonModDataFieldPluginComponent { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -21,7 +21,7 @@ import { AddonModDataFieldPluginComponent } from '../../../classes/field-plugin- | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-data-field-latlong', |     selector: 'addon-mod-data-field-latlong', | ||||||
|     templateUrl: 'latlong.html' |     templateUrl: 'addon-mod-data-field-latlong.html' | ||||||
| }) | }) | ||||||
| export class AddonModDataFieldLatlongComponent extends AddonModDataFieldPluginComponent { | export class AddonModDataFieldLatlongComponent extends AddonModDataFieldPluginComponent { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -20,7 +20,7 @@ import { AddonModDataFieldPluginComponent } from '../../../classes/field-plugin- | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-data-field-menu', |     selector: 'addon-mod-data-field-menu', | ||||||
|     templateUrl: 'menu.html' |     templateUrl: 'addon-mod-data-field-menu.html' | ||||||
| }) | }) | ||||||
| export class AddonModDataFieldMenuComponent extends AddonModDataFieldPluginComponent { | export class AddonModDataFieldMenuComponent extends AddonModDataFieldPluginComponent { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -20,7 +20,7 @@ import { AddonModDataFieldPluginComponent } from '../../../classes/field-plugin- | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-data-field-multimenu', |     selector: 'addon-mod-data-field-multimenu', | ||||||
|     templateUrl: 'multimenu.html' |     templateUrl: 'addon-mod-data-field-multimenu.html' | ||||||
| }) | }) | ||||||
| export class AddonModDataFieldMultimenuComponent extends AddonModDataFieldPluginComponent { | export class AddonModDataFieldMultimenuComponent extends AddonModDataFieldPluginComponent { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -20,7 +20,7 @@ import { AddonModDataFieldPluginComponent } from '../../../classes/field-plugin- | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-data-field-number', |     selector: 'addon-mod-data-field-number', | ||||||
|     templateUrl: 'number.html' |     templateUrl: 'addon-mod-data-field-number.html' | ||||||
| }) | }) | ||||||
| export class AddonModDataFieldNumberComponent extends AddonModDataFieldPluginComponent{ | export class AddonModDataFieldNumberComponent extends AddonModDataFieldPluginComponent{ | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -22,7 +22,7 @@ import { AddonModDataProvider } from '../../../providers/data'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-data-field-picture', |     selector: 'addon-mod-data-field-picture', | ||||||
|     templateUrl: 'picture.html' |     templateUrl: 'addon-mod-data-field-picture.html' | ||||||
| }) | }) | ||||||
| export class AddonModDataFieldPictureComponent extends AddonModDataFieldPluginComponent { | export class AddonModDataFieldPictureComponent extends AddonModDataFieldPluginComponent { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -20,7 +20,7 @@ import { AddonModDataFieldPluginComponent } from '../../../classes/field-plugin- | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-data-field-radiobutton', |     selector: 'addon-mod-data-field-radiobutton', | ||||||
|     templateUrl: 'radiobutton.html' |     templateUrl: 'addon-mod-data-field-radiobutton.html' | ||||||
| }) | }) | ||||||
| export class AddonModDataFieldRadiobuttonComponent extends AddonModDataFieldPluginComponent { | export class AddonModDataFieldRadiobuttonComponent extends AddonModDataFieldPluginComponent { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -20,7 +20,7 @@ import { AddonModDataFieldPluginComponent } from '../../../classes/field-plugin- | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-data-field-text', |     selector: 'addon-mod-data-field-text', | ||||||
|     templateUrl: 'text.html' |     templateUrl: 'addon-mod-data-field-text.html' | ||||||
| }) | }) | ||||||
| export class AddonModDataFieldTextComponent extends AddonModDataFieldPluginComponent { | export class AddonModDataFieldTextComponent extends AddonModDataFieldPluginComponent { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -22,7 +22,7 @@ import { AddonModDataFieldPluginComponent } from '../../../classes/field-plugin- | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-data-field-textarea', |     selector: 'addon-mod-data-field-textarea', | ||||||
|     templateUrl: 'textarea.html' |     templateUrl: 'addon-mod-data-field-textarea.html' | ||||||
| }) | }) | ||||||
| export class AddonModDataFieldTextareaComponent extends AddonModDataFieldPluginComponent { | export class AddonModDataFieldTextareaComponent extends AddonModDataFieldPluginComponent { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -20,7 +20,7 @@ import { AddonModDataFieldPluginComponent } from '../../../classes/field-plugin- | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-data-field-url', |     selector: 'addon-mod-data-field-url', | ||||||
|     templateUrl: 'url.html' |     templateUrl: 'addon-mod-data-field-url.html' | ||||||
| }) | }) | ||||||
| export class AddonModDataFieldUrlComponent extends AddonModDataFieldPluginComponent { | export class AddonModDataFieldUrlComponent extends AddonModDataFieldPluginComponent { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -27,7 +27,7 @@ import * as moment from 'moment'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-feedback-index', |     selector: 'addon-mod-feedback-index', | ||||||
|     templateUrl: 'index.html', |     templateUrl: 'addon-mod-feedback-index.html', | ||||||
| }) | }) | ||||||
| export class AddonModFeedbackIndexComponent extends CoreCourseModuleMainActivityComponent { | export class AddonModFeedbackIndexComponent extends CoreCourseModuleMainActivityComponent { | ||||||
|     @Input() tab = 'overview'; |     @Input() tab = 'overview'; | ||||||
|  | |||||||
| @ -47,7 +47,11 @@ export const ADDON_MOD_FEEDBACK_PROVIDERS: any[] = [ | |||||||
|     imports: [ |     imports: [ | ||||||
|         AddonModFeedbackComponentsModule |         AddonModFeedbackComponentsModule | ||||||
|     ], |     ], | ||||||
|     providers: ADDON_MOD_FEEDBACK_PROVIDERS.concat([ |     providers: [ | ||||||
|  |         AddonModFeedbackProvider, | ||||||
|  |         AddonModFeedbackHelperProvider, | ||||||
|  |         AddonModFeedbackSyncProvider, | ||||||
|  |         AddonModFeedbackOfflineProvider, | ||||||
|         AddonModFeedbackModuleHandler, |         AddonModFeedbackModuleHandler, | ||||||
|         AddonModFeedbackPrefetchHandler, |         AddonModFeedbackPrefetchHandler, | ||||||
|         AddonModFeedbackLinkHandler, |         AddonModFeedbackLinkHandler, | ||||||
| @ -57,7 +61,7 @@ export const ADDON_MOD_FEEDBACK_PROVIDERS: any[] = [ | |||||||
|         AddonModFeedbackCompleteLinkHandler, |         AddonModFeedbackCompleteLinkHandler, | ||||||
|         AddonModFeedbackPrintLinkHandler, |         AddonModFeedbackPrintLinkHandler, | ||||||
|         AddonModFeedbackSyncCronHandler |         AddonModFeedbackSyncCronHandler | ||||||
|     ]) |     ] | ||||||
| }) | }) | ||||||
| export class AddonModFeedbackModule { | export class AddonModFeedbackModule { | ||||||
|     constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModFeedbackModuleHandler, |     constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModFeedbackModuleHandler, | ||||||
|  | |||||||
| @ -26,7 +26,7 @@ import { AddonModFolderHelperProvider } from '../../providers/helper'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-folder-index', |     selector: 'addon-mod-folder-index', | ||||||
|     templateUrl: 'index.html', |     templateUrl: 'addon-mod-folder-index.html', | ||||||
| }) | }) | ||||||
| export class AddonModFolderIndexComponent extends CoreCourseModuleMainResourceComponent { | export class AddonModFolderIndexComponent extends CoreCourseModuleMainResourceComponent { | ||||||
|     @Input() path: string; // For subfolders. Use the path instead of a boolean so Angular detects them as different states.
 |     @Input() path: string; // For subfolders. Use the path instead of a boolean so Angular detects them as different states.
 | ||||||
|  | |||||||
| @ -37,12 +37,14 @@ export const ADDON_MOD_FOLDER_PROVIDERS: any[] = [ | |||||||
|     imports: [ |     imports: [ | ||||||
|         AddonModFolderComponentsModule |         AddonModFolderComponentsModule | ||||||
|     ], |     ], | ||||||
|     providers: ADDON_MOD_FOLDER_PROVIDERS.concat([ |     providers: [ | ||||||
|  |         AddonModFolderProvider, | ||||||
|  |         AddonModFolderHelperProvider, | ||||||
|         AddonModFolderModuleHandler, |         AddonModFolderModuleHandler, | ||||||
|         AddonModFolderPrefetchHandler, |         AddonModFolderPrefetchHandler, | ||||||
|         AddonModFolderLinkHandler, |         AddonModFolderLinkHandler, | ||||||
|         AddonModFolderPluginFileHandler |         AddonModFolderPluginFileHandler | ||||||
|     ]) |     ] | ||||||
| }) | }) | ||||||
| export class AddonModFolderModule { | export class AddonModFolderModule { | ||||||
|     constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModFolderModuleHandler, |     constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModFolderModuleHandler, | ||||||
|  | |||||||
| @ -30,7 +30,7 @@ import { AddonModForumPrefetchHandler } from '../../providers/prefetch-handler'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-forum-index', |     selector: 'addon-mod-forum-index', | ||||||
|     templateUrl: 'index.html', |     templateUrl: 'addon-mod-forum-index.html', | ||||||
| }) | }) | ||||||
| export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityComponent { | export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityComponent { | ||||||
|     @ViewChild(CoreSplitViewComponent) splitviewCtrl: CoreSplitViewComponent; |     @ViewChild(CoreSplitViewComponent) splitviewCtrl: CoreSplitViewComponent; | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ import { AddonModForumSyncProvider } from '../../providers/sync'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-forum-post', |     selector: 'addon-mod-forum-post', | ||||||
|     templateUrl: 'post.html', |     templateUrl: 'addon-mod-forum-post.html', | ||||||
| }) | }) | ||||||
| export class AddonModForumPostComponent implements OnInit, OnDestroy { | export class AddonModForumPostComponent implements OnInit, OnDestroy { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -43,13 +43,17 @@ export const ADDON_MOD_FORUM_PROVIDERS: any[] = [ | |||||||
|     imports: [ |     imports: [ | ||||||
|         AddonModForumComponentsModule, |         AddonModForumComponentsModule, | ||||||
|     ], |     ], | ||||||
|     providers: ADDON_MOD_FORUM_PROVIDERS.concat([ |     providers: [ | ||||||
|  |         AddonModForumProvider, | ||||||
|  |         AddonModForumOfflineProvider, | ||||||
|  |         AddonModForumHelperProvider, | ||||||
|  |         AddonModForumSyncProvider, | ||||||
|         AddonModForumModuleHandler, |         AddonModForumModuleHandler, | ||||||
|         AddonModForumPrefetchHandler, |         AddonModForumPrefetchHandler, | ||||||
|         AddonModForumSyncCronHandler, |         AddonModForumSyncCronHandler, | ||||||
|         AddonModForumIndexLinkHandler, |         AddonModForumIndexLinkHandler, | ||||||
|         AddonModForumDiscussionLinkHandler |         AddonModForumDiscussionLinkHandler | ||||||
|     ]) |     ] | ||||||
| }) | }) | ||||||
| export class AddonModForumModule { | export class AddonModForumModule { | ||||||
|     constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModForumModuleHandler, |     constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModForumModuleHandler, | ||||||
|  | |||||||
| @ -28,7 +28,7 @@ type FetchMode = 'author_all' | 'cat_all' | 'newest_first' | 'recently_updated' | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-glossary-index', |     selector: 'addon-mod-glossary-index', | ||||||
|     templateUrl: 'index.html', |     templateUrl: 'addon-mod-glossary-index.html', | ||||||
| }) | }) | ||||||
| export class AddonModGlossaryIndexComponent extends CoreCourseModuleMainActivityComponent { | export class AddonModGlossaryIndexComponent extends CoreCourseModuleMainActivityComponent { | ||||||
|     @ViewChild(CoreSplitViewComponent) splitviewCtrl: CoreSplitViewComponent; |     @ViewChild(CoreSplitViewComponent) splitviewCtrl: CoreSplitViewComponent; | ||||||
|  | |||||||
| @ -20,7 +20,7 @@ import { NavParams, ViewController } from 'ionic-angular'; | |||||||
|  */ |  */ | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-mod-glossary-mode-picker-popover', |     selector: 'addon-mod-glossary-mode-picker-popover', | ||||||
|     templateUrl: 'mode-picker.html' |     templateUrl: 'addon-mod-glossary-mode-picker.html' | ||||||
| }) | }) | ||||||
| export class AddonModGlossaryModePickerPopoverComponent { | export class AddonModGlossaryModePickerPopoverComponent { | ||||||
|     modes = []; |     modes = []; | ||||||
|  | |||||||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user