diff --git a/src/app/player/player.module.ts b/src/app/player/player.module.ts index 998ee636ae..83ff00d9fe 100644 --- a/src/app/player/player.module.ts +++ b/src/app/player/player.module.ts @@ -10,7 +10,6 @@ import { CanvasPlayerService } from '../../services/canvas-player.service'; import { ScreenOrientation } from '@awesome-cordova-plugins/screen-orientation/ngx'; import { SunbirdPdfPlayerModule } from '@project-sunbird/sunbird-pdf-player-v9'; import { SunbirdEpubPlayerModule } from '@project-sunbird/sunbird-epub-player-v9'; -import { QumlLibraryModule } from '@project-sunbird/sunbird-quml-player-v9'; @@ -29,7 +28,6 @@ const routes: Routes = [ FormsModule, SunbirdPdfPlayerModule, SunbirdEpubPlayerModule, - QumlLibraryModule, IonicModule, RouterModule.forChild(routes) ], diff --git a/src/app/player/player.page.ts b/src/app/player/player.page.ts index 4c116b99d8..a5f1bb9fd7 100644 --- a/src/app/player/player.page.ts +++ b/src/app/player/player.page.ts @@ -357,6 +357,21 @@ export class PlayerPage implements OnInit, OnDestroy, PlayerActionHandlerDelegat await this.toggleDeviceOrientation(); } } + else if (event.detail) { + const userId: string = this.appGlobalService.getCurrentUser().uid; + const parentId: string = (this.content.rollup && this.content.rollup.l1) ? this.content.rollup.l1 : this.content.identifier; + const contentId: string = this.content.identifier; + if(event.detail.edata['type'] === 'EXIT') { + this.playerService.deletePlayerSaveState(userId, parentId, contentId); + if (this.config['metadata']['mimeType'] === "application/vnd.sunbird.questionset") { + if (!this.isExitPopupShown) { + await this.showConfirm(); + } + } else { + this.location.back(); + } + } + } } handleDownload() { @@ -698,13 +713,6 @@ export class PlayerPage implements OnInit, OnDestroy, PlayerActionHandlerDelegat config: this.config.config, metadata: this.config.metadata }; - playerConfig.metadata['outcomeDeclaration'] = { - "maxScore": { - "cardinality": "single", - "type": "integer", - "defaultValue": 1 - } - } setTimeout(() => { const qumlElement = document.createElement('sunbird-quml-player'); @@ -712,6 +720,7 @@ export class PlayerPage implements OnInit, OnDestroy, PlayerActionHandlerDelegat qumlElement.addEventListener('playerEvent', (event) => { console.log("On playerEvent", event); + this.playerEvents(event); }); qumlElement.addEventListener('telemetryEvent', (event) => { diff --git a/src/services/quml-player/quml-player.service.ts b/src/services/quml-player/quml-player.service.ts index bc8c7745d9..f5a820a256 100644 --- a/src/services/quml-player/quml-player.service.ts +++ b/src/services/quml-player/quml-player.service.ts @@ -1,12 +1,11 @@ import { Inject, Injectable } from '@angular/core'; -import { QuestionCursor } from '@project-sunbird/sunbird-quml-player-v9'; import { ContentService } from '@project-sunbird/sunbird-sdk'; import { Observable, of } from 'rxjs'; @Injectable({ providedIn: 'root' }) -export class QumlPlayerService implements QuestionCursor { +export class QumlPlayerService { constructor( @Inject('CONTENT_SERVICE') private contentService: ContentService,