overhangio / openedx-scorm-xblock

SCORM XBlock for Open edX
GNU Affero General Public License v3.0
37 stars 46 forks source link

Where is "Unable to launch course" error coming from? #60

Closed jesperhodge closed 6 months ago

jesperhodge commented 7 months ago

Context

Hi everyone,

I'm on the TNL team at 2U and we're having a weird error when trying to use the SCORM files provided by Linux Foundation. We are having trouble figuring out whether the error is something on the SCORM xblock side or some bug in their zip file / on their side, or both.

The zip file works in a test setup (https://github.com/frumbert/scorm_debug), and presumably in other LMS, so it appears like a problem specific to openedx.

We would be very grateful for your support, this has very high value for us.

Goal for this ticket

Of course somehow fixing this bug would be ideal, but the really big step towards that is to discover what causes this bug. That would allow us to work on a fix or handing this back to Linux Foundation. So - Is there something wrong in the scorm xblock or edx-platform? Is there a bug in the SCORM zip file's JS code? Is it a weird integration problem, and what's the nature of that?

We haven't been able to figure it out on our own so far and hope your expertise with the scorm xblock can help.

Error description

If you add the provided sample file to any test course on prod, the block first loads successfully, and even makes some successful calls to the SCORM API. However, it then produces a popup as in the screenshot and will fail to load further. There was no console output that I could clearly link to the error.

Screenshot 2024-01-12 at 3 08 33 PM

Debugging

Local debugging was not possible for me because the block doesn't work locally or on stage at all. The reason is that it includes query parameters in the URL in the top-level href of the imsmanifest.xml file and django setup for local static assets cannot handle this. However, the prod setup uploads the SCORM zip file to AWS I think, and does not have this problem. You can see from following console output that the required resources all successfully load, so the error should not be directly linked to any problem with query parameters.

Also there's some randomness to this bug: One time on prod, I somehow managed to open the test course, uploaded my test file, and it just worked, but then when I refreshed it stopped working. I had not done anything different at all.

Sample file

This is the sample zip file from Linux foundation I have tested with. We have obtained permission to publicly share this sample so I can provide it in this issue.

edx-test-course-scorm-connect--scorm-test-pano--edXSCORMcourses--scorm-2004.zip

Contact

Please reach out to me anytime via openedx slack (Jesper Hodge) or email (jhodge@2u.com) - this is of high interest to us and I'll be readily available for any questions or support. You can also reach out to TNL.

ziafazal commented 7 months ago

Hi @jesperhodge, It appears couple of things cans cause this issue.

  1. Query params are not being passed to scorm content provider(Linuxfoundation)
  2. There might be some sort of host white listing is needed

I'm trying to debug it locally could you please check if I need to white list my localhost (http://studio.local.edly.io:8001) on https://trainingportal.linuxfoundation.org to successfully render SCORM content?

jesperhodge commented 7 months ago

Hi @ziafazal , thank you so much for making the fix! That was a really quick response.

The upside is that it allows me to now test the bug locally. (You don't need to whitelist your localhost.)

So I tested this by upgrading to the latest version of openedx-scorm in local devstack. The block now loaded, but threw this error popup that I screen shotted in the error description.

I also retested the scorm block that I sent you in the ticket description with a scorm testing environment (https://github.com/frumbert/scorm_debug), where it worked.

So there's clearly something weird going on where the block works in the testing environment but not on edx-platform.

I'm sending you two screen captures of 1. testing this locally with the updated scorm xblock in edx-platform (shows error) and 2. testing this with the scorm testing environment (where it works).

Do you have an idea what could cause this problem? Do you also encounter the same error when you test yourself with the scorm xblock?

https://github.com/overhangio/openedx-scorm-xblock/assets/19345795/d39e799a-1672-4d88-8073-db09ed76f557

https://github.com/overhangio/openedx-scorm-xblock/assets/19345795/2e0a8e1c-a781-4116-97f3-cd224a862de2

ziafazal commented 7 months ago

Hi @jesperhodge

Thanks for sharing screenshots. It appears the issue is definitely related to domain/host from where SCORM content is being served. If I play that scorm package you shared from studio.local.edly.io it does not play and gets stuck whereas if I play it from localhost it renders fine. see attached screen recording.

https://github.com/overhangio/openedx-scorm-xblock/assets/434995/28565189-2375-41c8-8780-cbc5882e433d

jesperhodge commented 7 months ago

@ziafazal Oh, interesting. Thanks again so much for the prompt response. - I realize I was also running this testing environment from a different machine than the devstack tests, for ease of setup, so that explains it.

Looks like this answers the question about the bug. We should be able to go from here. I'll keep you updated but I expect we can sort it out on our end or our partner on their end.

Again, many thanks!!

regisb commented 6 months ago

I believe we can close this issue, right?