API errors and Workday L19 when SCORM Published

web-foley
web-foley Community Member Posts: 62 ✶ Headliner ✶
Sharing a sloppy workaround if others are getting a series of API errors on their LMS and could use this type of workaround.

We're building with L19 and cannot get any GoTo New window (opening a page residing in our course, not external) without a host of API errors (courses running on Workday, SCORM Published). Errors like InvalidArgumentError, NotInitialized etc.

For us, we're opening up new pages such as References and Job Aids in a pop-up window so the learner can view in tandem with the course. It seems that the course is trying to communicate with SCORM and bookmarking to the pop-out screen, causing these errors on our LMS.

Since we are just showing single pages that don't need to pass info to our course our bootstrap fix was to Publish for SCORM, then Publish again for HTML. Then, copy the pop-up page(s) (like "a001_References.html") from the HTML folder and replacing the one(s) individually in the SCORM>HTML folder.

Comparing the documents, aside from a few references to bookmarking in the source, you could arguably just comment-out the reference to apiwrapper11.js in the offending SCORM Published file: <script src="apiwrapper11.js"></script>. I wish there was a way to do that from within Lectora but alas, no joy.

If you're getting the same time off errors, and you don't need that info passed, you could try this approach.

-Darrell

Comments

  • wheels
    wheels Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 654 eLearning ROCKSTAR Admin Team
    Hi Darrell (@web-foley),

    Long time!

    That sounds like a bug because if you pop up a window it should still be able to find the SCORM api. We had some fixes that went into v19 for that, make sure you are on the latest v19 version.

    If you post me a zip of a sample project that has this behavior I will write you a script that you can include on any page that you do not want SCORM interaction on (so it doesn't throw those errors). It helps if you can give me an example, the source zip and then the published SCORM package also. That way I can test to see if it's a v19 problem only as well.

    Thanks!
    - Joe
  • web-foley
    web-foley Community Member Posts: 62 ✶ Headliner ✶
    Hey Joe (@wheels), ya, was off for about a year!

    Thanks for taking a look. Running v19.0.4

    I even attempted a few unsuccessful methods of commenting out various lines of an AICC Publish for the offending files thinking this could be a fix if I executed a script to reach and replace (including src="apiwrapper11.js and script src="scofunctions.js and others). Ya, that totally didn't work. Sure there was no API errors, but there was also no page content loading haha!

    Essentially, we have some popups in our courses that the learner will keep open as a reference. They do not launch without API errors, often over 10 dialog error prompts. Swapping them with those from an HTML publish does the trick (since they have to connections to the AICC published), but that has introduced some risk when other colleagues are Publishing for the LMS and don't do (or know about) the workaround. It would be lovely to just have something "developer proof".

    -Darrell.



  • malqaseer3753
    malqaseer3753 Community Member Posts: 8 ♪ Opening Act ♪
    edited November 3, 2022
    Hi Darrell,

    So good to see you here brother!!
    Just a quick note, ... this has got to be an LMS/Learning object setup issue. Can you test this in SCORM Cloud, if you have access.

    Mo
  • wheels
    wheels Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 654 eLearning ROCKSTAR Admin Team
    Maybe try with this SCORM package published with v21.1 and see if it has the problem. I am unable to reproduce the problem so maybe it's something with the version of v19 that you have.
  • web-foley
    web-foley Community Member Posts: 62 ✶ Headliner ✶
    Interesting, it's the same result, even when Published in in L21 (GENERATED BY: Lectora v.21.1(12339))
    Workday really dislikes that apiwrapper11.js, took about 40 "ok" selections to have the page load.



  • wheels
    wheels Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 654 eLearning ROCKSTAR Admin Team
    @web-foley

    I am not sure why that window cannot connect back to it's parent! Maybe because of the way Workday is opening the first window, maybe, but I'm not sure.

    Well, if you absolutely do not care about the connection in that window you could do an easy cheesy solution. Add an On Show action to the popup page of type Run Javascript and then override the alert function.

    alert = function(){};

  • web-foley
    web-foley Community Member Posts: 62 ✶ Headliner ✶
    Just gave that JavaScript a try, still got some errors, but fewer:
    1. Unable to find an API adapter
      Unable to locate the LMS's API Implementation.
    2. LMSIsInitialized() failed
    3. Unable to find an API adapter
    4. Unable to locate the LMS's API Implementaion.
      LMSIsInitialized was not successful.
    5. Unable to find an API adapter
    6. Unable to locate the LMS's API Implimentation.
      LMSGetValue was not successful.
    7. Unable to find an API adapter
    8. Unable to locate the LMS's API Implimentation.
      LMSGetValue was not successful.
    We might be stuck with the "also Publish HTML and swap the offending pop-up files" before packaging for Workday. If I have time, I may do another document compare of the SCORM vs HTML and see if I missed commenting out something the first time.

    I appreciate you looking into it though!

    -Darrell
  • wheels
    wheels Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 654 eLearning ROCKSTAR Admin Team
    edited November 7, 2022
    @web-foley

    One more thing to try, I think we were not disabling alert early enough...

    Add this HTML Extension to your popup page...

    *** make sure to set it to type Meta tags!




    <script> alert = function(){}; </script>
  • web-foley
    web-foley Community Member Posts: 62 ✶ Headliner ✶
    Brilliant! So far so good.
    After I had logged off yesterday (at those times at dinner you SHOULD'T be thinking about inserting JavaScript) I wondered about "Top of Scripting"... This morning saw your reply I tried both that and "Meta tags" and that seemed to do it (not sure if one is preferred).
    As for turning off alerts for these individual popups, the "cheesy solution" has relatively low risk as these pages do not interact with the rest of the course and are used more as job aids, plus, I was swapping files with HTML published versions so we know they can be stand alone.

    Thanks again.

    Darrell