Skip to content

Commit

Permalink
MDL-33523: Fixed item C of the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Darko Miletic committed Jun 14, 2012
1 parent 42642f6 commit 7547946
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions backup/cc/cc2moodle.php
Original file line number Diff line number Diff line change
Expand Up @@ -620,15 +620,23 @@ protected function create_instances ($items, $level = 0, &$array_index = 0, $ind
$array_index++;

if ($item->nodeName == "item") {
$identifierref = '';
if ($item->hasAttribute('identifierref')) {
$identifierref = $item->getAttribute('identifierref');
}

$identifierref = $xpath->query('@identifierref', $item);
$identifierref = !empty($identifierref->item(0)->nodeValue) ? $identifierref->item(0)->nodeValue : '';

$title = $xpath->query('imscc:title', $item);
$title = !empty($title->item(0)->nodeValue) ? $title->item(0)->nodeValue : '';
$title = '';
$titles = $xpath->query('imscc:title', $item);
if ($titles->length > 0) {
$title = $titles->item(0)->nodeValue;
}

$cc_type = $this->get_item_cc_type($identifierref);
$moodle_type = $this->convert_to_moodle_type($cc_type);
//Fix the label issue - MDL-33523
if (empty($identifierref) && empty($title)) {
$moodle_type = TYPE_UNKNOWN;
}
}
elseif ($item->nodeName == "resource") {

Expand Down

0 comments on commit 7547946

Please sign in to comment.