ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilSCORM2004Chapter Class Reference

Class ilSCORM2004Chapter. More...

+ Inheritance diagram for ilSCORM2004Chapter:
+ Collaboration diagram for ilSCORM2004Chapter:

Public Member Functions

 ilSCORM2004Chapter ($a_slm_object, $a_id=0)
 Constructor @access public. More...
 
 delete ($a_delete_meta_data=true)
 Delete a chapter. More...
 
 copy ($a_target_slm)
 Copy chapter. More...
 
 exportXML (&$a_xml_writer, $a_inst, &$expLog)
 Export object to xml (see ilias_co.dtd) More...
 
 exportXMLMetaData (&$a_xml_writer)
 export structure objects meta data to xml (see ilias_co.dtd) More...
 
 _getPresentationTitle ($a_st_id, $a_include_numbers=false)
 get presentation title More...
 
 exportXMLPageObjects (&$a_xml_writer, $a_inst=0)
 export page objects of structure object (see ilias_co.dtd) More...
 
 exportXMLStructureObjects (&$a_xml_writer, $a_inst, &$expLog)
 export (sub)structure objects of structure object (see ilias_co.dtd) More...
 
 exportFOPageObjects (&$a_xml_writer)
 export object to fo More...
 
- Public Member Functions inherited from ilSCORM2004Node
 ilSCORM2004Node ($a_slm_object, $a_id=0)
 
 setTitle ($a_title)
 Set title. More...
 
 getTitle ()
 Get title. More...
 
 setDescription ($a_description)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setType ($a_type)
 Set type. More...
 
 getType ()
 Get type. More...
 
 setSLMId ($a_slm_id)
 Set ID of parent Scorm Learning Module Object. More...
 
 getSLMId ()
 Get ID of parent Scorm Learning Module Object. More...
 
 setSLMObject ($a_slm_obj)
 Set Scorm Learning Module Object. More...
 
 getSLMObject ()
 Get scorm learning module object. More...
 
 getContentObject ()
 Get Scorm Learning Module Object. More...
 
 setId ($a_id)
 Set Node ID. More...
 
 getId ()
 Get Node ID. More...
 
 getImportId ()
 Set Import ID. More...
 
 setImportId ($a_id)
 Get Import ID. More...
 
 read ()
 Read Data of Node. More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 setDataRecord ($a_record)
 this method should only be called by class ilSCORM2004NodeFactory More...
 
 create ($a_upload=false)
 Create Node. More...
 
 update ()
 Update Node. More...
 
 delete ()
 Delete Node. More...
 
 _getIdForImportId ($a_import_id)
 Get Node ID for import ID (static) More...
 
 _exists ($a_id)
 Checks wether a node exists. More...
 
 _deleteAllSLMNodes ($a_slm_object)
 Delete all nodes of Scorm Learning Module. More...
 
 _lookupSLMID ($a_id)
 Lookup Scorm Learning Module ID for node id. More...
 
 clipboardCut ($a_slm_obj_id, $a_ids)
 Cut and copy a set of chapters/pages into the clipboard. More...
 
 insertChapterClip ($a_slm_obj, $a_as_sub=false)
 Insert Chapter from clipboard. More...
 
 getObjectives ()
 
 deleteSeqInfo ()
 
 parentHasSeqTemplate ()
 
 exportAsScorm12 ()
 
 exportAsScorm13 ()
 

Data Fields

 $tree
 
- Data Fields inherited from ilSCORM2004Node
 $slm_id
 
 $type
 
 $id
 
 $slm_object
 

Private Member Functions

 delete_rec ($a_delete_meta_data=true)
 Delete data records of chapter (and nested objects) More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilSCORM2004Node
static _lookupTitle ($a_obj_id)
 Lookup Title. More...
 
static _lookupType ($a_obj_id)
 Lookup Type. More...
 
static _writeTitle ($a_obj_id, $a_title)
 Write Title. More...
 
static _writeImportId ($a_id, $a_import_id)
 Write import ID. More...
 
static putInTree ($a_obj, $a_parent_id="", $a_target_node_id="")
 put this object into content object tree More...
 
