Skip to content

Commit

Permalink
Issue #IQ-679 fix: Alternative fix for IQ-567 Telemetry Error
Browse files Browse the repository at this point in the history
  • Loading branch information
rajnishdargan committed Feb 15, 2024
1 parent 68abfb3 commit f763dd5
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export class SectionPlayerComponent implements OnChanges, AfterViewInit {
isAssessEventRaised = false;
isShuffleQuestions = false;
shuffleOptions: boolean;
playerContentCompatibiltyLevel = 6;

constructor(
public viewerService: ViewerService,
Expand Down Expand Up @@ -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) {
Expand All @@ -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(),
Expand Down

0 comments on commit f763dd5

Please sign in to comment.