Can not link directly to imsmanifest.xml

Can not link directly to imsmanifest.xml

от Jay S -
Number of replies: 5
In previoius versions of moodle, Instead of using a zip, we were linking directly to the imsmanifest file. This made content syncs easier. The file structure of a course looked like this:
  • content
    • m1
      • m1_t1
        • imsmanifest.xml

However in Moodle 1.8 When I add a SCORM package, it comes up with no course structure and an error message stating Sorry, the requested file could not be found. The page location in the main pane is to content/m1/m1_t1 but this doesn't really help.

Not sure what to do. I have checked all the posts and bugs.
In reply to Jay S

Re: Can not link directly to imsmanifest.xml

от sandra ridings -
Exactly same problem I am having! Hope someone can help..soon!!
In reply to sandra ridings

Re: Can not link directly to imsmanifest.xml

от Jay S -
We recently upgraded to 1.8.2+ and the problem persisted.

I have fixed the problem with adding an if statement. The change is located on line 635 of the mod/scorm/locallib.php file, within the scorm_parse function.

OLD:
$reference = $scorm->dir.'/'.$scorm->id;

NEW:
//Jason Shaw: The following if statement was added to allow the direct link to an internal imsmanifest file
if(basename($scorm->reference) == "imsmanifest.xml")
{
$reference = $CFG->dataroot.'/'.$scorm->course.'/'. $scorm->datadir;//Jason Shaw: Added for direct link to imsmanifes.xml
}else{
$reference = $scorm->dir.'/'.$scorm->id; //Jason Shaw: Default line
}
In reply to Jay S

Re: Can not link directly to imsmanifest.xml

от Jay S -
The above change effected external linking of imsmanifest files.

Checks for http:// and https:// has been added:

if(basename($scorm->reference) == "imsmanifest.xml" && strpos($scorm->reference,"http://") === false && strpos($scorm->reference,"https://") === false) //Jason Shaw: If else statment added
{
$reference = $CFG->dataroot.'/'.$scorm->course.'/'. $scorm->datadir;//Jason Shaw: Added for direct link to imsmanifes.xml
}else{
$reference = $scorm->dir.'/'.$scorm->id; //Jason Shaw: Default line
}
In reply to Jay S

Re: Can not link directly to imsmanifest.xml

от Rod Ward -

Jason,

Thank you so much for posting this fix!

I was having enormous problems with large Captivate SCORMs containing many quiz questions playing progressively slower and slower until they stalled the browser. I believe now that it was due to playing from a zipped SCORM.

Until I saw your fix here I didn't know that Moodle was supposed to allow the imsmanifest.xml file to be accessed other than in a zip file.

Now my SCORM lessons play fine!

You rock mate!!