static getTree ($a_slm_obj_id)
 Get scorm module editing tree. More...
 
static clipboardCopy ($a_slm_obj_id, $a_ids)
 Copy a set of chapters/pages/scos into the clipboard. More...
 
static uniqueTypesCheck ($a_items)
 Check for unique types (all pages or all chapters or all scos) More...
 
static insertPageClip ($a_slm_obj)
 Insert pages from clipboard. More...
 
static insertAssetClip ($a_slm_obj, $a_type="ass")
 Insert assets from clipboard. More...
 
static insertScoClip ($a_slm_obj)
 Insert scos from clipboard. More...
 
static pasteTree ($a_target_slm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_from_clipboard=true, $a_source_parent_type="")
 Paste item (tree) from clipboard or other learning module to target scorm learning module. More...
 

Detailed Description

Class ilSCORM2004Chapter.

Chapter class for SCORM 2004 Editing

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 17 of file class.ilSCORM2004Chapter.php.

Member Function Documentation

◆ _getPresentationTitle()

ilSCORM2004Chapter::_getPresentationTitle (   $a_st_id,
  $a_include_numbers = false 
)

get presentation title

Definition at line 168 of file class.ilSCORM2004Chapter.php.

169 {
170 global $ilDB;
171/*
172 // get chapter data
173 $query = "SELECT * FROM lm_data WHERE obj_id = ".$ilDB->quote($a_st_id);
174 $st_set = $ilDB->query($query);
175 $st_rec = $st_set->fetchRow(DB_FETCHMODE_ASSOC);
176
177 $tree = new ilTree($st_rec["lm_id"]);
178 $tree->setTableNames('lm_tree','lm_data');
179 $tree->setTreeTablePK("lm_id");
180
181 if ($a_include_numbers)
182 {
183 if ($tree->isInTree($st_rec["obj_id"]))
184 {
185 // get chapter tree node
186 $query = "SELECT * FROM lm_tree WHERE child = ".
187 $ilDB->quote($a_st_id)." AND lm_id = ".
188 $ilDB->quote($st_rec["lm_id"]);
189 $tree_set = $ilDB->query($query);
190 $tree_node = $tree_set->fetchRow(DB_FETCHMODE_ASSOC);
191 $depth = $tree_node["depth"];
192
193 $nr = $tree->getChildSequenceNumber($tree_node, "st")." ";
194 for ($i = $depth - 1; $i > 1; $i --)
195 {
196 // get next parent tree node
197 $query = "SELECT * FROM lm_tree WHERE child = ".
198 $ilDB->quote($tree_node["parent"])." AND lm_id = ".
199 $ilDB->quote($st_rec["lm_id"]);
200 $tree_set = $ilDB->query($query);
201 $tree_node = $tree_set->fetchRow(DB_FETCHMODE_ASSOC);
202 $seq = $tree->getChildSequenceNumber($tree_node, "st");
203
204 $nr = $seq.".".$nr;
205 }
206 }
207 }
208
209 return $nr.$st_rec["title"];
210*/
211 }
global $ilDB

References $ilDB.

◆ copy()

ilSCORM2004Chapter::copy (   $a_target_slm)

Copy chapter.

Definition at line 71 of file class.ilSCORM2004Chapter.php.

72 {
73 $chap = new ilSCORM2004Chapter($a_target_slm);
74 $chap->setTitle($this->getTitle());
75 if ($this->getSLMId() != $a_target_slm->getId())
76 {
77 $chap->setImportId("il__chap_".$this->getId());
78 }
79 $chap->setSLMId($a_target_slm->getId());
80 $chap->setType($this->getType());
81 $chap->setDescription($this->getDescription());
82 $chap->create(true);
83 $a_copied_nodes[$this->getId()] = $chap->getId();
84
85 // copy meta data
86 include_once("Services/MetaData/classes/class.ilMD.php");
87 $md = new ilMD($this->getSLMId(), $this->getId(), $this->getType());
88 $new_md =& $md->cloneMD($a_target_slm->getId(), $chap->getId(), $this->getType());
89
90 return $chap;
91 }
ilSCORM2004Chapter($a_slm_object, $a_id=0)
Constructor @access public.
getSLMId()
Get ID of parent Scorm Learning Module Object.
getDescription()
Get description.

