Step 41 – SCO Data = Item Data + Resource Data

Finally, I’ll add the code which connects the item and resource data together to create the data that the “imaginary” LMS needs.

  // array for the results
  $SCOdata = array();

  // loop through the list of items
  foreach ($itemData as $identifier => $item) {

    // find the linked resource
    $identifierref = $item['identifierref'];
   
    // is the linked resource a SCO? if not, skip this item
    if (strtolower($resourceData[$identifierref]['scormtype']) != 'sco') { continue; }

    // save data that we want to the output array
    $SCOdata[$identifier]['title'] = $item['title'];
    $SCOdata[$identifier]['masteryscore'] = $item['masteryscore'];
    $SCOdata[$identifier]['datafromlms'] = $item['datafromlms'];
    $SCOdata[$identifier]['href'] = $resourceData[$identifierref]['href'];
    $SCOdata[$identifier]['files'] = $resourceData[$identifierref]['files'];

  }

Next post … I’ll run some tests, and post a full copy of the code for you to download if you want to try it out for yourself.

This entry was posted in Content Aggregation Model. Bookmark the permalink.

4 Responses to Step 41 – SCO Data = Item Data + Resource Data

  1. aarkerio says:

    Great document thanks, I’m sure you are helping a lot of people, I guess only left explain save and restore student navigation track.

  2. Steve Addison says:

    If only it were that simple! 🙂 There’s quite a lot left to look at including handling content package uploads, adding optional data elements to the RTE, error reporting in the RTE, performance issues …

  3. iscorm.cn says:

    great document!
    please tell me ,how to use the “data from lms”? tks

  4. Steve Addison says:

    Not sure I can help you there. According to the JCA Solutions website, it’s:

    optional; provides initialization data expected by the resources (SCO)

    Other than that, I can’t find much information about it.

Comments are closed.