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

    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      master_MDL-46669

      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

              Assignee:
              raymor Ray Morris
              Reporter:
              raymor Ray Morris
              Peer reviewer:
              Dan Marsden
              Integrator:
              Damyon Wiese
              Tester:
              Andrew Davis
              Participants:
              Component watchers:
              Damyon Wiese, Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Nov/14