References ilSCORM2004Node\getDescription(), ilSCORM2004Node\getId(), ilSCORM2004Node\getSLMId(), ilSCORM2004Node\getTitle(), ilSCORM2004Node\getType(), and ilSCORM2004Chapter().

+ Here is the call graph for this function:

◆ delete()

ilSCORM2004Chapter::delete (   $a_delete_meta_data = true)

Delete a chapter.

Definition at line 34 of file class.ilSCORM2004Chapter.php.

35 {
36 $node_data = $this->tree->getNodeData($this->getId());
37 $this->delete_rec($a_delete_meta_data);
38 $this->tree->deleteTree($node_data);
39 parent::deleteSeqInfo();
40 }
delete_rec($a_delete_meta_data=true)
Delete data records of chapter (and nested objects)

References delete_rec(), and ilSCORM2004Node\getId().

+ Here is the call graph for this function:

◆ delete_rec()

ilSCORM2004Chapter::delete_rec (   $a_delete_meta_data = true)
private

Delete data records of chapter (and nested objects)

Definition at line 45 of file class.ilSCORM2004Chapter.php.

46 {
47 $childs = $this->tree->getChilds($this->getId());
48 foreach ($childs as $child)
49 {
50 $obj =& ilSCORM2004NodeFactory::getInstance($this->slm_object, $child["obj_id"], false);
51 if (is_object($obj))
52 {
53 if ($obj->getType() == "chap")
54 {
55 $obj->delete_rec($a_tree, $a_delete_meta_data);
56 }
57 if ($obj->getType() == "sco")
58 {
59 $obj->delete($a_delete_meta_data);
60 }
61 }
62 unset($obj);
63 }
64 parent::delete($a_delete_meta_data);
65 }
static getInstance($a_slm_object, $a_id=0, $a_halt=true)

References ilSCORM2004Node\getId(), and ilSCORM2004NodeFactory\getInstance().

Referenced by delete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportFOPageObjects()

ilSCORM2004Chapter::exportFOPageObjects ( $a_xml_writer)

export object to fo

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data export page objects of structure object (see ilias_co.dtd)
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 323 of file class.ilSCORM2004Chapter.php.

324 {
325// @todo Check this
326/*
327 global $ilBench;
328
329 $this->tree = new ilTree($this->getLmId());
330 $this->tree->setTableNames('lm_tree', 'lm_data');
331 $this->tree->setTreeTablePK("lm_id");
332
333 $childs = $this->tree->getChilds($this->getId());
334 foreach ($childs as $child)
335 {
336 if($child["type"] != "pg")
337 {
338 continue;
339 }
340
341 // export xml to writer object
342 //$ilBench->start("ContentObjectExport", "exportStructureObject_exportPageObjectAlias");
343
344 $page_obj = new ilLMPageObject($this->getContentObject(), $child["obj_id"]);
345 $page_obj->exportFO($a_xml_writer);
346
347 //$ilBench->stop("ContentObjectExport", "exportStructureObject_exportPageObjectAlias");
348 }
349*/
350 }

◆ exportXML()

ilSCORM2004Chapter::exportXML ( $a_xml_writer,
  $a_inst,
$expLog 
)

Export object to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 99 of file class.ilSCORM2004Chapter.php.

100 {
101// @todo
102/*
103 global $ilBench;
104
105 $expLog->write(date("[y-m-d H:i:s] ")."Structure Object ".$this->getId());
106 $attrs = array();
107 $a_xml_writer->xmlStartTag("StructureObject", $attrs);
108
109 // MetaData
110 $ilBench->start("ContentObjectExport", "exportStructureObject_exportMeta");
111 $this->exportXMLMetaData($a_xml_writer);
112 $ilBench->stop("ContentObjectExport", "exportStructureObject_exportMeta");
113
114 // StructureObjects
115 $ilBench->start("ContentObjectExport", "exportStructureObject_exportPageObjects");
116 $this->exportXMLPageObjects($a_xml_writer, $a_inst);
117 $ilBench->stop("ContentObjectExport", "exportStructureObject_exportPageObjects");
118
119 // PageObjects
120 $this->exportXMLStructureObjects($a_xml_writer, $a_inst, $expLog);
121
122 // Layout
123 // not implemented
124
125 $a_xml_writer->xmlEndTag("StructureObject");
126*/
127 }

