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

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



    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.5
    • 2.0
    • SCORM
    • None
    • Moodle 1.8.5, XAMPP 1.6.6 on Windows
    • MySQL


      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
      // 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'}

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



      } 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


        Issue Links



              piers Piers Harding
              martin_holden@skillsoft.com Martin Holden
              Dan Marsden Dan Marsden
              Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              0 Vote for this issue
              2 Start watching this issue