xAPI Launcher

xAPI has always been a bit like the continuum transfunctioner, as it’s mystery is exceeded only by it’s power.

Hoping to unravel a bit of that mystery, the attached Zip contains two files, a launch HTML file, and a configuration XML file that will allow you to run Lectora published xAPI content from a regular web server, rather than having to load the content on an LMS.

To use the files, just unzip and add them as attachments to your Lectora title, or copy them into the published directory of a Lectora title. Then, rather than launching your content by the normal a001index.html file produced by Lectora, launch it by running the included launch.html file.

So what does this mysterious launch.html file do?

  • loads the parameters from the included XML file
  • prompts the user for any information not included in that configuration file
  • formulates the launch string that loads the course
  • launches the course (in the same window)

So you can preload any information that will always be the same, such as the LRS endpoint, and prompt the user for information that will change per user, such as their email and password. You can modify the configuration file any way you like, so if you don’t need individual logins for each user, you can pre-fill all of the information, and it will run the course immediately, its all up to how you want to organize your information. There is even contextual help available for each parameter that is prompted for by launch.html.

Lets look at the configuration parameters available in launch.xml:

  • launchpage – this is the “start” file that will be launched once the launch string is created. For a Lectora published xAPI title, it is generally a001index.html
  • basicuserid – This is your ID on the LRS
  • basicpassword – This is your password on the LRS
  • email – This email will identify your course results on the LRS
  • endpoint – This is the URL that the course results will be sent to
  • activityid – This is the unique identifier for the course.

Hopefully this utility will do everything you need to get your xAPI off the ground. If you want to dig a little deeper, or set up your launch string on your own, I’ve included a PDF that has all of the details of the launch string for xAPI published Lectora titles, along with some info about a few LRS’s you can try.



