diff --git a/projects/quml-library/src/lib/section-player/section-player.component.ts b/projects/quml-library/src/lib/section-player/section-player.component.ts index 03c37503..df59204c 100644 --- a/projects/quml-library/src/lib/section-player/section-player.component.ts +++ b/projects/quml-library/src/lib/section-player/section-player.component.ts @@ -91,6 +91,7 @@ export class SectionPlayerComponent implements OnChanges, AfterViewInit { isAssessEventRaised = false; isShuffleQuestions = false; shuffleOptions: boolean; + playerContentCompatibiltyLevel = 6; constructor( public viewerService: ViewerService, @@ -560,7 +561,9 @@ export class SectionPlayerComponent implements OnChanges, AfterViewInit { private checkCompatibilityLevel(compatibilityLevel) { /* istanbul ignore else */ if (compatibilityLevel) { - const checkContentCompatible = this.errorService.checkContentCompatibility(compatibilityLevel); + // TODO: It is a temporary fix for IQ-679 or ED-3398 + // Before these changes we were calling errorService.checkContentCompatibility + const checkContentCompatible = this.checkContentCompatibility(compatibilityLevel); /* istanbul ignore else */ if (!checkContentCompatible.isCompitable) { @@ -570,6 +573,18 @@ export class SectionPlayerComponent implements OnChanges, AfterViewInit { } } + checkContentCompatibility(currentCompatibilityLevel: number) { + if (currentCompatibilityLevel > this.playerContentCompatibiltyLevel) { + const compatibilityError = new Error(); + compatibilityError.message = `Player supports ${this.playerContentCompatibiltyLevel} + but content compatibility is ${currentCompatibilityLevel}`; + compatibilityError.name = 'contentCompatibily'; + return { error: compatibilityError, isCompitable: false }; + } else { + return { error: null, isCompitable: true }; + } + } + emitSectionEnd(isDurationEnded: boolean = false, jumpToSection?: string) { const eventObj: any = { summary: this.createSummaryObj(),