ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilSCORM13Package Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilSCORM13Package:

Public Member Functions

 __construct (?int $packageId=null)
 
 load (int $packageId)
 
 il_import (string $packageFolder, int $packageId, bool $reimport=false)
 Imports an extracted SCORM 2004 module from ilias-data dir into database. More...
 
 jsonNode (object $node, ?array &$sink)
 Helper for UploadAndImport Recursively copies values from XML into PHP array for export as json Elements are translated into sub array, attributes into literals xml element to process reference to array object where to copy values. More...
 
 dbImport (object $node, ?int &$lft=1, ?int $depth=1, ?int $parent=0)
 
 removeCMIData ()
 
 removeCPData ()
 
 dbRemoveAll ()
 
 transform (\DOMDocument $inputdoc, string $xslfile, ?string $outputpath=null)
 

Static Public Member Functions

static _removeTrackingDataForUser (int $user_id)
 

Data Fields

const DB_ENCODE_XSL = './Modules/Scorm2004/templates/xsl/op/op-scorm13.xsl'
 
const CONVERT_XSL = './Modules/Scorm2004/templates/xsl/op/scorm12To2004.xsl'
 
const DB_DECODE_XSL = './Modules/Scorm2004/templates/xsl/op/op-scorm13-revert.xsl'
 
const VALIDATE_XSD = './libs/ilias/Scorm2004/xsd/op/op-scorm13.xsd'
 
const WRAPPER_HTML = './Modules/Scorm2004/scripts/converter/GenericRunTimeWrapper1.0_aadlc/GenericRunTimeWrapper.htm'
 
const WRAPPER_JS = './Modules/Scorm2004/scripts/converter/GenericRunTimeWrapper1.0_aadlc/SCOPlayerWrapper.js'
 
DOMDocument $imsmanifest
 
bool DOMDocument $manifest
 
array $diagnostic
 
int $packageId
 
string $packageName = ""
 
string $packageHash = ""
 
int $userId
 

Private Attributes

string $packageFolder
 
string $packagesFolder
 
array $packageData = []
 
string $imsmanifestFile
 
array $idmap = []
 
float $progress = 0.0
 

Static Private Attributes

static array $elements
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Hendrik Holtmann holtm.nosp@m.ann@.nosp@m.mac.c.nosp@m.om Alfred Kohnert alfre.nosp@m.d.ko.nosp@m.hnert.nosp@m.@big.nosp@m.foot..nosp@m.com

Definition at line 26 of file ilSCORM13Package.php.

Constructor & Destructor Documentation

◆ __construct()

ilSCORM13Package::__construct ( ?int  $packageId = null)

Definition at line 84 of file ilSCORM13Package.php.

References load().

85  {
86  $this->packagesFolder = ''; // #25372
87  if ($packageId != null) {
88  $this->load($packageId);
89  }
90  }
load(int $packageId)
+ Here is the call graph for this function:

Member Function Documentation

◆ _removeTrackingDataForUser()

static ilSCORM13Package::_removeTrackingDataForUser ( int  $user_id)
static

Definition at line 591 of file ilSCORM13Package.php.

References ilSCORM2004DeleteData\removeCMIDataForUser().

Referenced by ilObjUser\delete().

