Step 40 – Reading the Items List

At last, an easy bit. I’m going to add the following code to my readIMSManifestFile() function.

  // array to store the results
  $itemData = array();

  // get the list of item elements
  $itemList = $xmlfile->getElementsByTagName('item');

  $i = 0;
  foreach ($itemList as $itemp) {

    // decode the item attributes and sub-elements
    $identifier = $itemList->item($i)->getAttribute('identifier');
    $itemData[$identifier]['identifierref'] = $itemList->item($i)->getAttribute('identifierref');
    $itemData[$identifier]['title'] = $itemList->item($i)->getElementsByTagName('title')->item(0)->nodeValue;
    $itemData[$identifier]['masteryscore'] = $itemList->item($i)->getElementsByTagNameNS($adlcp,'masteryscore')->item(0)->nodeValue;
    $itemData[$identifier]['datafromlms'] = $itemList->item($i)->getElementsByTagNameNS($adlcp,'datafromlms')->item(0)->nodeValue;

    $i++;

  }

This will read the item data from the manifest file into a new array called $itemData. Next step … combine the resource and item data to give me the information that I need for my “imaginary” LMS.

Be Sociable, Share!
This entry was posted in Content Aggregation Model. Bookmark the permalink.

2 Responses to Step 40 – Reading the Items List

  1. jwandr1 says:

    Is your project finished? Do you have a download for the complete code? I downloaded the vsscorm_rte12_1_0, but after reading further it looks like that is incomplete. Please correct me if I am wrong.

    Thank you.

  2. Steve Addison says:

    It depends on what you mean by ‘complete’. VSSCORM is simply a record of my own investigations into the SCORM 1.2 standard, and I don’t have a formal set of requirements that I’m working towards which would signify that the project is finished. Nevertheless …

    The Run-Time-Environment (RTE) part of the project is complete insofar as you can integrate it with an existing LMS, and run a SCORM 1.2 format course. In fact, I currently have an LMS incorporating this code that’s running successfully for a number of clients. Also, the VSSCORM RTE only supports the mandatory data elements – I may return to the project and add in more of the optional elements at some later date – and it certainly isn’t a standalone LMS.

    The Content Aggregation Model (CAM) part of the project is not yet complete, and I haven’t released any code yet. If tests go well, I plan to release some sample code next week for people to look at.

Leave a Reply

Your email address will not be published. Required fields are marked *