ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilSCORM13Package.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
11 require_once "./Modules/Scorm2004/classes/ilSCORM13Package.php";
12 require_once "./Modules/Scorm2004/classes/class.ilSCORM2004Chapter.php";
13 require_once "./Modules/Scorm2004/classes/class.ilSCORM2004Sco.php";
14 require_once "./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php";
15 require_once "./Modules/Scorm2004/classes/adlparser/SeqTreeBuilder.php";
16 require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMTree.php");
17 
19 {
20  const DB_ENCODE_XSL = './Modules/Scorm2004/templates/xsl/op/op-scorm13.xsl';
21  const CONVERT_XSL = './Modules/Scorm2004/templates/xsl/op/scorm12To2004.xsl';
22  const DB_DECODE_XSL = './Modules/Scorm2004/templates/xsl/op/op-scorm13-revert.xsl';
23  const VALIDATE_XSD = './libs/ilias/Scorm2004/xsd/op/op-scorm13.xsd';
24 
25  const WRAPPER_HTML = './Modules/Scorm2004/scripts/converter/GenericRunTimeWrapper1.0_aadlc/GenericRunTimeWrapper.htm';
26  const WRAPPER_JS = './Modules/Scorm2004/scripts/converter/GenericRunTimeWrapper1.0_aadlc/SCOPlayerWrapper.js';
27 
28 
29  private $packageFile;
30  private $packageFolder;
31  private $packagesFolder;
32  private $packageData;
33  private $slm;
34  private $slm_tree;
35 
36  public $imsmanifest;
37  public $manifest;
38  public $diagnostic;
39  public $status;
40  public $packageId;
41  public $packageName;
42  public $packageHash;
43  public $userId;
44 
45  private $idmap = array();
46  private $progress = 0.0;
47 
48  private static $elements = array(
49  'cp' => array(
50  'manifest',
51  'organization',
52  'item',
53  'hideLMSUI',
54  'resource',
55  'file',
56  'dependency',
57  'sequencing',
58  'rule',
59  'auxilaryResource',
60  'condition',
61  'mapinfo',
62  'objective',
63  ),
64  'cmi' => array(
65  'comment',
66  'correct_response',
67  'interaction',
68  'node',
69  'objective',
70  ),
71  );
72 
73  public function __construct($packageId = null)
74  {
75  $this->packagesFolder = ''; // #25372
76  $this->load($packageId);
77  // $this->userId = $GLOBALS['DIC']['USER']['usr_id'];
78  }
79 
80  public function load($packageId)
81  {
82  global $DIC;
83  $ilDB = $DIC['ilDB'];
84 
85  if (!is_numeric($packageId)) {
86  return false;
87  }
88 
89  $lm_set = $ilDB->queryF('SELECT * FROM sahs_lm WHERE id = %s', array('integer'), array($packageId));
90  $lm_data = $ilDB->fetchAssoc($lm_set);
91  $pg_set = $ilDB->queryF('SELECT * FROM cp_package WHERE obj_id = %s', array('integer'), array($packageId));
92  $pg_data = $ilDB->fetchAssoc($lm_set);
93 
94  $this->packageData = array_merge($lm_data, $pg_data);
95  $this->packageId = $packageId;
96  $this->packageFolder = $this->packagesFolder . '/' . $packageId;
97  $this->packageFile = $this->packageFolder . '.zip';
98  $this->imsmanifestFile = $this->packageFolder . '/' . 'imsmanifest.xml';
99  return true;
100  }
101 
102  public function rollback()
103  {
104  $this->setProgress(0, 'Rolling back...');
105  $this->dbRemoveAll();
106  if (is_dir($this->packageFolder)) {
107  dir_delete($this->packageFolder);
108  }
109  if (is_file($this->packageFile)) {
110  @unlink($this->packageFile);
111  }
112  $this->setProgress(0, 'Roll back finished: Ok. ');
113  }
114 
115 
119  public function exportXML()
120  {
121  global $DIC;
122  $ilDB = $DIC['ilDB'];
123 
124  header('content-type: text/xml');
125  header('content-disposition: attachment; filename="manifest.xml"');
126 
127  $res = $ilDB->queryF(
128  'SELECT xmldata FROM cp_package WHERE obj_id = %s',
129  array('integer'),
130  array($this->packageId)
131  );
132  $row = $ilDB->fetchAssoc($res);
133 
134  print($row['xmldata']);
135  }
136 
137 
144  public function il_import($packageFolder, $packageId, $ilias, $validate, $reimport = false)
145  {
146  global $DIC;
147  $ilDB = $DIC['ilDB'];
148  $ilLog = $DIC['ilLog'];
149  $ilErr = $DIC['ilErr'];
150 
151  $title = "";
152 
153  if ($reimport === true) {
154  $this->packageId = $packageId;
155  $this->dbRemoveAll();
156  }
157 
158  $this->packageFolder = $packageFolder;
159  $this->packageId = $packageId;
160  $this->imsmanifestFile = $this->packageFolder . '/' . 'imsmanifest.xml';
161  //step 1 - parse Manifest-File and validate
162  $this->imsmanifest = new DOMDocument;
163  $this->imsmanifest->async = false;
164  if (!@$this->imsmanifest->load($this->imsmanifestFile)) {
165  $this->diagnostic[] = 'XML not wellformed';
166  return false;
167  }
168 
169  //step 2 tranform
170  $this->manifest = $this->transform($this->imsmanifest, self::DB_ENCODE_XSL);
171 
172  if (!$this->manifest) {
173  $this->diagnostic[] = 'Cannot transform into normalized manifest';
174  return false;
175  }
176  //setp 2.5 if only a single item, make sure the scormType of it's linked resource is SCO
177  $path = new DOMXpath($this->manifest);
178  $path->registerNamespace("scorm", "http://www.openpalms.net/scorm/scorm13");
179  $items = $path->query("//scorm:item");
180  if ($items->length == 1) {
181  $n = $items->item(0);
182  $resource = $path->query("//scorm:resource");//[&id='"+$n->getAttribute("resourceId")+"']");
183  foreach ($resource as $res) {
184  if ($res->getAttribute('id') == $n->getAttribute("resourceId")) {
185  $res->setAttribute('scormType', 'sco');
186  }
187  }
188  }
189  //$this->manifest->save("C:\Users\gratat\after.xml");
190  //step 3 validation -just for normalized XML
191  if ($validate == "y") {
192  if (!$this->validate($this->manifest, self::VALIDATE_XSD)) {
193  $ilErr->raiseError(
194  "<b>The uploaded SCORM 1.2 / SCORM 2004 is not valid. You can try to import the package without the validation option checked on your own risk. </b><br><br>Validation Error(s):</b><br> Normalized XML is not conform to " . self::VALIDATE_XSD,
195  $ilErr->MESSAGE
196  );
197  }
198  }
199  $this->dbImport($this->manifest);
200 
201  if (file_exists($this->packageFolder . '/' . 'index.xml')) {
202  $doc = simplexml_load_file($this->packageFolder . '/' . 'index.xml');
203  $l = $doc->xpath("/ContentObject/MetaData");
204  if ($l[0]) {
205  include_once 'Services/MetaData/classes/class.ilMDXMLCopier.php';
207  $mdxml->startParsing();
208  $mdxml->getMDObject()->update();
209  }
210  } else {
211  include_once("./Modules/Scorm2004/classes/class.ilSCORM13MDImporter.php");
212  $importer = new ilSCORM13MDImporter($this->imsmanifest, $packageId);
213  $importer->import();
214  $title = $importer->getTitle();
215  $description = $importer->getDescription();
216  if ($description != "") {
218  }
219  }
220 
221  //step 5
222  $x = simplexml_load_string($this->manifest->saveXML());
223  $x['persistPreviousAttempts'] = $this->packageData['persistprevattempts'];
224  // $x['online'] = !$this->getOfflineStatus();//$this->packageData['c_online'];
225 
226  $x['defaultLessonMode'] = $this->packageData['default_lesson_mode'];
227  $x['credit'] = $this->packageData['credit'];
228  $x['autoReview'] = $this->packageData['auto_review'];
229  $j = array();
230  // first read resources into flat array to resolve item/identifierref later
231  $r = array();
232  foreach ($x->resource as $xe) {
233  $r[strval($xe['id'])] = $xe;
234  unset($xe);
235  }
236  // iterate through items and set href and scoType as activity attributes
237  foreach ($x->xpath('//*[local-name()="item"]') as $xe) {
238  // get reference to resource and set href accordingly
239  if ($b = $r[strval($xe['resourceId'])]) {
240  $xe['href'] = strval($b['base']) . strval($b['href']);
241  unset($xe['resourceId']);
242  if (strval($b['scormType']) == 'sco') {
243  $xe['sco'] = true;
244  }
245  }
246  }
247  // iterate recursivly through activities and build up simple php object
248  // with items and associated sequencings
249  // top node is the default organization which is handled as an item
250  self::jsonNode($x->organization, $j['item']);
251  foreach ($x->sequencing as $s) {
252  self::jsonNode($s, $j['sequencing'][]);
253  }
254  // combined manifest+resources xml:base is set as organization base
255  $j['item']['base'] = strval($x['base']);
256  // package folder is base to whole playing process
257  $j['base'] = $packageFolder . '/';
258  $j['foreignId'] = floatval($x['foreignId']); // manifest cp_node_id for associating global (package wide) objectives
259  $j['id'] = strval($x['id']); // manifest id for associating global (package wide) objectives
260 
261 
262  //last step - build ADL Activity tree
263  $act = new SeqTreeBuilder();
264  $adl_tree = $act->buildNodeSeqTree($this->imsmanifestFile);
265  $ilDB->update(
266  'cp_package',
267  array(
268  'xmldata' => array('clob', $x->asXML()),
269  'jsdata' => array('clob', json_encode($j)),
270  'activitytree' => array('clob', json_encode($adl_tree['tree'])),
271  'global_to_system' => array('integer', (int) $adl_tree['global']),
272  'shared_data_global_to_system' => array('integer', (int) $adl_tree['dataglobal'])
273  ),
274  array(
275  'obj_id' => array('integer', (int) $this->packageId)
276  )
277  );
278 
279  // title retrieved by importer
280  if ($title != "") {
281  return $title;
282  }
283 
284  return $j['item']['title'];
285  }
286 
287 
294  public function il_importSco($packageId, $sco_id, $packageFolder)
295  {
296  global $DIC;
297  $ilDB = $DIC['ilDB'];
298  $ilLog = $DIC['ilLog'];
299 
300  $this->packageFolder = $packageFolder;
301  $this->packageId = $packageId;
302  $this->imsmanifestFile = $this->packageFolder . '/' . 'index.xml';
303  $this->imsmanifest = new DOMDocument;
304  $this->imsmanifest->async = false;
305 
306  if (!@$this->imsmanifest->load($this->imsmanifestFile)) {
307  $this->diagnostic[] = 'XML not wellformed';
308  return false;
309  }
310 
312  $sco = new ilSCORM2004Sco($slm, $sco_id);
313  $this->dbImportSco($slm, $sco);
314 
315  // import sco.xml
316  $sco_xml_file = $this->packageFolder . '/sco.xml';
317  if (is_file($sco_xml_file)) {
318  $scodoc = new DOMDocument;
319  $scodoc->async = false;
320  if (!@$scodoc->load($sco_xml_file)) {
321  $this->diagnostic[] = 'XML of sco.xml not wellformed';
322  return false;
323  }
324  //$doc = new SimpleXMLElement($scodoc->saveXml());
325  //$l = $doc->xpath("/sco/objective");
326  $xpath = new DOMXPath($scodoc);
327  $nodes = $xpath->query("/sco/objective");
328  foreach ($nodes as $node) {
329  $t_node = $node->firstChild;
330  if (is_object($t_node)) {
331  $objective_text = $t_node->textContent;
332  if (trim($objective_text) != "") {
333  $objs = $sco->getObjectives();
334  foreach ($objs as $o) {
335  $mappings = $o->getMappings();
336  if ($mappings == null) {
337  $ob = new ilScorm2004Objective($sco->getId(), $o->getId());
338  $ob->setObjectiveID($objective_text);
339  $ob->updateObjective();
340  }
341  }
342  }
343  }
344  }
345  }
346  return "";
347  }
348 
355  public function il_importAss($packageId, $sco_id, $packageFolder)
356  {
357  global $DIC;
358  $ilDB = $DIC['ilDB'];
359  $ilLog = $DIC['ilLog'];
360 
361  $this->packageFolder = $packageFolder;
362  $this->packageId = $packageId;
363  $this->imsmanifestFile = $this->packageFolder . '/' . 'index.xml';
364  $this->imsmanifest = new DOMDocument;
365  $this->imsmanifest->async = false;
366 
367  if (!@$this->imsmanifest->load($this->imsmanifestFile)) {
368  $this->diagnostic[] = 'XML not wellformed';
369  return false;
370  }
371 
373  $sco = new ilSCORM2004Asset($slm, $sco_id);
374  $this->dbImportSco($slm, $sco, true);
375 
376  // import sco.xml
377  /*
378  $sco_xml_file = $this->packageFolder . '/sco.xml';
379  if (is_file($sco_xml_file))
380  {
381  $scodoc = new DOMDocument;
382  $scodoc->async = false;
383  if (!@$scodoc->load($sco_xml_file))
384  {
385  $this->diagnostic[] = 'XML of sco.xml not wellformed';
386  return false;
387  }
388  //$doc = new SimpleXMLElement($scodoc->saveXml());
389  //$l = $doc->xpath("/sco/objective");
390  $xpath = new DOMXPath($scodoc);
391  $nodes = $xpath->query("/sco/objective");
392  foreach($nodes as $node)
393  {
394  $t_node = $node->firstChild;
395  if (is_object($t_node))
396  {
397  $objective_text = $t_node->textContent;
398  if (trim($objective_text) != "")
399  {
400  $objs = $sco->getObjectives();
401  foreach ($objs as $o)
402  {
403  $mappings = $o->getMappings();
404  if ($mappings == null)
405  {
406  $ob = new ilScorm2004Objective($sco->getId(), $o->getId());
407  $ob->setObjectiveID($objective_text);
408  $ob->updateObjective();
409  }
410  }
411  }
412  }
413  }
414  }
415  */
416  return "";
417  }
418 
419  public function il_importLM($slm, $packageFolder, $a_import_sequencing = false)
420  {
421  global $DIC;
422  $ilDB = $DIC['ilDB'];
423  $ilLog = $DIC['ilLog'];
424 
425  $this->packageFolder = $packageFolder;
426  $this->packageId = $slm->getId();
427  $this->imsmanifestFile = $this->packageFolder . '/' . 'imsmanifest.xml';
428  $this->imsmanifest = new DOMDocument;
429  $this->imsmanifest->async = false;
430  $this->imsmanifest->formatOutput = false;
431  $this->imsmanifest->preserveWhiteSpace = false;
432  $this->slm = $slm;
433  if (!@$this->imsmanifest->load($this->imsmanifestFile)) {
434  $this->diagnostic[] = 'XML not wellformed';
435  return false;
436  }
437 
438  $this->mani_xpath = new DOMXPath($this->imsmanifest);
439  $this->mani_xpath->registerNamespace("d", "http://www.imsproject.org/xsd/imscp_rootv1p1p2");
440  $this->mani_xpath->registerNamespace("imscp", "http://www.imsglobal.org/xsd/imscp_v1p1");
441  $this->mani_xpath->registerNamespace("imsss", "http://www.imsglobal.org/xsd/imsss");
442 
443 
444  $this->dbImportLM(
445  simplexml_import_dom($this->imsmanifest->documentElement),
446  "",
447  $a_import_sequencing
448  );
449 
450  if (is_dir($packageFolder . "/glossary")) {
451  $this->importGlossary($slm, $packageFolder . "/glossary");
452  }
453  //die($slm->title);
454 
455  return $slm->title;
456  }
457 
459  {
460  // create and insert object in objecttree
461  include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
462  $newObj = new ilObjGlossary();
463  $newObj->setType('glo');
464  $newObj->setTitle('');
465  $newObj->create(true);
466  $newObj->createReference();
467  $newObj->putInTree($_GET["ref_id"]);
468  $newObj->setPermissions($_GET["ref_id"]);
469 
470  $xml_file = $packageFolder . "/glossary.xml";
471 
472  // check whether xml file exists within zip file
473  if (!is_file($xml_file)) {
474  return;
475  }
476 
477  include_once("./Modules/LearningModule/classes/class.ilContObjParser.php");
478  $contParser = new ilContObjParser($newObj, $xml_file, $packageFolder);
479  $contParser->startParsing();
480  $newObj->update();
481  //ilObject::_writeImportId($newObj->getId(), $newObj->getImportId());
482  $slm->setAssignedGlossary($newObj->getId());
483  $slm->update();
484  }
485 
486  public function dbImportLM($node, $parent_id = "", $a_import_sequencing = false)
487  {
488  switch ($node->getName()) {
489  case "manifest":
490  $this->slm_tree = new ilTree($this->slm->getId());
491  $this->slm_tree->setTreeTablePK("slm_id");
492  $this->slm_tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
493  $this->slm_tree->addTree($this->slm->getId(), 1);
494 
495  //add seqinfo for rootNode
496  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Sequencing.php");
497  $seq_info = new ilSCORM2004Sequencing($this->slm->getId(), true);
498 
499  // get original sequencing information
500  $r = $this->mani_xpath->query("/d:manifest/d:organizations/d:organization/imsss:sequencing");
501  $this->imsmanifest->formatOutput = false;
502  if ($r) {
503  $this->setSequencingInfo($r->item(0), $seq_info, $a_import_sequencing);
504  if ($a_import_sequencing) {
505  $seq_info->initDom();
506  }
507  }
508  $seq_info->insert();
509 
510  if (file_exists($this->packageFolder . '/' . 'index.xml')) {
511  $doc = simplexml_load_file($this->packageFolder . '/' . 'index.xml');
512  $l = $doc->xpath("/ContentObject/MetaData");
513  if ($l[0]) {
514  include_once 'Services/MetaData/classes/class.ilMDXMLCopier.php';
515  $mdxml = new ilMDXMLCopier($l[0]->asXML(), $this->slm->getId(), $this->slm->getId(), $this->slm->getType());
516  $mdxml->startParsing();
517  $mdxml->getMDObject()->update();
518  }
519  }
520  break;
521  case "organization":
522  $this->slm->title = $node->title;
523  break;
524  case "item":
525  $a = $node->attributes();
526  if (preg_match("/il_\d+_chap_\d+/", $a['identifier'])) {
527  $chap = new ilSCORM2004Chapter($this->slm);
528  $chap->setTitle($node->title);
529  $chap->setSLMId($this->slm->getId());
530  $chap->create(true);
531 
532  // save sequencing information
533  $r = $this->mani_xpath->query("//d:item[@identifier='" . $a['identifier'] . "']/imsss:sequencing");
534  if ($r) {
535  $seq_info = new ilSCORM2004Sequencing($chap->getId());
536  $this->setSequencingInfo($r->item(0), $seq_info, $a_import_sequencing);
537  $seq_info->initDom();
538  $seq_info->insert();
539  }
540 
541  ilSCORM2004Node::putInTree($chap, $parent_id, "");
542  $parent_id = $chap->getId();
543  $doc = simplexml_load_file($this->packageFolder . '/' . 'index.xml');
544  $l = $doc->xpath("/ContentObject/StructureObject/MetaData[General/Identifier/@Entry='" . $a['identifier'] . "']");
545  if ($l[0]) {
546  include_once 'Services/MetaData/classes/class.ilMDXMLCopier.php';
547  $mdxml = new ilMDXMLCopier($l[0]->asXML(), $this->slm->getId(), $chap->getId(), $chap->getType());
548  $mdxml->startParsing();
549  $mdxml->getMDObject()->update();
550  }
551  }
552  if (preg_match("/il_\d+_sco_(\d+)/", $a['identifier'], $match)) {
553  $sco = new ilSCORM2004Sco($this->slm);
554  $sco->setTitle($node->title);
555  $sco->setSLMId($this->slm->getId());
556  $sco->create(true);
557 
558  // save sequencing information
559  $r = $this->mani_xpath->query("//d:item[@identifier='" . $a['identifier'] . "']/imsss:sequencing");
560  if ($r) {
561  $seq_info = new ilSCORM2004Sequencing($sco->getId());
562  $this->setSequencingInfo(
563  $r->item(0),
564  $seq_info,
565  $a_import_sequencing,
566  "local_obj_" . $sco->getID() . "_0"
567  );
568  $seq_info->initDom();
569  $seq_info->insert();
570  }
571 
572  ilSCORM2004Node::putInTree($sco, $parent_id, "");
573  $newPack = new ilSCORM13Package();
574  $newPack->il_importSco($this->slm->getId(), $sco->getId(), $this->packageFolder . "/" . $match[1]);
575  $parent_id = $sco->getId();
576  }
577  if (preg_match("/il_\d+_ass_(\d+)/", $a['identifier'], $match)) {
578  $ass = new ilSCORM2004Asset($this->slm);
579  $ass->setTitle($node->title);
580  $ass->setSLMId($this->slm->getId());
581  $ass->create(true);
582 
583  // save sequencing information
584  $r = $this->mani_xpath->query("//d:item[@identifier='" . $a['identifier'] . "']/imsss:sequencing");
585  if ($r) {
586  $seq_info = new ilSCORM2004Sequencing($ass->getId());
587  $this->setSequencingInfo(
588  $r->item(0),
589  $seq_info,
590  $a_import_sequencing,
591  "local_obj_" . $ass->getID() . "_0"
592  );
593  $seq_info->initDom();
594  $seq_info->insert();
595  }
596 
597  ilSCORM2004Node::putInTree($ass, $parent_id, "");
598  $newPack = new ilSCORM13Package();
599  $newPack->il_importAss($this->slm->getId(), $ass->getId(), $this->packageFolder . "/" . $match[1]);
600  $parent_id = $ass->getId();
601  }
602 
603  break;
604  }
605  //if($node->nodeType==XML_ELEMENT_NODE)
606  {
607  foreach ($node->children() as $child) {
608  $this->dbImportLM($child, $parent_id, $a_import_sequencing);
609  }
610  }
611  }
612 
619  public function setSequencingInfo($a_node, $a_seq_info, $a_import_sequencing, $a_fix_obj_id = "")
620  {
621  $seq_xml = trim(str_replace("imsss:", "", $this->imsmanifest->saveXML($a_node)));
622  if ($seq_xml != "") {
623  $a_seq_info->setImportSeqXml('<?xml version="1.0"?>' . $seq_xml);
624  }
625  if ($a_import_sequencing) {
626  if ($a_fix_obj_id != "") {
627  $seq_xml = preg_replace("/local_obj_[0-9]*_0/", $a_fix_obj_id, $seq_xml);
628  }
629  $a_seq_info->setSeqXml('<?xml version="1.0"?>' . $seq_xml);
630  }
631  }
632 
633 
634  private function setProgress($progress, $msg = '')
635  {
636  $this->progress = $progress;
637  $this->diagnostic[] = $msg;
638  }
639 
648  public function jsonNode($node, &$sink)
649  {
650  foreach ($node->attributes() as $k => $v) {
651  // cast to boolean and number if possible
652  $v = strval($v);
653  if ($v === "true") {
654  $v = true;
655  } elseif ($v === "false") {
656  $v = false;
657  } elseif (is_numeric($v)) {
658  $v = (float) $v;
659  }
660  $sink[$k] = $v;
661  }
662  foreach ($node->children() as $name => $child) {
663  self::jsonNode($child, $sink[$name][]); // RECURSION
664  }
665  }
666 
667  public function dbImportSco($slm, $sco, $asset = false)
668  {
669  $qtis = array();
670  $d = ilUtil::getDir($this->packageFolder);
671  foreach ($d as $f) {
672  //continue;
673  if ($f["type"] == 'file' && substr($f["entry"], 0, 4) == 'qti_') {
674 
675 
676  $qtiParser = new ilQTIParser($this->packageFolder . "/" . $f["entry"], IL_MO_VERIFY_QTI, 0, "");
677  $result = $qtiParser->startParsing();
678  $founditems = &$qtiParser->getFoundItems();
679  // die(print_r($founditems));
680  foreach ($founditems as $qp) {
681  $newObj = new ilObjTest(0, true);
682 
683  // This creates a lot of invalid repository objects for each question
684  // question are not repository objects (see e.g. table object_data), alex 29 Sep 2009
685 
686  // $newObj->setType ( $qp ['type'] );
687  // $newObj->setTitle ( $qp ['title'] );
688  // $newObj->create ( true );
689  // $newObj->createReference ();
690  // $newObj->putInTree ($_GET ["ref_id"]);
691  // $newObj->setPermissions ( $sco->getId ());
692  // $newObj->notify ("new", $_GET["ref_id"], $sco->getId (), $_GET["ref_id"], $newObj->getRefId () );
693  // $newObj->mark_schema->flush ();
694  $qtiParser = new ilQTIParser($this->packageFolder . "/" . $f["entry"], IL_MO_PARSE_QTI, 0, "");
695  $qtiParser->setTestObject($newObj);
696  $result = $qtiParser->startParsing();
697  // $newObj->saveToDb ();
698  $qtis = array_merge($qtis, $qtiParser->getImportMapping());
699  }
700  }
701  }
702  //exit;
703  include_once 'Modules/Scorm2004/classes/class.ilSCORM2004Page.php';
704  $doc = new SimpleXMLElement($this->imsmanifest->saveXml());
705  $l = $doc->xpath("/ContentObject/MetaData");
706  if ($l[0]) {
707  include_once 'Services/MetaData/classes/class.ilMDXMLCopier.php';
708  $mdxml = new ilMDXMLCopier($l[0]->asXML(), $slm->getId(), $sco->getId(), $sco->getType());
709  $mdxml->startParsing();
710  $mdxml->getMDObject()->update();
711  }
712  $l = $doc->xpath("/ContentObject/PageObject");
713  foreach ($l as $page_xml) {
714  $tnode = $page_xml->xpath('MetaData/General/Title');
715  $page = new ilSCORM2004PageNode($slm);
716  $page->setTitle($tnode [0]);
717  $page->setSLMId($slm->getId());
718  $page->create(true);
719  // ilSCORM2004Node::putInTree ( $page, $sco->getId (), $target );
720  ilSCORM2004Node::putInTree($page, $sco->getId(), "");
721  $pmd = $page_xml->xpath("MetaData");
722  if ($pmd[0]) {
723  include_once 'Services/MetaData/classes/class.ilMDXMLCopier.php';
724  $mdxml = new ilMDXMLCopier($pmd[0]->asXML(), $slm->getId(), $page->getId(), $page->getType());
725  $mdxml->startParsing();
726  $mdxml->getMDObject()->update();
727  }
728  $tnode = $page_xml->xpath("//MediaObject/MediaAlias | //InteractiveImage/MediaAlias");
729  foreach ($tnode as $ttnode) {
730  include_once './Services/MediaObjects/classes/class.ilObjMediaObject.php';
731  $OriginId = $ttnode["OriginId"];
732  $medianodes = $doc->xpath("//MediaObject[MetaData/General/Identifier/@Entry='" . $OriginId . "']");
733  $medianode = $medianodes[0];
734  if ($medianode) {
735  $media_object = new ilObjMediaObject();
736  $media_object->setTitle($medianode->MetaData->General->Title);
737  $media_object->setDescription($medianode->MetaData->General->Description);
738  $media_object->create(false);
739  $mmd = $medianode->xpath("MetaData");
740  if ($mmd[0]) {
741  include_once 'Services/MetaData/classes/class.ilMDXMLCopier.php';
742  $mdxml = new ilMDXMLCopier($mmd[0]->asXML(), 0, $media_object->getId(), $media_object->getType());
743  $mdxml->startParsing();
744  $mdxml->getMDObject()->update();
745  }
746  // determine and create mob directory, move uploaded file to directory
747  $media_object->createDirectory();
748  $mob_dir = ilObjMediaObject::_getDirectory($media_object->getId());
749  foreach ($medianode->MediaItem as $xMediaItem) {
750  $media_item = new ilMediaItem();
751  $media_object->addMediaItem($media_item);
752  $media_item->setPurpose($xMediaItem["Purpose"]);
753  $media_item->setFormat($xMediaItem->Format);
754  $media_item->setLocation($xMediaItem->Location);
755  $media_item->setLocationType($xMediaItem->Location["Type"]);
756  $media_item->setWidth($xMediaItem->Layout["Width"]);
757  $media_item->setHeight($xMediaItem->Layout["Height"]);
758  $media_item->setHAlign($xMediaItem->Layout["HorizontalAlign"]);
759  $media_item->setCaption($xMediaItem->Caption);
760  $media_item->setTextRepresentation($xMediaItem->TextRepresentation);
761  $nr = 0;
762 
763  // add map areas (external links only)
764  foreach ($xMediaItem->MapArea as $n => $v) {
765  if ($v->ExtLink["Href"] != "") {
766  $ma = new ilMapArea();
767 
768  $map_area = new ilMapArea();
769  $map_area->setShape($v["Shape"]);
770  $map_area->setCoords($v["Coords"]);
771  $map_area->setLinkType(IL_EXT_LINK);
772  $map_area->setTitle($v->ExtLink);
773  $map_area->setHref($v->ExtLink["Href"]);
774 
775  $media_item->addMapArea($map_area);
776  }
777  }
778 
779  if ($media_item->getLocationType() == "LocalFile") {
780  // $tmp_name = $this->packageFolder."/objects/".$OriginId."/".$xMediaItem->Location;
781 // copy($tmp_name, $mob_dir."/".$xMediaItem->Location);
782  }
783  }
784 
785  // copy whole directory
786  ilUtil::rCopy($this->packageFolder . "/objects/" . $OriginId, $mob_dir);
787 
788 
789  // alex: fixed media import: these lines have been
790  // behind the next curly bracket which makes it fail
791  // when no medianode is given. (id=0 -> fatal error)
792  ilUtil::renameExecutables($mob_dir);
793  $media_object->update(true);
794  $ttnode ["OriginId"] = "il__mob_" . $media_object->getId();
795  }
796  }
797  include_once("./Modules/File/classes/class.ilObjFile.php");
798  include_once("./Services/Utilities/classes/class.ilFileUtils.php");
799  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
800 
801  $intlinks = $page_xml->xpath("//IntLink");
802  //die($intlinks);
803  //if($intlinks )
804  {
805  foreach ($intlinks as $intlink) {
806  if ($intlink["Type"]!="File") {
807  continue;
808  }
809  $path = $this->packageFolder . "/objects/" . str_replace('dfile', 'file', $intlink["Target"]);
810  if (!is_dir($path)) {
811  continue;
812  }
813  $ffiles = array();
815  $filename = $ffiles["file"][0];
816  $fileObj = new ilObjFile();
817  $fileObj->setType("file");
820 
821  // better use this, mime_content_type is deprecated
822  $fileObj->setFileType(ilObjMediaObject::getMimeType($path . "/" . $filename));
823 
824  $fileObj->setFileSize(filesize($path . "/" . $filename));
825  $fileObj->create();
826  $fileObj->createReference();
827  //$fileObj->putInTree($_GET["ref_id"]);
828  //$fileObj->setPermissions($slm->getId ());
829  $fileObj->createDirectory();
830  $fileObj->storeUnzipedFile($path . "/" . $filename, ilFileUtils::utf8_encode(ilUtil::stripSlashes($filename)));
831  $intlink["Target"]="il__dfile_" . $fileObj->getId();
832  }
833  }
834  $fileitems = $page_xml->xpath("//FileItem/Identifier");
835  //if($intlinks )
836  {
837  foreach ($fileitems as $fileitem) {
838  $path = $this->packageFolder . "/objects/" . $fileitem["Entry"];
839  if (!is_dir($path)) {
840  continue;
841  }
842  $ffiles = array();
844  $filename = $ffiles["file"][0];
845  $fileObj = new ilObjFile();
846  $fileObj->setType("file");
849 
850  // better use this, mime_content_type is deprecated
851  $fileObj->setFileType(ilObjMediaObject::getMimeType($path . "/" . $filename));
852 
853  $fileObj->setFileSize(filesize($path . "/" . $filename));
854  $fileObj->create();
855  $fileObj->createReference();
856  //$fileObj->putInTree($_GET["ref_id"]);
857  //$fileObj->setPermissions($slm->getId ());
858  $fileObj->createDirectory();
859  $fileObj->storeUnzipedFile($path . "/" . $filename, ilFileUtils::utf8_encode(ilUtil::stripSlashes($filename)));
860  $fileitem["Entry"]="il__file_" . $fileObj->getId();
861  }
862  }
863  $pagex = new ilSCORM2004Page($page->getId());
864 
865  $ddoc = new DOMDocument();
866  $ddoc->async = false;
867  $ddoc->preserveWhiteSpace = false;
868  $ddoc->formatOutput = false;
869  $ddoc->loadXML($page_xml->asXML());
870  $xpath = new DOMXPath($ddoc);
871  $tnode = $xpath->query('PageContent');
872  $t = "<PageObject>";
873  foreach ($tnode as $ttnode) {
874  $t .= str_replace("&amp;", "&", $ddoc->saveXML($ttnode));
875  }
876  $t .= "</PageObject>";
877  foreach ($qtis as $old => $q) {
878  $t = str_replace($old, 'il__qst_' . $q['pool'], $t);
879  }
880  $pagex->setXMLContent($t);
881  $pagex->updateFromXML();
882  }
883  }
884 
885  public function dbImport($node, &$lft = 1, $depth = 1, $parent = 0)
886  {
887  global $DIC;
888  $ilDB = $DIC['ilDB'];
889 
890  switch ($node->nodeType) {
891  case XML_DOCUMENT_NODE:
892 
893  // insert into cp_package
894 
895  $res = $ilDB->queryF(
896  'SELECT * FROM cp_package WHERE obj_id = %s AND c_identifier = %s',
897  array('integer', 'text'),
898  array($this->packageId, $this->packageName)
899  );
900  if ($num_rows = $ilDB->numRows($res)) {
901  $query = 'UPDATE cp_package '
902  . 'SET persistprevattempts = %s, c_settings = %s '
903  . 'WHERE obj_id = %s AND c_identifier= %s';
904  $ilDB->manipulateF(
905  $query,
906  array('integer', 'text', 'integer', 'text'),
907  array(0, null, $this->packageId, $this->packageName)
908  );
909  } else {
910  $query = 'INSERT INTO cp_package (obj_id, c_identifier, persistprevattempts, c_settings) '
911  . 'VALUES (%s, %s, %s, %s)';
912  $ilDB->manipulateF(
913  $query,
914  array('integer','text','integer', 'text'),
915  array($this->packageId, $this->packageName, 0, null)
916  );
917  }
918 
919  // run sub nodes
920  $this->dbImport($node->documentElement); // RECURSION
921  break;
922 
923  case XML_ELEMENT_NODE:
924  if ($node->nodeName === 'manifest') {
925  if ($node->getAttribute('uri') == "") {
926  // default URI is md5 hash of zip file, i.e. packageHash
927  $node->setAttribute('uri', 'md5:' . $this->packageHash);
928  }
929  }
930 
931  $cp_node_id = $ilDB->nextId('cp_node');
932 
933  $query = 'INSERT INTO cp_node (cp_node_id, slm_id, nodename) '
934  . 'VALUES (%s, %s, %s)';
935  $ilDB->manipulateF(
936  $query,
937  array('integer', 'integer', 'text'),
938  array($cp_node_id, $this->packageId, $node->nodeName)
939  );
940 
941  $query = 'INSERT INTO cp_tree (child, depth, lft, obj_id, parent, rgt) '
942  . 'VALUES (%s, %s, %s, %s, %s, %s)';
943  $ilDB->manipulateF(
944  $query,
945  array('integer', 'integer', 'integer', 'integer', 'integer', 'integer'),
946  array($cp_node_id, $depth, $lft++, $this->packageId, $parent, 0)
947  );
948 
949  // insert into cp_*
950  //$a = array('cp_node_id' => $cp_node_id);
951  $names = array('cp_node_id');
952  $values = array($cp_node_id);
953  $types = array('integer');
954 
955  foreach ($node->attributes as $attr) {
956  switch (strtolower($attr->name)) {
957  case 'completionsetbycontent': $names[] = 'completionbycontent';break;
958  case 'objectivesetbycontent': $names[] = 'objectivebycontent';break;
959  case 'type': $names[] = 'c_type';break;
960  case 'mode': $names[] = 'c_mode';break;
961  case 'language': $names[] = 'c_language';break;
962  case 'condition': $names[] = 'c_condition';break;
963  case 'operator': $names[] = 'c_operator';break;
964  case 'condition': $names[] = 'c_condition';break;
965  case 'readnormalizedmeasure': $names[] = 'readnormalmeasure';break;
966  case 'writenormalizedmeasure': $names[] = 'writenormalmeasure';break;
967  case 'minnormalizedmeasure': $names[] = 'minnormalmeasure';break;
968  case 'primary': $names[] = 'c_primary';break;
969  case 'minnormalizedmeasure': $names[] = 'minnormalmeasure';break;
970  case 'persistpreviousattempts': $names[] = 'persistprevattempts';break;
971  case 'identifier': $names[] = 'c_identifier';break;
972  case 'settings': $names[] = 'c_settings';break;
973  case 'activityabsolutedurationlimit': $names[] = 'activityabsdurlimit';break;
974  case 'activityexperienceddurationlimit': $names[] = 'activityexpdurlimit';break;
975  case 'attemptabsolutedurationlimit': $names[] = 'attemptabsdurlimit';break;
976  case 'measuresatisfactionifactive': $names[] = 'measuresatisfactive';break;
977  case 'objectivemeasureweight': $names[] = 'objectivemeasweight';break;
978  case 'requiredforcompleted': $names[] = 'requiredcompleted';break;
979  case 'requiredforincomplete': $names[] = 'requiredincomplete';break;
980  case 'requiredfornotsatisfied': $names[] = 'requirednotsatisfied';break;
981  case 'rollupobjectivesatisfied': $names[] = 'rollupobjectivesatis';break;
982  case 'rollupprogresscompletion': $names[] = 'rollupprogcompletion';break;
983  case 'usecurrentattemptobjectiveinfo': $names[] = 'usecurattemptobjinfo';break;
984  case 'usecurrentattemptprogressinfo': $names[] = 'usecurattemptproginfo';break;
985  default: $names[] = strtolower($attr->name);break;
986  }
987 
988  if (in_array(
989  $names[count($names) - 1],
990  array('flow', 'completionbycontent',
991  'objectivebycontent', 'rollupobjectivesatis',
992  'tracked', 'choice',
993  'choiceexit', 'satisfiedbymeasure',
994  'c_primary', 'constrainchoice',
995  'forwardonly', 'global_to_system',
996  'writenormalmeasure', 'writesatisfiedstatus',
997  'readnormalmeasure', 'readsatisfiedstatus',
998  'preventactivation', 'measuresatisfactive',
999  'reorderchildren', 'usecurattemptproginfo',
1000  'usecurattemptobjinfo', 'rollupprogcompletion',
1001  'read_shared_data', 'write_shared_data',
1002  'shared_data_global_to_system', 'completedbymeasure')
1003  )) {
1004  if ($attr->value == 'true') {
1005  $values[] = 1;
1006  } elseif ($attr->value == 'false') {
1007  $values[] = 0;
1008  } else {
1009  $values[] = (int) $attr->value;
1010  }
1011  } else {
1012  $values[] = $attr->value;
1013  }
1014 
1015  if (in_array(
1016  $names[count($names) - 1],
1017  array('objectivesglobtosys', 'attemptlimit',
1018  'flow', 'completionbycontent',
1019  'objectivebycontent', 'rollupobjectivesatis',
1020  'tracked', 'choice',
1021  'choiceexit', 'satisfiedbymeasure',
1022  'c_primary', 'constrainchoice',
1023  'forwardonly', 'global_to_system',
1024  'writenormalmeasure', 'writesatisfiedstatus',
1025  'readnormalmeasure', 'readsatisfiedstatus',
1026  'preventactivation', 'measuresatisfactive',
1027  'reorderchildren', 'usecurattemptproginfo',
1028  'usecurattemptobjinfo', 'rollupprogcompletion',
1029  'read_shared_data', 'write_shared_data',
1030  'shared_data_global_to_system')
1031  )) {
1032  $types[] = 'integer';
1033  } elseif (in_array(
1034  $names[count($names) - 1],
1035  array('jsdata', 'xmldata', 'activitytree', 'data')
1036  )) {
1037  $types[] = 'clob';
1038  } elseif (in_array(
1039  $names[count($names) - 1],
1040  array('objectivemeasweight')
1041  )) {
1042  $types[] = 'float';
1043  } else {
1044  $types[] = 'text';
1045  }
1046  }
1047 
1048  if ($node->nodeName === 'datamap') {
1049  $names[] = 'slm_id';
1051  $types[] = 'integer';
1052 
1053  $names[] = 'sco_node_id';
1054  $values[] = $parent;
1055  $types[] = 'integer';
1056  }
1057 
1058  // we have to change the insert method because of clob fields ($ilDB->manipulate does not work here)
1059  $insert_data = array();
1060  foreach ($names as $key => $db_field) {
1061  $insert_data[$db_field] = array($types[$key], trim($values[$key]));
1062  }
1063  $ilDB->insert('cp_' . strtolower($node->nodeName), $insert_data);
1064 
1065  $node->setAttribute('foreignId', $cp_node_id);
1066  $this->idmap[$node->getAttribute('id')] = $cp_node_id;
1067 
1068  // run sub nodes
1069  foreach ($node->childNodes as $child) {
1070  $this->dbImport($child, $lft, $depth + 1, $cp_node_id); // RECURSION
1071  }
1072 
1073  // update cp_tree (rgt value for pre order walk in sql tree)
1074  $query = 'UPDATE cp_tree SET rgt = %s WHERE child = %s';
1075  $ilDB->manipulateF(
1076  $query,
1077  array('integer', 'integer'),
1078  array($lft++, $cp_node_id)
1079  );
1080 
1081  break;
1082  }
1083  }
1084 
1089  // public function dbAddNew()
1090  // {
1091  // global $DIC;
1092  // $ilDB = $DIC['ilDB'];
1093 //
1094  // $ilDB->insert('cp_package', array(
1095  // 'obj_id' => array('integer', $this->packageId),
1096  // 'xmldata' => array('clob', $x->asXML()),
1097  // 'jsdata' => array('clob', json_encode($j))
1098  // ));
1099 //
1100  // return true;
1101  // }
1102 
1103 
1104  public function removeCMIData()
1105  {
1106  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004DeleteData.php");
1108 
1109  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
1110  ilLPStatusWrapper::_refreshStatus($this->packageId);
1111  }
1112 
1113  public function removeCPData()
1114  {
1115  global $DIC;
1116  $ilDB = $DIC['ilDB'];
1117  $ilLog = $DIC['ilLog'];
1118 
1119  //get relevant nodes
1120  $cp_nodes = array();
1121 
1122  $res = $ilDB->queryF(
1123  'SELECT cp_node.cp_node_id FROM cp_node WHERE cp_node.slm_id = %s',
1124  array('integer'),
1125  array($this->packageId)
1126  );
1127  while ($data = $ilDB->fetchAssoc($res)) {
1128  $cp_nodes[] = $data['cp_node_id'];
1129  }
1130 
1131  //remove package data
1132  foreach (self::$elements['cp'] as $t) {
1133  $t = 'cp_' . $t;
1134 
1135  $in = $ilDB->in(strtolower($t) . '.cp_node_id', $cp_nodes, false, 'integer');
1136  $ilDB->manipulate('DELETE FROM ' . strtolower($t) . ' WHERE ' . $in);
1137  }
1138 
1139  // remove CP structure entries in tree and node
1140  $ilDB->manipulateF(
1141  'DELETE FROM cp_tree WHERE cp_tree.obj_id = %s',
1142  array('integer'),
1143  array($this->packageId)
1144  );
1145 
1146  $ilDB->manipulateF(
1147  'DELETE FROM cp_node WHERE cp_node.slm_id = %s',
1148  array('integer'),
1149  array($this->packageId)
1150  );
1151 
1152  // remove general package entry
1153  $ilDB->manipulateF(
1154  'DELETE FROM cp_package WHERE cp_package.obj_id = %s',
1155  array('integer'),
1156  array($this->packageId)
1157  );
1158  }
1159 
1160  public function dbRemoveAll()
1161  {
1162  //dont change order of calls
1163  $this->removeCMIData();
1164  $this->removeCPData();
1165  }
1166 
1167  public function transform($inputdoc, $xslfile, $outputpath = null)
1168  {
1169  $xsl = new DOMDocument;
1170  $xsl->async = false;
1171  if (!@$xsl->load($xslfile)) {
1172  die('ERROR: load StyleSheet ' . $xslfile);
1173  }
1174  $prc = new XSLTProcessor;
1175  $prc->registerPHPFunctions();
1176  $r = @$prc->importStyleSheet($xsl);
1177  if (false === @$prc->importStyleSheet($xsl)) {
1178  die('ERROR: importStyleSheet ' . $xslfile);
1179  }
1180  if ($outputpath) {
1181  file_put_contents($outputpath, $prc->transformToXML($inputdoc));
1182  } else {
1183  return $prc->transformToDoc($inputdoc);
1184  }
1185  }
1186 
1187  public function validate($doc, $schema)
1188  {
1189  libxml_use_internal_errors(true);
1190  $return = @$doc->schemaValidate($schema);
1191  if (!$return) {
1192  $levels = array(
1193  LIBXML_ERR_ERROR => 'Error',
1194  LIBXML_ERR_FATAL => 'Fatal Error'
1195  );
1196  foreach (libxml_get_errors() as $error) {
1197  $level = $levels[$error->level];
1198  if (isset($level)) {
1199  $message = trim($error->message);
1200  $this->diagnostic[] = "XSLT $level (Line $error->line) $message";
1201  }
1202  }
1203  libxml_clear_errors();
1204  }
1205  libxml_use_internal_errors(false);
1206  return $return;
1207  }
1208 
1209  //to be called from IlObjUser
1210  public static function _removeTrackingDataForUser($user_id)
1211  {
1212  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004DeleteData.php");
1214  //missing updatestatus
1215  }
1216 }
Class ilSCORM2004PageNode.
dbImportSco($slm, $sco, $asset=false)
$path
Definition: aliased.php:25
Content Object Parser.
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
put this object into content object tree
static getMimeType($a_file, $a_external=null)
get mime type for file
Class ilSCORM2004Sco.
dbImportLM($node, $parent_id="", $a_import_sequencing=false)
$result
transform($inputdoc, $xslfile, $outputpath=null)
jsonNode($node, &$sink)
Helper for UploadAndImport Recursively copies values from XML into PHP array for export as json Eleme...
dbImport($node, &$lft=1, $depth=1, $parent=0)
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
global $DIC
Definition: saml.php:7
startParsing()
stores xml data in array
$_GET["client_id"]
removeCMIData()
add new sahs and package record NOT USED
Class ilObjGlossary.
il_import($packageFolder, $packageId, $ilias, $validate, $reimport=false)
Imports an extracted SCORM 2004 module from ilias-data dir into database.
SCORM 13 Metadata importer.
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
Class ilSCORM2004Chapter.
$s
Definition: pwgen.php:45
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static _getDirectory($a_mob_id)
Get absolute directory.
$ilErr
Definition: raiseError.php:18
setSequencingInfo($a_node, $a_seq_info, $a_import_sequencing, $a_fix_obj_id="")
Save sequencing ingo.
$r
Definition: example_031.php:79
catch(Exception $e) $message
exportXML()
Export as internal XML.
foreach($_POST as $key=> $value) $res
il_importAss($packageId, $sco_id, $packageFolder)
Imports an extracted SCORM 2004 module from ilias-data dir into database.
const IL_MO_PARSE_QTI
Class ilSCORM2004Page.
setProgress($progress, $msg='')
$values
Class ilMediaItem.
Class ilObjMediaObject.
static _removeTrackingDataForUser($user_id)
$query
$n
Definition: RandomTest.php:85
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
il_importLM($slm, $packageFolder, $a_import_sequencing=false)
Class ilSCORM2004Sequencing.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static _lookupType($a_id, $a_reference=false)
lookup object type
setTreeTablePK($a_column_name)
set column containing primary key in tree table public
$filename
Definition: buildRTE.php:89
$row
static _writeDescription($a_obj_id, $a_desc)
write description to db (static)
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
const IL_EXT_LINK
static utf8_encode($string)
utf8-encodes string if it is not a valid utf8-string.
Class ilMapArea.
validate($doc, $schema)
$lm_set
global $l
Definition: afr.php:30
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
Class ilObjSCORM2004LearningModule.
__construct($packageId=null)
global $ilDB
Class ilSCORM2004Asset.
il_importSco($packageId, $sco_id, $packageFolder)
Imports an extracted SCORM 2004 module from ilias-data dir into database.
static recursive_dirscan($dir, &$arr)
Recursively scans a given directory and writes path and filename into referenced array.
const IL_MO_VERIFY_QTI
static removeCMIDataForPackage($packageId)
$key
Definition: croninfo.php:18
$x
Definition: complexTest.php:9
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
importGlossary($slm, $packageFolder)
$data
Definition: bench.php:6