-1

I'm having some issues with LMS and SCORM 1.2. I'm using a software (called iSpring) which generate a folder with a slideshow, starting from slides of powerpoint. I can include LMS 1.2 to that slideshow. All files needed are hosted on an s3 bucket. To show the slideshow, I have an iFrame, with [src] the index.html file (not direct to the storage, but calls the api of backend in dotnet and get back that index.html).

The problem is, how do I interact with LMS? I need to know when a slideshow is ended. I can make it work in local calling that method OnInit of the iFrame component in angular:

  private addLmsApi() {
// SCORM 1.1, 1.2
(window as any).API = this.lmsApi;
}

lmsApi is :

export class LmsApi {
  private logger: LmsApiLogger;
  isSlideshowCompleted = new Subject<boolean>();

  constructor(loggerLevel?: LmsApiLoggerLevel, logger?: LmsApiLogger) {
    this.logger = logger || new DefaultLmsApiLogger(loggerLevel);
  }

  get isSlideshowCompleted$() {
    return this.isSlideshowCompleted.asObservable();
  }

  get Logger() {
    return this.logger;
  }

  set Logger(logger: any) {
    this.logger = logger;
  }

  // SCORM 1.1 / SCORM 1.2
  LMSInitialize() {
    this.isSlideshowCompleted.next(false);
    console.log("LMS INITIALIZE TRIGGERATO");
    
    this.logger.debug('LMSInitialize');
    return 'true';
  }

  LMSFinish() {
    this.logger.debug('LMSFinish');
    return 'true';
  }

  LMSGetValue(element: any) {
    this.logger.debug('LMSGetValue', element);
    return '';
  }

  LMSSetValue(element: any, value: string) {
    console.log(element);
    console.log(value);        

    if(element == "cmi.core.lesson_status" && value == "completed") {
      console.log("entrato nell'IF")
      this.isSlideshowCompleted.next(true);
    }
    this.logger.debug('LMSSetValue', element, value);
    return value;
  }

  LMSCommit() {
    this.logger.debug('LMSCommit');
    return 'true';
  }

  LMSGetLastError() {
    this.logger.debug('LMSGetLastError');
    return '';
  }

  LMSGetErrorString(errorCode: any) {
    this.logger.debug('LMSGetErrorString', errorCode);
    return errorCode;
  }

  LMSGetDiagnostic(errorCode: any) {
    this.logger.debug('LMSGetDiagnostic', errorCode);
    return errorCode;
  }
}

The problem is that it is working fine in local (it prints everything on console and it updates the Subscription), but it is not working after deployed, not getting a single console.log when it is deployed. Any idea on how should I proceed?

Raso
  • 1
  • 1

0 Answers0