Code Duplication    Length = 13-13 lines in 2 locations

main/newscorm/learnpath.class.php 2 locations

@@ 9431-9443 (lines=13) @@
9428
                        $my_item->appendChild($my_masteryscore);
9429
9430
                        // Attach this item to the organization element or its parent if there is one.
9431
                        if (!empty($item->parent) && $item->parent != 0) {
9432
                            $children = $organization->childNodes;
9433
                            for ($i = 0; $i < $children->length; $i++) {
9434
                                $item_temp = $children->item($i);
9435
                                if ($item_temp -> nodeName == 'item') {
9436
                                    if ($item_temp->getAttribute('identifier') == 'ITEM_'.$item->parent) {
9437
                                        $item_temp -> appendChild($my_item);
9438
                                    }
9439
                                }
9440
                            }
9441
                        } else {
9442
                            $organization->appendChild($my_item);
9443
                        }
9444
9445
                        $my_file_path = 'link_'.$item->get_id().'.html';
9446
                        $sql = 'SELECT url, title FROM '.Database :: get_course_table(TABLE_LINK).'
@@ 9495-9507 (lines=13) @@
9492
                        $my_item->appendChild($my_masteryscore);
9493
9494
                        // Attach this item to the organization element or hits parent if there is one.
9495
                        if (!empty($item->parent) && $item->parent != 0) {
9496
                            $children = $organization->childNodes;
9497
                            for ($i = 0; $i < $children->length; $i++) {
9498
                                $item_temp = $children->item($i);
9499
                                if ($item_temp -> nodeName == 'item') {
9500
                                    if ($item_temp->getAttribute('identifier') == 'ITEM_'.$item->parent) {
9501
                                        $item_temp -> appendChild($my_item);
9502
                                    }
9503
                                }
9504
                            }
9505
                        } else {
9506
                            $organization->appendChild($my_item);
9507
                        }
9508
9509
                        // Get the path of the file(s) from the course directory root
9510
                        //$my_file_path = $item->get_file_path('scorm/'.$this->path.'/');