591  : void
592  {
594  }
static removeCMIDataForUser(int $user_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dbImport()

ilSCORM13Package::dbImport ( object  $node,
?int &  $lft = 1,
?int  $depth = 1,
?int  $parent = 0 
)

Definition at line 283 of file ilSCORM13Package.php.

References $DIC, $ilDB, ILIAS\LTI\ToolProvider\$key, $packageId, $res, and ILIAS\Repository\int().

Referenced by il_import().

283  : void
284  {
285  global $DIC;
286  $ilDB = $DIC->database();
287 
288  switch ($node->nodeType) {
289  case XML_DOCUMENT_NODE:
290 
291  // insert into cp_package
292 
293  $res = $ilDB->queryF(
294  'SELECT * FROM cp_package WHERE obj_id = %s AND c_identifier = %s',
295  array('integer', 'text'),
296  array($this->packageId, $this->packageName)
297  );
298  if ($num_rows = $ilDB->numRows($res)) {
299  $query = 'UPDATE cp_package '
300  . 'SET persistprevattempts = %s, c_settings = %s '
301  . 'WHERE obj_id = %s AND c_identifier= %s';
302  $ilDB->manipulateF(
303  $query,
304  array('integer', 'text', 'integer', 'text'),
305  array(0, null, $this->packageId, $this->packageName)
306  );
307  } else {
308  $query = 'INSERT INTO cp_package (obj_id, c_identifier, persistprevattempts, c_settings) '
309  . 'VALUES (%s, %s, %s, %s)';
310  $ilDB->manipulateF(
311  $query,
312  array('integer','text','integer', 'text'),
313  array($this->packageId, $this->packageName, 0, null)
314  );
315  }
316 
317  // run sub nodes
318  $this->dbImport($node->documentElement); // RECURSION
319  break;
320 
321  case XML_ELEMENT_NODE:
322  if ($node->nodeName === 'manifest') {
323  if ($node->getAttribute('uri') == "") {
324  // default URI is md5 hash of zip file, i.e. packageHash
325  $node->setAttribute('uri', 'md5:' . $this->packageHash);
326  }
327  }
328 
329  $cp_node_id = $ilDB->nextId('cp_node');
330 
331  $query = 'INSERT INTO cp_node (cp_node_id, slm_id, nodename) '
332  . 'VALUES (%s, %s, %s)';
333  $ilDB->manipulateF(
334  $query,
335  array('integer', 'integer', 'text'),
336  array($cp_node_id, $this->packageId, $node->nodeName)
337  );
338 
339  $query = 'INSERT INTO cp_tree (child, depth, lft, obj_id, parent, rgt) '
340  . 'VALUES (%s, %s, %s, %s, %s, %s)';
341  $ilDB->manipulateF(
342  $query,
343  array('integer', 'integer', 'integer', 'integer', 'integer', 'integer'),
344  array($cp_node_id, $depth, $lft++, $this->packageId, $parent, 0)
345  );
346 
347  // insert into cp_*
348  //$a = array('cp_node_id' => $cp_node_id);
349  $names = array('cp_node_id');
350  $values = array($cp_node_id);
351  $types = array('integer');
352 
353  foreach ($node->attributes as $attr) {
354  switch (strtolower($attr->name)) {
355  case 'completionsetbycontent': $names[] = 'completionbycontent';
356  break;
357  case 'objectivesetbycontent': $names[] = 'objectivebycontent';
358  break;
359  case 'type': $names[] = 'c_type';
360  break;
361  case 'mode': $names[] = 'c_mode';
362  break;
363  case 'language': $names[] = 'c_language';
364  break;
365  case 'condition': $names[] = 'c_condition';
366  break;
367  case 'operator': $names[] = 'c_operator';
368  break;
369  case 'readnormalizedmeasure': $names[] = 'readnormalmeasure';
370  break;
371  case 'writenormalizedmeasure': $names[] = 'writenormalmeasure';
372  break;
373  case 'minnormalizedmeasure': $names[] = 'minnormalmeasure';
374  break;
375  case 'primary': $names[] = 'c_primary';
376  break;
377  // case 'minnormalizedmeasure': $names[] = 'minnormalmeasure';break;
378  case 'persistpreviousattempts': $names[] = 'persistprevattempts';
379  break;
380  case 'identifier': $names[] = 'c_identifier';
381  break;
382  case 'settings': $names[] = 'c_settings';
383  break;
384  case 'activityabsolutedurationlimit': $names[] = 'activityabsdurlimit';
385  break;
386  case 'activityexperienceddurationlimit': $names[] = 'activityexpdurlimit';
387  break;
388  case 'attemptabsolutedurationlimit': $names[] = 'attemptabsdurlimit';
389  break;
390  case 'measuresatisfactionifactive': $names[] = 'measuresatisfactive';
391  break;
392  case 'objectivemeasureweight': $names[] = 'objectivemeasweight';
393  break;
394  case 'requiredforcompleted': $names[] = 'requiredcompleted';
395  break;
396  case 'requiredforincomplete': $names[] = 'requiredincomplete';
397  break;
398  case 'requiredfornotsatisfied': $names[] = 'requirednotsatisfied';
399  break;
400  case 'rollupobjectivesatisfied': $names[] = 'rollupobjectivesatis';
401  break;
402  case 'rollupprogresscompletion': $names[] = 'rollupprogcompletion';
403  break;
404  case 'usecurrentattemptobjectiveinfo': $names[] = 'usecurattemptobjinfo';
405  break;
406  case 'usecurrentattemptprogressinfo': $names[] = 'usecurattemptproginfo';
407  break;
408  default: $names[] = strtolower($attr->name);
409  break;
410  }
411 
412  if (in_array(
413  $names[count($names) - 1],
414  array('flow', 'completionbycontent',
415  'objectivebycontent', 'rollupobjectivesatis',
416  'tracked', 'choice',
417  'choiceexit', 'satisfiedbymeasure',
418  'c_primary', 'constrainchoice',
419  'forwardonly', 'global_to_system',
420  'writenormalmeasure', 'writesatisfiedstatus',
421  'readnormalmeasure', 'readsatisfiedstatus',
422  'preventactivation', 'measuresatisfactive',
423  'reorderchildren', 'usecurattemptproginfo',
424  'usecurattemptobjinfo', 'rollupprogcompletion',
425  'read_shared_data', 'write_shared_data',
426  'shared_data_global_to_system', 'completedbymeasure')
427  )) {
428  if ($attr->value === 'true') {
429  $values[] = 1;
430  } elseif ($attr->value === 'false') {
431  $values[] = 0;
432  } else {
433  $values[] = (int) $attr->value;
434  }
435  } else {
436  $values[] = $attr->value;
437  }
438 
439  if (in_array(
440  $names[count($names) - 1],
441  array('objectivesglobtosys', 'attemptlimit',
442  'flow', 'completionbycontent',
443  'objectivebycontent', 'rollupobjectivesatis',
444  'tracked', 'choice',
445  'choiceexit', 'satisfiedbymeasure',
446  'c_primary', 'constrainchoice',
447  'forwardonly', 'global_to_system',
448  'writenormalmeasure', 'writesatisfiedstatus',
449  'readnormalmeasure', 'readsatisfiedstatus',
450  'preventactivation', 'measuresatisfactive',
451  'reorderchildren', 'usecurattemptproginfo',
452  'usecurattemptobjinfo', 'rollupprogcompletion',
453  'read_shared_data', 'write_shared_data',
454  'shared_data_global_to_system')
455  )) {
456  $types[] = 'integer';
457  } elseif (in_array(
458  $names[count($names) - 1],
459  array('jsdata', 'xmldata', 'activitytree', 'data')
460  )) {
461  $types[] = 'clob';
462  } elseif ($names[count($names) - 1] === 'objectivemeasweight') {
463  $types[] = 'float';
464  } else {
465  $types[] = 'text';
466  }
467  }
468 
469  if ($node->nodeName === 'datamap') {
470  $names[] = 'slm_id';
471  $values[] = $this->packageId;
472  $types[] = 'integer';
473 
474  $names[] = 'sco_node_id';
475  $values[] = $parent;
476  $types[] = 'integer';
477  }
478 
479  // we have to change the insert method because of clob fields ($ilDB->manipulate does not work here)
480  $insert_data = array();
481  foreach ($names as $key => $db_field) {
482  $insert_data[$db_field] = array($types[$key], trim((string) $values[$key]));
483  }
484  $ilDB->insert('cp_' . strtolower($node->nodeName), $insert_data);
485 
486  $node->setAttribute('foreignId', (string) $cp_node_id);
487  $this->idmap[$node->getAttribute('id')] = $cp_node_id;
488 
489  // run sub nodes
490  foreach ($node->childNodes as $child) {
491  $this->dbImport($child, $lft, $depth + 1, $cp_node_id); // RECURSION
492  }
493 
494  // update cp_tree (rgt value for pre order walk in sql tree)
495  $query = 'UPDATE cp_tree SET rgt = %s WHERE child = %s';
496  $ilDB->manipulateF(
497  $query,
498  array('integer', 'integer'),
499  array($lft++, $cp_node_id)
500  );
501 
502  break;
503  }
504  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
dbImport(object $node, ?int &$lft=1, ?int $depth=1, ?int $parent=0)
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dbRemoveAll()

ilSCORM13Package::dbRemoveAll ( )

Definition at line 560 of file ilSCORM13Package.php.

References removeCMIData(), and removeCPData().

Referenced by il_import().

560  : void
561  {
562  //dont change order of calls
563  $this->removeCMIData();
564  $this->removeCPData();
565  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ il_import()

ilSCORM13Package::il_import ( string  $packageFolder,
int  $packageId,
bool  $reimport = false 
)

Imports an extracted SCORM 2004 module from ilias-data dir into database.

Returns
string|false title of package or false
Exceptions
ilSaxParserException

Definition at line 114 of file ilSCORM13Package.php.

References Vendor\Package\$b, $DIC, $ilDB, $ilErr, $packageFolder, $packageId, $path, $r, $res, ilObject\_lookupType(), ilObject\_writeDescription(), dbImport(), dbRemoveAll(), ilLoggerFactory\getLogger(), jsonNode(), ilUtil\stripSlashes(), and transform().

114  : bool|string
115  {
116  global $DIC;
117  $ilDB = $DIC->database();
118  $ilLog = ilLoggerFactory::getLogger('sc13');
119  $ilErr = $DIC['ilErr'];
120 
121  $title = "";
122 
123  if ($reimport === true) {
124  $this->packageId = $packageId;
125  $this->dbRemoveAll();
126  }
127 
128  $this->packageData['persistprevattempts'] = 0;
129  $this->packageData['default_lesson_mode'] = 'normal';
130  $this->packageData['credit'] = 'credit';
131  $this->packageData['auto_review'] = 'n';
132 
133  $this->packageFolder = $packageFolder;
134  $this->packageId = $packageId;
135  $this->imsmanifestFile = $this->packageFolder . '/' . 'imsmanifest.xml';
136  //step 1 - parse Manifest-File and validate
137  $this->imsmanifest = new DOMDocument();
138  // $this->imsmanifest->async = false;
139  if (!@$this->imsmanifest->load($this->imsmanifestFile)) {
140  $this->diagnostic[] = 'XML not wellformed';
141  return false;
142  }
143 
144  //step 2 tranform
145  $this->manifest = $this->transform($this->imsmanifest, self::DB_ENCODE_XSL);
146 
147  if (!$this->manifest) {
148  $this->diagnostic[] = 'Cannot transform into normalized manifest';
149  return false;
150  }
151  //setp 2.5 if only a single item, make sure the scormType of it's linked resource is SCO
152  $path = new DOMXpath($this->manifest);
153  $path->registerNamespace("scorm", "http://www.openpalms.net/scorm/scorm13");
154  $items = $path->query("//scorm:item");
155  if ($items->length == 1) {
156  $n = $items->item(0);
157  $resource = $path->query("//scorm:resource");//[&id='"+$n->getAttribute("resourceId")+"']");
158  foreach ($resource as $res) {
159  if ($n !== null && $res->getAttribute('id') == $n->getAttribute("resourceId")) {
160  $res->setAttribute('scormType', 'sco');
161  }
162  }
163  }
164  $this->dbImport($this->manifest);
165 
166  if (file_exists($this->packageFolder . '/' . 'index.xml')) {
167  $doc = simplexml_load_file($this->packageFolder . '/' . 'index.xml');//PHP8Review: This may cause no trouble here but i still worth a look: https://bugs.php.net/bug.php?id=62577
168  $l = $doc->xpath("/ContentObject/MetaData");
169  if ($l[0]) {
170  $mdxml = new ilMDXMLCopier($l[0]->asXML(), $packageId, $packageId, ilObject::_lookupType($packageId));
171  $mdxml->startParsing();
172  $mdo = $mdxml->getMDObject();
173  if ($mdo) {
174  $mdo->update();
175  }
176  }
177  } else {
178  $importer = new ilSCORM13MDImporter($this->imsmanifest, $packageId);
179  $importer->import();
180  $title = $importer->getTitle();
181  $description = $importer->getDescription();
182  if ($description != "") {
184  }
185  }
186 
187  //step 5
188  $x = simplexml_load_string($this->manifest->saveXML());
189  $x['persistPreviousAttempts'] = $this->packageData['persistprevattempts'];
190  // $x['online'] = !$this->getOfflineStatus();//$this->packageData['c_online'];
191 
192  $x['defaultLessonMode'] = $this->packageData['default_lesson_mode'];
193  $x['credit'] = $this->packageData['credit'];
194  $x['autoReview'] = $this->packageData['auto_review'];
195  $j = array();
196  // first read resources into flat array to resolve item/identifierref later
197  $r = array();
198  foreach ($x->resource as $xe) {
199  $r[strval($xe['id'])] = $xe;
200  unset($xe);
201  }
202  // iterate through items and set href and scoType as activity attributes
203  foreach ($x->xpath('//*[local-name()="item"]') as $xe) {
204  // get reference to resource and set href accordingly
205  if ($b = ($r[strval($xe['resourceId'])] ?? false)) {
206  $xe['href'] = strval($b['base']) . strval($b['href']);
207  unset($xe['resourceId']);
208  if (strval($b['scormType']) === 'sco') {
209  $xe['sco'] = true;
210  }
211  }
212  }
213  // iterate recursivly through activities and build up simple php object
214  // with items and associated sequencings
215  // top node is the default organization which is handled as an item
216  $this->jsonNode($x->organization, $j['item']);
217  foreach ($x->sequencing as $s) {
218  $this->jsonNode($s, $j['sequencing'][]);
219  }
220  // combined manifest+resources xml:base is set as organization base
221  $j['item']['base'] = strval($x['base']);
222  // package folder is base to whole playing process
223  $j['base'] = $packageFolder . '/';
224  $j['foreignId'] = floatval($x['foreignId']); // manifest cp_node_id for associating global (package wide) objectives
225  $j['id'] = strval($x['id']); // manifest id for associating global (package wide) objectives
226  $j['item']['title'] = ilUtil::stripSlashes($j['item']['title']);
227  for($i = 0; $i < count($j['item']['item']); $i++) {
228  $j['item']['item'][$i]['title'] = ilUtil::stripSlashes($j['item']['item'][$i]['title']);
229  }
230 
231  //last step - build ADL Activity tree
232  $act = new SeqTreeBuilder();
233  $adl_tree = $act->buildNodeSeqTree($this->imsmanifestFile);
234  $ilDB->update(
235  'cp_package',
236  array(
237  'xmldata' => array('clob', $x->asXML()),
238  'jsdata' => array('clob', json_encode($j)),
239  'activitytree' => array('clob', json_encode($adl_tree['tree'])),
240  'global_to_system' => array('integer', (int) $adl_tree['global']),
241  'shared_data_global_to_system' => array('integer', (int) $adl_tree['dataglobal'])
242  ),
243  array(
244  'obj_id' => array('integer', (int) $this->packageId)
245  )
246  );
247 
248  // title retrieved by importer
249  if ($title != "") {
250  return $title;
251  }
252 
253  return $j['item']['title'];
254  }
$res
Definition: ltiservices.php:69
static getLogger(string $a_component_id)
Get component logger.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ilErr
Definition: raiseError.php:17
$path
Definition: ltiservices.php:32
global $DIC
Definition: feed.php:28
dbImport(object $node, ?int &$lft=1, ?int $depth=1, ?int $parent=0)
jsonNode(object $node, ?array &$sink)
Helper for UploadAndImport Recursively copies values from XML into PHP array for export as json Eleme...
transform(\DOMDocument $inputdoc, string $xslfile, ?string $outputpath=null)
static _lookupType(int $id, bool $reference=false)
static _writeDescription(int $obj_id, string $desc)
write description to db (static)
$r
+ Here is the call graph for this function:

◆ jsonNode()

ilSCORM13Package::jsonNode ( object  $node,
?array &  $sink 
)

Helper for UploadAndImport Recursively copies values from XML into PHP array for export as json Elements are translated into sub array, attributes into literals xml element to process reference to array object where to copy values.

Definition at line 264 of file ilSCORM13Package.php.

Referenced by il_import().

264  : void
265  {
266  foreach ($node->attributes() as $k => $v) {
267  // cast to boolean and number if possible
268  $v = strval($v);
269  if ($v === "true") {
270  $v = true;
271  } elseif ($v === "false") {
272  $v = false;
273  } elseif (is_numeric($v)) {
274  $v = (float) $v;
275  }
276  $sink[$k] = $v;
277  }
278  foreach ($node->children() as $name => $child) {
279  self::jsonNode($child, $sink[$name][]); // RECURSION
280  }
281  }
+ Here is the caller graph for this function:

◆ load()

ilSCORM13Package::load ( int  $packageId)

Definition at line 92 of file ilSCORM13Package.php.

References $DIC, $ilDB, $lm_set, and $packageId.

Referenced by __construct().

92  : void
93  {
94  global $DIC;
95  $ilDB = $DIC->database();
96 
97  $lm_set = $ilDB->queryF('SELECT * FROM sahs_lm WHERE id = %s', array('integer'), array($packageId));
98  $lm_data = $ilDB->fetchAssoc($lm_set);
99  $pg_set = $ilDB->queryF('SELECT * FROM cp_package WHERE obj_id = %s', array('integer'), array($packageId));
100  $pg_data = $ilDB->fetchAssoc($lm_set);
101 
102  $this->packageData = array_merge($lm_data, $pg_data);
103  $this->packageId = $packageId;
104  $this->packageFolder = $this->packagesFolder . '/' . $packageId;
105  // $this->packageFile = $this->packageFolder . '.zip';
106  $this->imsmanifestFile = $this->packageFolder . '/' . 'imsmanifest.xml';
107  }
global $DIC
Definition: feed.php:28
$lm_set
+ Here is the caller graph for this function:

◆ removeCMIData()

ilSCORM13Package::removeCMIData ( )

Definition at line 507 of file ilSCORM13Package.php.

References ilLPStatusWrapper\_refreshStatus(), and ilSCORM2004DeleteData\removeCMIDataForPackage().

Referenced by dbRemoveAll().

507  : void
508  {
510  ilLPStatusWrapper::_refreshStatus($this->packageId);
511  }
static _refreshStatus(int $a_obj_id, ?array $a_users=null)
static removeCMIDataForPackage(int $packageId)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeCPData()

ilSCORM13Package::removeCPData ( )

Definition at line 513 of file ilSCORM13Package.php.

References $data, $DIC, $ilDB, $res, and ilLoggerFactory\getLogger().

Referenced by dbRemoveAll().

513  : void
514  {
515  global $DIC;
516  $ilDB = $DIC->database();
517  $ilLog = ilLoggerFactory::getLogger('sc13');
518 
519  //get relevant nodes
520  $cp_nodes = array();
521 
522  $res = $ilDB->queryF(
523  'SELECT cp_node.cp_node_id FROM cp_node WHERE cp_node.slm_id = %s',
524  array('integer'),
525  array($this->packageId)
526  );
527  while ($data = $ilDB->fetchAssoc($res)) {
528  $cp_nodes[] = $data['cp_node_id'];
529  }
530 
531  //remove package data
532  foreach (self::$elements['cp'] as $t) {
533  $t = 'cp_' . $t;
534 
535  $in = $ilDB->in(strtolower($t) . '.cp_node_id', $cp_nodes, false, 'integer');
536  $ilDB->manipulate('DELETE FROM ' . strtolower($t) . ' WHERE ' . $in);
537  }
538 
539  // remove CP structure entries in tree and node
540  $ilDB->manipulateF(
541  'DELETE FROM cp_tree WHERE cp_tree.obj_id = %s',
542  array('integer'),
543  array($this->packageId)
544  );
545 
546  $ilDB->manipulateF(
547  'DELETE FROM cp_node WHERE cp_node.slm_id = %s',
548  array('integer'),
549  array($this->packageId)
550  );
551 
552  // remove general package entry
553  $ilDB->manipulateF(
554  'DELETE FROM cp_package WHERE cp_package.obj_id = %s',
555  array('integer'),
556  array($this->packageId)
557  );
558  }
$res
Definition: ltiservices.php:69
static getLogger(string $a_component_id)
Get component logger.
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transform()

ilSCORM13Package::transform ( \DOMDocument  $inputdoc,
string  $xslfile,
?string  $outputpath = null 
)
Returns
DOMDocument|false|void

Definition at line 570 of file ilSCORM13Package.php.

References $r.

Referenced by il_import().

571  {
572  $xsl = new DOMDocument();
573  // $xsl->async = false;
574  if (!@$xsl->load($xslfile)) {
575  die('ERROR: load StyleSheet ' . $xslfile);
576  }
577  $prc = new XSLTProcessor();
578  $prc->registerPHPFunctions();
579  $r = @$prc->importStyleSheet($xsl);
580  if (false === @$prc->importStyleSheet($xsl)) {
581  die('ERROR: importStyleSheet ' . $xslfile);
582  }
583  if ($outputpath) {
584  file_put_contents($outputpath, $prc->transformToXML($inputdoc));
585  } else {
586  return $prc->transformToDoc($inputdoc);
587  }
588  }
$r
+ Here is the caller graph for this function:

Field Documentation

◆ $diagnostic

array ilSCORM13Package::$diagnostic

Definition at line 46 of file ilSCORM13Package.php.

◆ $elements

array ilSCORM13Package::$elements
staticprivate
Initial value:
= array(
'cp' => array(
'manifest',
'organization',
'item',
'hideLMSUI',
'resource',
'file',
'dependency',
'sequencing',
'rule',
'auxilaryResource',
'condition',
'mapinfo',
'objective',
),
'cmi' => array(
'comment',
'correct_response',
'interaction',
'node',
'objective',
),
)

Definition at line 59 of file ilSCORM13Package.php.

◆ $idmap

array ilSCORM13Package::$idmap = []
private

Definition at line 53 of file ilSCORM13Package.php.

◆ $imsmanifest

DOMDocument ilSCORM13Package::$imsmanifest

Definition at line 44 of file ilSCORM13Package.php.

◆ $imsmanifestFile

string ilSCORM13Package::$imsmanifestFile
private

Definition at line 42 of file ilSCORM13Package.php.

◆ $manifest

bool DOMDocument ilSCORM13Package::$manifest

Definition at line 45 of file ilSCORM13Package.php.

◆ $packageData

array ilSCORM13Package::$packageData = []
private

Definition at line 39 of file ilSCORM13Package.php.

◆ $packageFolder

string ilSCORM13Package::$packageFolder
private

Definition at line 37 of file ilSCORM13Package.php.

Referenced by il_import().

◆ $packageHash

string ilSCORM13Package::$packageHash = ""

Definition at line 50 of file ilSCORM13Package.php.

◆ $packageId

int ilSCORM13Package::$packageId

Definition at line 48 of file ilSCORM13Package.php.

Referenced by dbImport(), il_import(), and load().

◆ $packageName

string ilSCORM13Package::$packageName = ""

Definition at line 49 of file ilSCORM13Package.php.

◆ $packagesFolder

string ilSCORM13Package::$packagesFolder
private

Definition at line 38 of file ilSCORM13Package.php.

◆ $progress

float ilSCORM13Package::$progress = 0.0
private

Definition at line 54 of file ilSCORM13Package.php.

◆ $userId

int ilSCORM13Package::$userId

Definition at line 51 of file ilSCORM13Package.php.

◆ CONVERT_XSL

const ilSCORM13Package::CONVERT_XSL = './Modules/Scorm2004/templates/xsl/op/scorm12To2004.xsl'

Definition at line 29 of file ilSCORM13Package.php.

◆ DB_DECODE_XSL

const ilSCORM13Package::DB_DECODE_XSL = './Modules/Scorm2004/templates/xsl/op/op-scorm13-revert.xsl'

Definition at line 30 of file ilSCORM13Package.php.

◆ DB_ENCODE_XSL

const ilSCORM13Package::DB_ENCODE_XSL = './Modules/Scorm2004/templates/xsl/op/op-scorm13.xsl'

Definition at line 28 of file ilSCORM13Package.php.

◆ VALIDATE_XSD

const ilSCORM13Package::VALIDATE_XSD = './libs/ilias/Scorm2004/xsd/op/op-scorm13.xsd'

Definition at line 31 of file ilSCORM13Package.php.

◆ WRAPPER_HTML

const ilSCORM13Package::WRAPPER_HTML = './Modules/Scorm2004/scripts/converter/GenericRunTimeWrapper1.0_aadlc/GenericRunTimeWrapper.htm'

Definition at line 33 of file ilSCORM13Package.php.

◆ WRAPPER_JS

const ilSCORM13Package::WRAPPER_JS = './Modules/Scorm2004/scripts/converter/GenericRunTimeWrapper1.0_aadlc/SCOPlayerWrapper.js'

Definition at line 34 of file ilSCORM13Package.php.


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