ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSCORM2004Node.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2008 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 require_once("./Services/MetaData/classes/class.ilMDLanguageItem.php");
25 
37 {
38  var $slm_id;
39  var $type;
40  var $id;
42 
46  function ilSCORM2004Node($a_slm_object, $a_id = 0)
47  {
48  $this->id = $a_id;
49  $this->setSLMObject($a_slm_object);
50  $this->setSLMId($a_slm_object->getId());
51 
52  $this->tree = new ilTree($a_slm_object->getId());
53  $this->tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
54  $this->tree->setTreeTablePK("slm_id");
55 
56  if($a_id != 0)
57  {
58  $this->read();
59  }
60  }
61 
67  function setTitle($a_title)
68  {
69  $this->title = $a_title;
70  }
71 
77  function getTitle()
78  {
79  return $this->title;
80  }
81 
87  function setDescription($a_description)
88  {
89  $this->description = $a_description;
90  }
91 
97  function getDescription()
98  {
99  return $this->description;
100  }
101 
107  function setType($a_type)
108  {
109  $this->type = $a_type;
110  }
111 
117  function getType()
118  {
119  return $this->type;
120  }
121 
127  function setSLMId($a_slm_id)
128  {
129  $this->slm_id = $a_slm_id;
130 
131  }
132 
138  function getSLMId()
139  {
140  return $this->slm_id;
141  }
142 
148  function setSLMObject($a_slm_obj)
149  {
150  $this->slm_object = $a_slm_obj;
151  }
152 
158  function getSLMObject()
159  {
160  return $this->slm_object;
161  }
162 
168  function getContentObject()
169  {
170  return $this->slm_object;
171  }
172 
178  function setId($a_id)
179  {
180  $this->id = $a_id;
181  }
182 
188  function getId()
189  {
190  return $this->id;
191  }
192 
198  function getImportId()
199  {
200  return $this->import_id;
201  }
202 
208  function setImportId($a_id)
209  {
210  $this->import_id = $a_id;
211  }
212 
216  function read()
217  {
218  global $ilBench, $ilDB;
219 
220  if(!isset($this->data_record))
221  {
222  $query = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = ".
223  $ilDB->quote($this->id, "integer");
224  $obj_set = $ilDB->query($query);
225  $this->data_record = $ilDB->fetchAssoc($obj_set);
226  }
227 
228  $this->type = $this->data_record["type"];
229  $this->setImportId($this->data_record["import_id"]);
230  $this->setTitle($this->data_record["title"]);
231  }
232 
244  function MDUpdateListener($a_element)
245  {
246  include_once 'Services/MetaData/classes/class.ilMD.php';
247 
248  switch($a_element)
249  {
250  case 'General':
251 
252  // Update Title and description
253  $md = new ilMD($this->getSLMId(), $this->getId(), $this->getType());
254  $md_gen = $md->getGeneral();
255 
256  ilSCORM2004Node::_writeTitle($this->getId(), $md_gen->getTitle());
257 
258  foreach($md_gen->getDescriptionIds() as $id)
259  {
260  $md_des = $md_gen->getDescription($id);
261 // ilLMObject::_writeDescription($this->getId(),$md_des->getDescription());
262  break;
263  }
264 
265  break;
266 
267  default:
268  }
269  return true;
270  }
271 
272 
276  function createMetaData()
277  {
278  global $ilUser;
279 
280  include_once 'Services/MetaData/classes/class.ilMDCreator.php';
281  $md_creator = new ilMDCreator($this->getSLMId(), $this->getId(), $this->getType());
282  $md_creator->setTitle($this->getTitle());
283  $md_creator->setTitleLanguage($ilUser->getPref('language'));
284  $md_creator->setDescription($this->getDescription());
285  $md_creator->setDescriptionLanguage($ilUser->getPref('language'));
286  $md_creator->setKeywordLanguage($ilUser->getPref('language'));
287  $md_creator->setLanguage($ilUser->getPref('language'));
288  $md_creator->create();
289 
290  return true;
291  }
292 
296  function updateMetaData()
297  {
298  include_once("Services/MetaData/classes/class.ilMD.php");
299  include_once("Services/MetaData/classes/class.ilMDGeneral.php");
300  include_once("Services/MetaData/classes/class.ilMDDescription.php");
301 
302  $md = new ilMD($this->getSLMId(), $this->getId(), $this->getType());
303  $md_gen = $md->getGeneral();
304  $md_gen->setTitle($this->getTitle());
305 
306  // sets first description
307  $md_des_ids = $md_gen->getDescriptionIds();
308  if (count($md_des_ids) > 0)
309  {
310  $md_des =& $md_gen->getDescription($md_des_ids[0]);
311 // $md_des->setDescription($this->getDescription());
312  $md_des->update();
313  }
314  $md_gen->update();
315  }
316 
317 
321  function deleteMetaData()
322  {
323  // Delete meta data
324  include_once('Services/MetaData/classes/class.ilMD.php');
325  $md = new ilMD($this->getSLMId(), $this->getId(), $this->getType());
326  $md->deleteAll();
327  }
328 
332  function setDataRecord($a_record)
333  {
334  $this->data_record = $a_record;
335  }
336 
343  static function _lookupTitle($a_obj_id)
344  {
345  global $ilDB;
346 
347  $query = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = ".
348  $ilDB->quote($a_obj_id, "integer");
349  $obj_set = $ilDB->query($query);
350  $obj_rec = $ilDB->fetchAssoc($obj_set);
351 
352  return $obj_rec["title"];
353  }
354 
361  static function _lookupType($a_obj_id)
362  {
363  global $ilDB;
364 
365  $query = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = ".
366  $ilDB->quote($a_obj_id, "integer");
367  $obj_set = $ilDB->query($query);
368  $obj_rec = $ilDB->fetchAssoc($obj_set);
369 
370  return $obj_rec["type"];
371  }
372 
379  static function _writeTitle($a_obj_id, $a_title)
380  {
381  global $ilDB;
382 
383  $query = "UPDATE sahs_sc13_tree_node SET ".
384  " title = ".$ilDB->quote($a_title, "text").
385  " WHERE obj_id = ".$ilDB->quote($a_obj_id, "integer");
386  $ilDB->manipulate($query);
387  }
388 
395  static function _writeImportId($a_id, $a_import_id)
396  {
397  global $ilDB;
398 
399  $q = "UPDATE sahs_sc13_tree_node ".
400  "SET ".
401  "import_id = ".$ilDB->quote($a_import_id, "text").",".
402  "last_update = ".$ilDB->now().
403  "WHERE obj_id = ".$ilDB->quote($a_id, "integer");
404 
405  $ilDB->manipulate($q);
406  }
407 
413  function create($a_upload = false)
414  {
415  global $ilDB;
416 
417  // insert object data
418  $id = $ilDB->nextId("sahs_sc13_tree_node");
419  $query = "INSERT INTO sahs_sc13_tree_node (obj_id, title, type, slm_id, import_id, create_date) ".
420  "VALUES (".
421  $ilDB->quote($id, "integer").",".
422  $ilDB->quote($this->getTitle(), "text").",".
423  $ilDB->quote($this->getType(), "text").", ".
424  $ilDB->quote($this->getSLMId(), "integer").",".
425  $ilDB->quote($this->getImportId(), "text").
426  ", ".$ilDB->now().")";
427  $ilDB->manipulate($query);
428  $this->setId($id);
429 
430  if (!$a_upload)
431  {
432  $this->createMetaData();
433  }
434  }
435 
439  function update()
440  {
441  global $ilDB;
442 
443  $this->updateMetaData();
444 
445  $query = "UPDATE sahs_sc13_tree_node SET ".
446  " slm_id = ".$ilDB->quote($this->getSLMId(), "integer").
447  " ,title = ".$ilDB->quote($this->getTitle(), "text").
448  " WHERE obj_id = ".$ilDB->quote($this->getId(), "integer");
449 
450  $ilDB->manipulate($query);
451  }
452 
456  function delete()
457  {
458  global $ilDB;
459 
460  $query = "DELETE FROM sahs_sc13_tree_node WHERE obj_id= ".
461  $ilDB->quote($this->getId(), "integer");
462  $ilDB->manipulate($query);
463 
464  $this->deleteMetaData();
465  }
466 
478  function _getIdForImportId($a_import_id)
479  {
480  global $ilDB;
481 
482  $ilDB->setLimit(1);
483  $q = "SELECT * FROM sahs_sc13_tree_node WHERE import_id = ".
484  $ilDB->quote($a_import_id, "text")." ".
485  " ORDER BY create_date DESC";
486  $obj_set = $ilDB->query($q);
487  while ($obj_rec = $ilDB->fetchAssoc($obj_set))
488  {
489  $slm_id = ilSCORM2004Node::_lookupSLMID($obj_rec["obj_id"]);
490 
491  // link only in learning module, that is not trashed
493  {
494  return $obj_rec["obj_id"];
495  }
496  }
497 
498  return 0;
499  }
500 
508  function _exists($a_id)
509  {
510  global $ilDB;
511 
512  include_once("./Services/COPage/classes/class.ilInternalLink.php");
513  if (is_int(strpos($a_id, "_")))
514  {
516  }
517 
518  $q = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = ".
519  $ilDB->quote($a_id, "integer");
520  $obj_set = $ilDB->query($q);
521  if ($obj_rec = $ilDB->fetchAssoc($obj_set))
522  {
523  return true;
524  }
525  else
526  {
527  return false;
528  }
529 
530  }
531 
532 
538  function _deleteAllSLMNodes($a_slm_object)
539  {
540  global $ilDB;
541 
542  $query = "SELECT * FROM sahs_sc13_tree_node ".
543  "WHERE slm_id = ".$ilDB->quote($a_slm_object->getId(), "integer")." ";
544  $obj_set = $ilDB->query($query);
545 
546  require_once("./Modules/LearningModule/classes/class.ilScorm2004NodeFactory.php");
547  while($obj_rec = $ilDB->fetchAssoc($obj_set))
548  {
549  $node_obj = ilSCORM2004NodeFactory::getInstance($a_slm_object, $obj_rec["obj_id"],false);
550 
551  if (is_object($node_obj))
552  {
553  $node_obj->delete();
554  }
555  }
556 
557  return true;
558  }
559 
563  function _lookupSLMID($a_id)
564  {
565  global $ilDB;
566 
567  $query = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = ".
568  $ilDB->quote($a_id, "integer")."";
569  $obj_set = $ilDB->query($query);
570  $obj_rec = $ilDB->fetchAssoc($obj_set);
571 
572  return $obj_rec["slm_id"];
573  }
574 
578  static function putInTree($a_obj, $a_parent_id = "", $a_target_node_id = "")
579  {
580  $tree =& new ilTree($a_obj->getSLMId());
581  $tree->setTreeTablePK("slm_id");
582  $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
583 
584  // determine parent
585  $parent_id = ($a_parent_id != "")
586  ? $a_parent_id
587  : $tree->getRootId();
588 
589  // determine target
590  if ($a_target_node_id != "")
591  {
592  $target = $a_target_node_id;
593  }
594  else
595  {
596  // determine last child that serves as predecessor
597  $childs =& $tree->getChilds($parent_id);
598 
599  if (count($childs) == 0)
600  {
601  $target = IL_FIRST_NODE;
602  }
603  else
604  {
605  $target = $childs[count($childs) - 1]["obj_id"];
606  }
607  }
608 
609  if ($tree->isInTree($parent_id) && !$tree->isInTree($a_obj->getId()))
610  {
611  $tree->insertNode($a_obj->getId(), $parent_id, $target);
612  }
613  }
614 
622  static function getTree($a_slm_obj_id)
623  {
624  $tree = new ilTree($a_slm_obj_id);
625  $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
626  $tree->setTreeTablePK("slm_id");
627  $tree->readRootId();
628 
629  return $tree;
630  }
631 
635  static function clipboardCopy($a_slm_obj_id, $a_ids)
636  {
637  global $ilUser;
638 
639  $tree = ilSCORM2004Node::getTree($a_slm_obj_id);
640 
641  $ilUser->clipboardDeleteObjectsOfType("page");
642  $ilUser->clipboardDeleteObjectsOfType("chap");
643  $ilUser->clipboardDeleteObjectsOfType("sco");
644 
645  // put them into the clipboard
646  $time = date("Y-m-d H:i:s", time());
647  foreach ($a_ids as $id)
648  {
649  $curnode = "";
650  if ($tree->isInTree($id))
651  {
652  $curnode = $tree->getNodeData($id);
653  $subnodes = $tree->getSubTree($curnode);
654  foreach($subnodes as $subnode)
655  {
656  if ($subnode["child"] != $id)
657  {
658  $ilUser->addObjectToClipboard($subnode["child"],
659  $subnode["type"], $subnode["title"],
660  $subnode["parent"], $time, $subnode["lft"]);
661  }
662  }
663  }
664  $order = ($curnode["lft"] > 0)
665  ? $curnode["lft"]
666  : (int) ($order + 1);
667  $ilUser->addObjectToClipboard($id,
669  $order);
670  }
671  }
672 
676  function clipboardCut($a_slm_obj_id, $a_ids)
677  {
678  $tree = ilSCORM2004Node::getTree($a_slm_obj_id);
679 
680  if (!is_array($a_ids))
681  {
682  return false;
683  }
684  else
685  {
686  // get all "top" ids, i.e. remove ids, that have a selected parent
687  foreach($a_ids as $id)
688  {
689  $path = $tree->getPathId($id);
690  $take = true;
691  foreach($path as $path_id)
692  {
693  if ($path_id != $id && in_array($path_id, $a_ids))
694  {
695  $take = false;
696  }
697  }
698  if ($take)
699  {
700  $cut_ids[] = $id;
701  }
702  }
703  }
704 
705  ilSCORM2004Node::clipboardCopy($a_slm_obj_id, $cut_ids);
706 
707  // remove the objects from the tree
708  // note: we are getting chapters, scos and pages which are *not* in the tree
709  // we do not delete any pages/chapters here
710  foreach ($cut_ids as $id)
711  {
712  $curnode = $tree->getNodeData($id);
713  if ($tree->isInTree($id))
714  {
715  $tree->deleteTree($curnode);
716  }
717  }
718 
719  }
720 
724  static function uniqueTypesCheck($a_items)
725  {
726  $types = array();
727  if (is_array($a_items))
728  {
729  foreach($a_items as $item)
730  {
732  $types[$type] = $type;
733  }
734  }
735 
736  if (count($types) > 1)
737  {
738  return false;
739  }
740  return true;
741  }
742 
746  static function insertPageClip($a_slm_obj)
747  {
748  global $ilCtrl, $ilUser;
749 
750  // @todo: move this to a service since it can be used here, too
751  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
752 
753  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
756 
757  $tree = ilSCORM2004Node::getTree($a_slm_obj->getId());
758 
759  if (!$first_child) // insert after node id
760  {
761  $parent_id = $tree->getParentId($node_id);
762  $target = $node_id;
763  }
764  else // insert as first child
765  {
766  $parent_id = $node_id;
767  $target = IL_FIRST_NODE;
768  }
769 
770  // cut and paste
771  $pages = $ilUser->getClipboardObjects("page");
772  $copied_nodes = array();
773  foreach ($pages as $pg)
774  {
775  $cid = ilSCORM2004Node::pasteTree($a_slm_obj, $pg["id"], $parent_id, $target,
776  $pg["insert_time"], $copied_nodes,
777  (ilEditClipboard::getAction() == "copy"));
778  $target = $cid;
779  }
780  //ilLMObject::updateInternalLinks($copied_nodes);
781 
782  if (ilEditClipboard::getAction() == "cut")
783  {
784  $ilUser->clipboardDeleteObjectsOfType("page");
785  $ilUser->clipboardDeleteObjectsOfType("chap");
786  $ilUser->clipboardDeleteObjectsOfType("sco");
788  }
789  }
790 
794  static function insertScoClip($a_slm_obj)
795  {
796  global $ilCtrl, $ilUser;
797 
798  // @todo: move this to a service since it can be used here, too
799  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
800 
801  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
804 
805  $tree = ilSCORM2004Node::getTree($a_slm_obj->getId());
806 
807  if (!$first_child) // insert after node id
808  {
809  $parent_id = $tree->getParentId($node_id);
810  $target = $node_id;
811  }
812  else // insert as first child
813  {
814  $parent_id = $node_id;
815  $target = IL_FIRST_NODE;
816  }
817 
818  // cut and paste
819  $scos = $ilUser->getClipboardObjects("sco");
820  $copied_nodes = array();
821  foreach ($scos as $sco)
822  {
823  $cid = ilSCORM2004Node::pasteTree($a_slm_obj, $sco["id"], $parent_id, $target,
824  $sco["insert_time"], $copied_nodes,
825  (ilEditClipboard::getAction() == "copy"));
826  $target = $cid;
827  }
828  //ilLMObject::updateInternalLinks($copied_nodes);
829 
830  if (ilEditClipboard::getAction() == "cut")
831  {
832  $ilUser->clipboardDeleteObjectsOfType("page");
833  $ilUser->clipboardDeleteObjectsOfType("chap");
834  $ilUser->clipboardDeleteObjectsOfType("sco");
836  }
837  }
838 
842  function insertChapterClip($a_slm_obj, $a_as_sub = false)
843  {
844  global $ilUser, $ilCtrl, $ilLog;
845 
846  // @todo: move this to a service since it can be used here, too
847  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
848 
849  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
852 
853  $tree = ilSCORM2004Node::getTree($a_slm_obj->getId());
854 
855  if ($a_as_sub) // as subchapter
856  {
857  if (!$first_child) // insert under parent
858  {
859  $parent_id = $node_id;
860  $target = "";
861  }
862  else // we shouldnt end up here
863  {
864  return;
865  }
866  }
867  else // as chapter
868  {
869  if (!$first_child) // insert after node id
870  {
871  $parent_id = $tree->getParentId($node_id);
872  $target = $node_id;
873  }
874  else // insert as first child
875  {
876  $parent_id = $node_id;
877  $target = IL_FIRST_NODE;
878 
879  // do not move a chapter in front of a sco (maybe never needed)
880  $childs = $tree->getChildsByType($parent_id, "sco");
881  if (count($childs) != 0)
882  {
883  $target = $childs[count($childs) - 1]["obj_id"];
884  }
885  }
886  }
887 
888  // copy and paste
889  $chapters = $ilUser->getClipboardObjects("chap", true);
890  $copied_nodes = array();
891  foreach ($chapters as $chap)
892  {
893  $cid = ilSCORM2004Node::pasteTree($a_slm_obj, $chap["id"], $parent_id,
894  $target, $chap["insert_time"], $copied_nodes,
895  (ilEditClipboard::getAction() == "copy"));
896  $target = $cid;
897  }
898  //ilLMObject::updateInternalLinks($copied_nodes);
899 
900  if (ilEditClipboard::getAction() == "cut")
901  {
902  $ilUser->clipboardDeleteObjectsOfType("page");
903  $ilUser->clipboardDeleteObjectsOfType("chap");
904  $ilUser->clipboardDeleteObjectsOfType("sco");
906  }
907  }
908 
912  static function pasteTree($a_target_slm, $a_item_id, $a_parent_id, $a_target, $a_insert_time,
913  &$a_copied_nodes, $a_as_copy = false)
914  {
915  global $ilUser, $ilias, $ilLog;
916 
917  $item_slm_id = ilSCORM2004Node::_lookupSLMID($a_item_id);
918  $item_type = ilSCORM2004Node::_lookupType($a_item_id);
919  $slm_obj = $ilias->obj_factory->getInstanceByObjId($item_slm_id);
920  if ($item_type == "chap")
921  {
922  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Chapter.php");
923  $item = new ilSCORM2004Chapter($slm_obj, $a_item_id);
924  }
925  else if ($item_type == "page")
926  {
927  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php");
928  $item = new ilSCORM2004PageNode($slm_obj, $a_item_id);
929  }
930  else if ($item_type == "sco")
931  {
932  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Sco.php");
933  $item = new ilSCORM2004Sco($slm_obj, $a_item_id);
934  }
935 
936  $ilLog->write("Getting from clipboard type ".$item_type.", ".
937  "Item ID: ".$a_item_id.", of original SLM: ".$item_slm_id);
938 
939  if ($item_slm_id != $a_target_slm->getId() && !$a_as_copy)
940  {
941  // @todo: check whether st is NOT in tree
942 
943  // "move" metadata to new lm
944  include_once("Services/MetaData/classes/class.ilMD.php");
945  $md = new ilMD($item_slm_id, $item->getId(), $item->getType());
946  $new_md = $md->cloneMD($a_target_slm->getId(), $item->getId(), $item->getType());
947 
948  // update lm object
949  $item->setSLMId($a_target_slm->getId());
950  $item->setSLMObject($a_target_slm);
951  $item->update();
952 
953  // delete old meta data set
954  $md->deleteAll();
955 
956  if ($item_type == "page")
957  {
958  $page = $item->getPageObject();
959  $page->buildDom();
960  $page->setParentId($a_target_slm->getId());
961  $page->update();
962  }
963  }
964 
965  if ($a_as_copy)
966  {
967  $target_item = $item->copy($a_target_slm);
968  $a_copied_nodes[$item->getId()] = $target_item->getId();
969  }
970  else
971  {
972  $target_item = $item;
973  }
974 
975  $ilLog->write("Putting into tree type ".$target_item->getType().
976  "Item ID: ".$target_item->getId().", Parent: ".$a_parent_id.", ".
977  "Target: ".$a_target.", Item LM:".$target_item->getContentObject()->getId());
978 
979  ilSCORM2004Node::putInTree($target_item, $a_parent_id, $a_target);
980 
981  $childs = $ilUser->getClipboardChilds($item->getId(), $a_insert_time);
982 
983  foreach($childs as $child)
984  {
985  ilSCORM2004Node::pasteTree($a_target_slm, $child["id"], $target_item->getId(),
986  IL_LAST_NODE, $a_insert_time, $a_copied_nodes, $a_as_copy);
987  }
988 
989  return $target_item->getId();
990  }
991 
992  //Methods for Sequencing
993 
994  //objectives per node
995  public function getObjectives()
996  {
997  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Objective.php");
998  return ilSCORM2004Objective::fetchAllObjectives($this->slm_object,$this->getId());
999  }
1000 
1001  public function deleteSeqInfo()
1002  {
1003  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Item.php");
1004  $seq_item = new ilSCORM2004Item($this->getId());
1005  $seq_item -> delete();
1006  }
1007 
1008  //function currently unused - shouldn't be removed if subchapter support may be added in the future
1009  public function parentHasSeqTemplate(){
1010  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Utilities.php");
1011  $seq_util = new ilSCORM2004Utilities($this->getId());
1012  return $seq_util -> parentHasSeqTemplate($this->slm_object);
1013  }
1014 
1015 
1016  public function exportAsScorm12() {
1017  //to implement
1018  return;
1019  }
1020 
1021  public function exportAsScorm13() {
1022  //to implement
1023  return;
1024  }
1025 
1026 
1027 
1028 }
1029 ?>