Tags: ,


  1. Profile photo of Andrew Corbett
    Andrew Corbett

    Hey John,

    Thanks for posting this. I used it to implement my own launch page that passes in xAPI config params, Terrific help getting me going on a crucial functionality for us.

    Just as an FYI, I had some trouble getting your example to work as is. There seems to be a mismatch between the variable names read in from the xml file and those used in constructing the href.

    A question for you: Have you tried customizing the “context” info set as part of the xAPI statement? I’m beginning to realize this will be important in enabling analytics further down the line — e.g., specifying which PAGE of an activity the learner “interacted” with something. Interested in your thoughts.


  2. Profile photo of John Blackmon
    John Blackmon Post author

    If you could send me a message on the issue I’ll make sure to get it cleared up. I am able to get it working with SCORM Cloud without modification, so not sure what the problem would be.

    On the context question, the xAPI statements from Lectora use context to group the statements specifically for reporting. Those statements that don’t have the object as the course ID have the course ID specified as the parent in their context so that the statements can all be linked together. I suppose the page could be inferred from the sequence of events, as each page is reached, an “experienced” verb is sent (if bookmarking is enabled in publish) giving you which page the user is on.

  3. Profile photo of Andrew Corbett
    Andrew Corbett


    RE: “I am able to get it working with SCORM Cloud without modification, so not sure what the problem would be.”
    Then it must just have been user error. No worries — I truly appreciated having your example to work from.

    Thanks for sharing your thoughts on “context”. What you say makes sense and that may be what I ultimately do. I also think that there are capabilities that haven’t been fully implemented yet by Lectora. But I’m not complaining — we’re all figuring it out and Lectora seems to be ahead of the game with respect to vendors.

    Best wishes,

  4. Profile photo of Jeremy V
    Jeremy V

    Hi John,

    I saw the Inspiration Wednesday yesterday on xAPI and thought that it was great. Thanks for taking the time to do that!

    My question is, the LMS that my organization uses is months (at least) away from supporting xAPI / LRS, but I would like to put together a demo of one of our courses to show some of my team members to build some excitement around what this technology can do. Are you aware of any free resources where one could upload a SCORM packet, take a course, and then report these results?

    Thanks for the time,


  5. Profile photo of John Blackmon
    John Blackmon Post author

    Sure, everything I showed was submitted to SCORM Cloud (cloud.scorm.com) under a free account. Just publish to xAPI and upload!

  6. Profile photo of Rick Vallejo
    Rick Vallejo

    John, is it possible to get the the Lectora washing machine example (AWT) file that shows xAPI examples that you demoed on 2/22? Thanks

  7. Profile photo of John Blackmon
    John Blackmon Post author

    I’ll have it up there tomorrow. Right now the community isn’t letting me upload files of that size, but we are going to update it tonight, and I’ll post it in the morning

  8. Becky

    Hi, is there anything in Lectora 17 that would require revision to these launcher files? Thanks in advance!

  9. Profile photo of Andrew Lian
    Andrew Lian

    Hi John
    I have purchased the grassblade system and installed it (no problems) – but I wonder about how to connect Lectora lessons (with no LMS) to it. I have watched a couple of webinars of yours that have been very helpful, but I see no place in Lectora where I could specify API user and API password. I imagine that this is dealt with in the files attached to this post. I presume they are still valid. Am I right? I do not want to go through any LMS.

    Thanks for any thoughts.

  10. Profile photo of Andrew Lian
    Andrew Lian

    As a followup, I would much prefer not to use any additional files. Is it possible, instead to use a launch string (as per your pdf document) and simply write it in the Activity ID of the XAPI box or some other place?

    Thanks again

  11. Profile photo of Andrew Lian
    Andrew Lian

    I am surely doing something wrong. I have modified the xml file to reflect the LRS parameters, I have included the two files in the title, and have launched on an apache server using launch.html, but i get the form to fill in. and it protests by saying that I must run this file from a web-based server. Clearly, I do not want the form to appear if I run this with students. Any advice? Sorry… I am must be denser than usual today…

  12. Profile photo of Andrew Lian
    Andrew Lian

    Hello John. I found the PDF you were talking about. I am not used to the various files on this BBS. It was actually not with the Lectora files. Anyway, I found it… sorry.

  13. Becky

    Hi, John –

    This should work with a go to action where a page opens in a new window, correct? We’ve got a 1-page course with a 1-page test; We want the test to be open side-by-side with the 1-page of content, but we’re getting an error “Unable to get property ‘LMSGetValue’ of undefined or null reference”

    Thanks in advance!

  14. Profile photo of John Blackmon
    John Blackmon Post author

    It sounds like you want to run some xAPI content along with a SCORM course. In that case, you should add the xAPI pages as an attachment, or just host them outside your LMS and launch it in a new window with a “Go To Web Address” action.

  15. Profile photo of Adam Truckenmiller
    Adam Truckenmiller

    Good morning John,

    We’re testing this idea with a Lectora course being housed outside of an LMS and instead in a web app such as SharePoint and having the course feed data to the Scorm Cloud that we are testing.

    Our difficulty is that we are not having any course data being fed to the LRS so my assumption is that maybe the information I’m providing in the launch file is not accurate.

    The basicuserid and password, are those the email and password that you use to log into the system with or do you input he Key and Secret information located under the Activity Providers tab?

    For the endpoint, is there a difference between the four LRS endpoints that Scorm Cloud provides? RIght now I have the launchpad linked to the first one labeled as SCorm Cloud. I see there is also Scorm Cloud (sandbox), My Realm and My Realm (sandbox).


  16. Profile photo of John Blackmon
    John Blackmon Post author

    Take a look at the PDF attached to this post, it provides some information specific to SCORM Cloud. Basically, yes, the ID and password are the app ID and secret key from SCORM cloud.

    On the end point, if you have created an application it will have its own specific end point. The sandbox is just that, it is the area you will use to test with before you have actual data in the LRS, as statements in the LRS are immutable, and you probably don’t want your test data mixed with your user data.

    1. Profile photo of Adam Truckenmiller
      Adam Truckenmiller

      You publish for xAPI instead of Web, correct?
      With testing we can’t seem to have the course communicate to Scorm Cloud or our current LRS. (We were testing with Scorm Cloud while we were waiting to hear back from our vendor what the app ID, PWD and end point are.

      To verify the actions are setup correctly, I republished and placed it into our LMS system. When I do that the xAPI statements are coming through on the LRS. So I’m not sure what I am doing incorrectly especially since I have received the correct information to be placed in the launcher.

  17. Profile photo of John Blackmon
    John Blackmon Post author

    Correct, you publish to xAPI. However, it still needs to be run from a Web server (any web server, doesn’t need to be an LMS) to have the privileges to load JSON and send statements. I think Firefox may allow it from a local file, but Chrome will require it to be run from a web server.

    1. Profile photo of Adam Truckenmiller
      Adam Truckenmiller

      Yes, I had the xAPI published course on a web server and tested the course in Chrome and IE. No luck so far.

  18. Profile photo of John Blackmon
    John Blackmon Post author

    We may be getting on the geeky side of things, but have you ever tried the Developer console on the browser? It may provide some clues as to why the statements are not going through.

    Hit the F12 button on the course window and look at the console tab while it is running and sending statements. It may shed some light on what the error is.

  19. Profile photo of Adam Truckenmiller
    Adam Truckenmiller

    Hi John,

    I downloaded the Launch file. After inputting the parameters, saving the XML file as an HTML, and opening it, the Launch.html opens up as a read style of HTML page. I’ve opened the launch file with Firefox, Chrome and Edge and it happens to all three.

    I have tried opening the XML file in Sublime text editor and also Notepad and saving the XML as an HTML but not matter what, the final output of the HTML file is giving me the read version in showing what I have input into the different parameters rather than showing a similar screen when first downloading the files where someone can input their email address.

    Any suggestions?

  20. Profile photo of John Blackmon
    John Blackmon Post author

    You mention you saved the XML file as an HTML file? You should just be putting the proper parameters in it and still saving as XML. It gets loaded by the launch.html file, which then loads your startup file, usually index.html

    1. Profile photo of Adam Truckenmiller
      Adam Truckenmiller

      My mistake you are correct. That fixed the issue. Now after I place my credentials in the fields such as the ID, password, activity ID and Endpoint and save the XML, the Launch.HTML still shows the text fields for those particular areas that need to be entered.

      I don’t recall having this issue in the past but maybe I’m missing something in order to have the text fields disappear in the HTML file.

  21. Profile photo of John Blackmon
    John Blackmon Post author

    If the fields have a value in the XML, then they shouldn’t be prompted for in the HTML. The issue may be that you are running from localhost, in which case the XML file can’t be loaded. When run from a web server, it will load properly.

    1. Profile photo of Adam Truckenmiller
      Adam Truckenmiller

      Thanks, that did the trick.
      After I added my API Key and Secret Key, from Yet Analytics to the BasicID and Username in the xml form I uploaded my xAPI course on my wordpress site. It seems like now it’s not sending any of the data to my sandbox in Yet Analytics.

      This piece may be unrelated to this particular thread but am I supposed to download a plugin, such as a specific LRS plug, in order to make where a course can communicate to the LRS? Sorry, placing an xAPI course on a WordPress site is new to me.

  22. Profile photo of John Blackmon
    John Blackmon Post author

    No, the course will communicate to the LRS directly, no plugins needed.

    You can check with Yet to see if they can shed some light on why it isn’t being stored, perhaps not a correct endpoint?

    1. Profile photo of Adam Truckenmiller
      Adam Truckenmiller

      Ended up being an LRS issue. For some odd reason my sandbox became unresponsive and had to open up a dashboard.

      Thanks for the help!

Your email address will not be published. Required fields are marked *