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

AICC Tracking Issues (SkillSoft content and others utilising multi line suspend data)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.5
    • Fix Version/s: 2.0
    • Component/s: SCORM
    • Labels:
      None
    • Environment:
      Moodle 1.8.5, XAMPP 1.6.6 on Windows
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      I have identified a number of issues in the file mod/scorm/aicc.php that when fixed improve the conformance and support for SkillSoft content and others.

      The bugs include:

      1. Response format as text/plain not HTML and prevention of caching. These are achieved by adding these headers to file after <?PHP opening tag:

      //Martin Holden, SkillSoft - Added headers to ensure response is plain text NOT html and prevent caching
      //21st April 2008
      //
      //Content Type Header
      header("Content-type: text/plain");
      //Prevent Caching Headers
      header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
      header("Cache-Control: no-cache");
      header("Pragma: no-cache");
      // END

      2. Added reference to aicclib.php so that relaunches of content correctly track time

      //Martin Holden, SkillSoft - Added reference to AICCLIB otherwise session time calls to scorm_add_time in EXITAU fail
      //21st April 2008
      //
      require_once('datamodels/aicclib.php');
      // END

      NOTE: This will resolve this bug MDL-12281, MDL-10746

      3. Added code to stripslashes and encode [Suspend_Data] to improve handling of characters such as linefeeds that cause javascript bug on relaunch:

      if (isset($datamodel[strtolower(trim($datarow))])) {
      $element = $datamodel[strtolower(trim($datarow))];
      $value = '';
      while ((($datarow = current($datarows)) !== false) && (substr($datarow,0,1) != '['))

      { $value .= $datarow; next($datarows); }

      //Martin Holden, SkillSoft
      //Remove slashes and urlencode the data
      //23rd April 2008
      //
      $value = rawurlencode(stripslashes($value));
      // END
      $id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $element, $value);
      }

      Corresponding change in GETPARAM response:

      if (isset($userdata->

      {'cmi.suspend_data'})) {
      //Martin Holden, SkillSoft - URLDecode output we stored
      //21st April 2008
      //
      //echo "[Core_Lesson]\n".$userdata->{'cmi.suspend_data'}

      ."\n";
      echo "[Core_Lesson]\n".rawurldecode($userdata->

      {'cmi.suspend_data'}

      )."\n";
      //

      } else

      { echo "[Core_Lesson]\n"."\n"; }

      4. Modification of all error = X, and error_text = x to bring in line with AICC requirements of no spaces around = sign. So global replace of error = x to error=x

      5. Modification to GETPARAM aicc_data parameter to again bring in line with AICC conformance requiring no NEW LINE between aicc_data= and [Core].

      //Martin Holden, SkillSoft - Remove linefeed between aicc_data= and [core] as per AICC guidelines
      //21st April 2008
      //
      // echo "error=0\nerror_text=Successful\naicc_data=\n";
      //
      echo "error=0\nerror_text=Successful\naicc_data=";
      // END

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  24/Nov/10