Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-46669

mod_scorm: GetValue adds quotes to string values, in 1.3 copy only

    XMLWordPrintable

Details

    • MOODLE_28_STABLE
    • MOODLE_28_STABLE
    • master_MDL-46669
    • Hide

      NOTE: There may/will be many other errors both JS and functional as we do not provide complete support for SCORM 2004 - this just fixes a regression caused by MDL-35870

      Show
      Load a SCORM v 1.3 which sets cmi.location, such as the basic calls sample at: http://scorm.com/wp-content/assets/golf_examples/PIFS/RuntimeBasicCalls_SCORM20043rdEdition.zip Open the scorm and click a few pages in the SCORM. Close the scorm When prompted, choose to save progress to resume later. Reopen it. When prompted if you wish to resume, choose yes The scorm should resume where you left off, rather than getting a 404 error or going to the first page. NOTE: There may/will be many other errors both JS and functional as we do not provide complete support for SCORM 2004 - this just fixes a regression caused by MDL-35870

    Description

      Calling SetValue("cmi.location", "bob"), then later getValue("cmi.location") will return "'bob'" - note the extra quotes added by scorm_empty() in the 1.3 version. This causes failures for example if the scorm sets the cmi.location to page2.html, it will try to navigate to site.com/scorm/'page2.html' . That will throw a 404 since the filename should not include quotes.

      This is a regression apparently caused by MDL-35870, separating js and php files. Checking out the immediately preceding commit and testing, the problem is not observed with the previous commit. Also, the function to add the quotation marks did not exist until MDL-35870.

      It may be worth noting that the SCORM 1.2 version does not call the function to add quotes to strings. It instead calls the function scorm_isset, which is identical except that it does not add quotes within values.

      Attachments

        Issue Links

          Activity

            People

              raymor Ray Morris
              raymor Ray Morris
              Dan Marsden Dan Marsden
              Damyon Wiese Damyon Wiese
              Andrew Davis Andrew Davis
              Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                10/Nov/14