◆ exportXMLMetaData()

ilSCORM2004Chapter::exportXMLMetaData ( $a_xml_writer)

export structure objects meta data to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 136 of file class.ilSCORM2004Chapter.php.

137 {
138// @todo
139/*
140 include_once("Services/MetaData/classes/class.ilMD2XML.php");
141 $md2xml = new ilMD2XML($this->getLMId(), $this->getId(), $this->getType());
142 $md2xml->setExportMode(true);
143 $md2xml->startExport();
144 $a_xml_writer->appendXML($md2xml->getXML());
145*/
146 }

◆ exportXMLPageObjects()

ilSCORM2004Chapter::exportXMLPageObjects ( $a_xml_writer,
  $a_inst = 0 
)

export page objects of structure object (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 221 of file class.ilSCORM2004Chapter.php.

222 {
223// @todo Check this
224/*
225 include_once './Modules/LearningModule/classes/class.ilLMPageObject.php';
226
227 global $ilBench;
228
229 $this->tree = new ilTree($this->getLmId());
230 $this->tree->setTableNames('lm_tree', 'lm_data');
231 $this->tree->setTreeTablePK("lm_id");
232
233 $childs = $this->tree->getChilds($this->getId());
234 foreach ($childs as $child)
235 {
236 if($child["type"] != "pg")
237 {
238 continue;
239 }
240
241 // export xml to writer object
242 $ilBench->start("ContentObjectExport", "exportStructureObject_exportPageObjectAlias");
243 //$ilBench->start("ContentObjectExport", "exportStructureObject_getLMPageObject");
244 //$page_obj = new ilLMPageObject($this->getContentObject(), $child["obj_id"]);
245 //$ilBench->stop("ContentObjectExport", "exportStructureObject_getLMPageObject");
246 ilLMPageObject::_exportXMLAlias($a_xml_writer, $child["obj_id"], $a_inst);
247 //$page_obj->exportXML($a_xml_writer, "alias", $a_inst);
248 //unset($page_obj);
249 $ilBench->stop("ContentObjectExport", "exportStructureObject_exportPageObjectAlias");
250 }
251*/
252 }

◆ exportXMLStructureObjects()

ilSCORM2004Chapter::exportXMLStructureObjects ( $a_xml_writer,
  $a_inst,
$expLog 
)

export (sub)structure objects of structure object (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 261 of file class.ilSCORM2004Chapter.php.

262 {
263// @todo Check this
264/*
265 $this->tree = new ilTree($this->getLmId());
266 $this->tree->setTableNames('lm_tree', 'lm_data');
267 $this->tree->setTreeTablePK("lm_id");
268
269 $childs = $this->tree->getChilds($this->getId());
270 foreach ($childs as $child)
271 {
272 if($child["type"] != "st")
273 {
274 continue;
275 }
276
277 // export xml to writer object
278 $structure_obj = new ilStructureObject($this->getContentObject(),
279 $child["obj_id"]);
280 $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
281 unset($structure_obj);
282 }
283*/
284 }

◆ ilSCORM2004Chapter()

ilSCORM2004Chapter::ilSCORM2004Chapter (   $a_slm_object,
  $a_id = 0 
)

Constructor @access public.

Definition at line 25 of file class.ilSCORM2004Chapter.php.

26 {
27 parent::ilSCORM2004Node($a_slm_object, $a_id);
28 $this->setType("chap");
29 }
setType($a_type)
Set type.

References ilSCORM2004Node\setType().

Referenced by copy(), and ilSCORM2004SeqTemplate\importTemplate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $tree

ilSCORM2004Chapter::$tree

Definition at line 19 of file class.ilSCORM2004Chapter.php.


The documentation for this class was generated from the following file: