Moodle

SCORM Activity Redirect Failure

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.9.2
  • Fix Version/s: 1.9.3
  • Component/s: SCORM
  • Labels:
    None
  • Environment:
    Windows XP SP3
    Apache 2.2
    MySQL 5

Description

Inside our validated SCORM 1.2 package manifest file I have:
<item identifier="MC1" identifierref="C1" parameters="?page=C001%2FPage001.htm"> and later...
<resource identifier="C1" type="webcontent" adlcp:scormtype="sco" xml:base="M2581402/C001/" href="../../system/html/LJ_SCO_Wrapper.htm">

As of Moodle 1.9.2 a new countdown timer appears before loading the first SCORM activity, which then displays a 'file not found' page on request:
GET /file.php/1/moddata/scorm/79/system/html/LJ_SCO_Wrapper.htm%3Fpage%3DC001%252FPage001.htm HTTP/1.1

The already URL-escaped "href" and "parameters" attributes from imsmanifest.xml appear to have been escaped a second time.

The actual GET request URL should be:
GET /file.php/1/moddata/scorm/79/system/html/LJ_SCO_Wrapper.htm?page=C001/Page001.htm HTTP/1.1

This issue prevents our customers from using our SCORM packages in the latest stable weekly build.

An example SCORM 1.2 package demonstrating this issue is available at:
http://download.ljgroup.com/users/SCORM/M2581402.zip (51Mb)

Issue Links

Activity

Hide
Dan Marsden added a comment -

Thanks for the report Peter! - Piers, can you please check this out asap?

thanks!

Dan

Show
Dan Marsden added a comment - Thanks for the report Peter! - Piers, can you please check this out asap? thanks! Dan
Hide
Dan Marsden added a comment -

linking tracker item that caused this,

Show
Dan Marsden added a comment - linking tracker item that caused this,
Hide
Martin Holden added a comment -

I dont think the change to the delay is the issue, I think it could be this earlier change in how the URL is formed:

Show
Martin Holden added a comment - I dont think the change to the delay is the issue, I think it could be this earlier change in how the URL is formed:
Hide
Dan Marsden added a comment -

Thanks Martin - I had a look at the commit for the delay too, and couldn't see anywhere in that commit that would cause it! - good spotting!

Piers is going to have a look asap.

Dan

Show
Dan Marsden added a comment - Thanks Martin - I had a look at the commit for the delay too, and couldn't see anywhere in that commit that would cause it! - good spotting! Piers is going to have a look asap. Dan
Hide
Piers Harding added a comment -

Hi -

I have tried the linked to test package and get a different problem with this, than the one discussed in the forum - as I am using Linux, there is a case sensitive filesystem problem with some of the asset names like /moodle19/file.php/2/moddata/scorm/30/M2581402/Theme/System/Styles/SymbolStyle.css where the directories are theme/system/styles.

Following on from the example http://moodle/file.php/127/moddata/scorm/331/mlscorm.htm%3Fcrs_acro%3DcourseAcronym%26site_id%3DcompanyCode - I have found that the file.php lib doesn't expect there to be any query_string parameters on the filenames that it gets passed, so naturally that file wont exist.

I have attached a hack that shows a work for emergency purposes around but this is a core library and therefore a proper solution needs to be determined.

Cheers,
Piers Harding.

Show
Piers Harding added a comment - Hi - I have tried the linked to test package and get a different problem with this, than the one discussed in the forum - as I am using Linux, there is a case sensitive filesystem problem with some of the asset names like /moodle19/file.php/2/moddata/scorm/30/M2581402/Theme/System/Styles/SymbolStyle.css where the directories are theme/system/styles. Following on from the example http://moodle/file.php/127/moddata/scorm/331/mlscorm.htm%3Fcrs_acro%3DcourseAcronym%26site_id%3DcompanyCode - I have found that the file.php lib doesn't expect there to be any query_string parameters on the filenames that it gets passed, so naturally that file wont exist. I have attached a hack that shows a work for emergency purposes around but this is a core library and therefore a proper solution needs to be determined. Cheers, Piers Harding.
Hide
Piers Harding added a comment -

MDL-16060-moodle19.patch is a Temporary work around for URIs that have query string parameters.

Show
Piers Harding added a comment - MDL-16060-moodle19.patch is a Temporary work around for URIs that have query string parameters.
Hide
Peter Chamberlin added a comment -

I created an algorithm to recursively update the links so that they are case sensitive, however, it seems that it has missed out at least one of them. I will investigate this and update the test package on Monday. Thanks for pointing that out, Piers.

Show
Peter Chamberlin added a comment - I created an algorithm to recursively update the links so that they are case sensitive, however, it seems that it has missed out at least one of them. I will investigate this and update the test package on Monday. Thanks for pointing that out, Piers.
Hide
Piers Harding added a comment -

OK - to recap on this problem - after the weekend.

SCORM packages have links to static resources that also include query_string parameters - presumably these query_string parameters are needed by the JS, or Flash or other active content to make them work, so they cannot be simply stripped off of the links as they are put into the SCORM player. Further to this - within the remaining content of a SCORM package there could be any number of URIs that point to static content that is to be served up from within Moodle that also have query string parameters.

What I think is required is for the generic file serving handler (file.php) to check to see if there are any query string parameters on the URI and strip them off before it checks for the files existence and then attempts to serve the file. This is what I have shown in the quick patch attached that demonstrates the problem.

This needs further investigation by the core team, as there maybe other edge cases in other modules/parts of Moodle that are affected by this.

Cheers,
Piers Harding.

Show
Piers Harding added a comment - OK - to recap on this problem - after the weekend. SCORM packages have links to static resources that also include query_string parameters - presumably these query_string parameters are needed by the JS, or Flash or other active content to make them work, so they cannot be simply stripped off of the links as they are put into the SCORM player. Further to this - within the remaining content of a SCORM package there could be any number of URIs that point to static content that is to be served up from within Moodle that also have query string parameters. What I think is required is for the generic file serving handler (file.php) to check to see if there are any query string parameters on the URI and strip them off before it checks for the files existence and then attempts to serve the file. This is what I have shown in the quick patch attached that demonstrates the problem. This needs further investigation by the core team, as there maybe other edge cases in other modules/parts of Moodle that are affected by this. Cheers, Piers Harding.
Hide
Dan Marsden added a comment -

adding Petr and Eloy to this bug - as mentioned in HQ chat - it would be really good if we could fix this regression before the next weekly build. - a lot of people are upgrading their installs due to the other scorm related fixes that have gone in, and are finding that their objects are broken due to the way core filelib functions have changed the way they handle querystring params.

We wondered if MDL-14279 might have been the patch that affected this. - Mathieu started to have a look at it yesterday.

thanks,

Dan

Show
Dan Marsden added a comment - adding Petr and Eloy to this bug - as mentioned in HQ chat - it would be really good if we could fix this regression before the next weekly build. - a lot of people are upgrading their installs due to the other scorm related fixes that have gone in, and are finding that their objects are broken due to the way core filelib functions have changed the way they handle querystring params. We wondered if MDL-14279 might have been the patch that affected this. - Mathieu started to have a look at it yesterday. thanks, Dan
Hide
Dan Marsden added a comment -
Show
Dan Marsden added a comment - partial discussion here: http://moodle.org/mod/forum/discuss.php?d=103502
Hide
Petr Škoda (skodak) added a comment -

the file.php patch above is not a solution and can not go into cvs, sorry
working on a fix...

Show
Petr Škoda (skodak) added a comment - the file.php patch above is not a solution and can not go into cvs, sorry working on a fix...
Hide
Petr Škoda (skodak) added a comment -

I hope it is fixed now, I have reverted the use of the get_file_url() because it was not intended for this. I have also removed the "file.php?file=" option - scorm does not work without slash arguments enabled because it needs relative links.

Please test and reopen if needed.

Thanks!

Show
Petr Škoda (skodak) added a comment - I hope it is fixed now, I have reverted the use of the get_file_url() because it was not intended for this. I have also removed the "file.php?file=" option - scorm does not work without slash arguments enabled because it needs relative links. Please test and reopen if needed. Thanks!
Hide
Chuck Griess added a comment -

I applied the Patch, but I am still not able to launch the files from MindLeaders. Pre patch I was receiving a 404 error now it is launching the file. The variables added to the end of the URL are still being converted to ? becomes %3F, = becomes %3D and & becomes %26. Because of this the MindLeader server does not recognize what course to serve and which customer is launching the file.

Show
Chuck Griess added a comment - I applied the Patch, but I am still not able to launch the files from MindLeaders. Pre patch I was receiving a 404 error now it is launching the file. The variables added to the end of the URL are still being converted to ? becomes %3F, = becomes %3D and & becomes %26. Because of this the MindLeader server does not recognize what course to serve and which customer is launching the file.
Hide
Dan Marsden added a comment -

Hi Chuck - the patch Petr has applied that should fix this is quite different from the one Piers attached. - it's now in CVS but it may take a couple of hours for the public cvs mirrors to catch up. The Weekly build on download.moodle.org will be updated in a couple of days, otherwise you can use the diff here:
http://cvs.moodle.org/moodle/mod/scorm/loadSCO.php?r1=1.41&r2=1.42

thanks,

Dan

Show
Dan Marsden added a comment - Hi Chuck - the patch Petr has applied that should fix this is quite different from the one Piers attached. - it's now in CVS but it may take a couple of hours for the public cvs mirrors to catch up. The Weekly build on download.moodle.org will be updated in a couple of days, otherwise you can use the diff here: http://cvs.moodle.org/moodle/mod/scorm/loadSCO.php?r1=1.41&r2=1.42 thanks, Dan
Hide
Mathieu Petit-Clair added a comment -

Reviewed & closed. Thanks for the patch - sorry for this problem.

Show
Mathieu Petit-Clair added a comment - Reviewed & closed. Thanks for the patch - sorry for this problem.

Dates

  • Created:
    Updated:
    Resolved: