Modifying contents of an xAPI package?

Nov 29, 2019

I am currently working in a lightweight LMS that reads xAPI packages. I built coursework in Arabic in Rise 360 and wanted to use a html code workaround to create right to left language compliance, which is a very simple and small code adjustment to the index.html file in the package. So I opened the zipfile, made the code change, and rezipped the package.

When I then uploaded the package to my LMS, the package was unreadable. At first I thought the code change was doing this, but then I did an experiment. I exported the same course from Rise 360 as an xAPI package, unzipped it, changed nothing, and then rezipped it and uploaded it to my LMS, and got the same result: the package was unreadable, leading me to believe it has nothing to do with the html code change, but rather the act of unzipping the package, and rezipping it, does something to it that I don't understand and renders it unreadable.

Honestly I don't know enough about the architecture of xAPI to understand on my own which end the issue is coming from, my LMS or the way Rise exports xAPIs. Any insight would be wonderful.

2 Replies
Sam Williamson

How are you re-compressing the folder? I would guess what's going wrong is that during the process you're unwittingly introducing a superfluous 'container' layer, and as your LMS isn't immediately seeing the file structure it's expecting it flags the package as invalid.

To give an example, let's say we start with this file hierarchy for your package:

  • Zipped Folder
    • Content A
    • Content B
       

We then unzip this to:

  • Unzipped Folder
    • Content A
    • Content B
       

Same structure, right? However, if we then try to re-compress 'Unzipped Folder' we end up with this:

  • Newly Zipped Folder
    • Unzipped Folder
      • Content A
      • Content B

If you try to zip a folder – at least using Windows built-in functionality – it'll wrap said folder in a zipped container rather than just zipping the folder itself.

The way around this is to select all of the contents of the folder you want to compress – 'Content A' and 'Content B', in this example – and then zip that. Essentially you're manually removing a layer of folder hierarchy because you know the zipping process will reintroduce one.

Not the best explanation, but hopefully that helps.

This discussion is closed. You can start a new discussion or contact Articulate Support.