ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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
 
 $manifest
 
array $diagnostic
 
int $packageId
 
string $packageName = ""
 
string $packageHash = ""
 
int $userId
 

Private Attributes

string $packageFolder
 
string $packagesFolder
 
array $packageData = []
 
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 87 of file ilSCORM13Package.php.

References load().

88  {
89  $this->packagesFolder = ''; // #25372
90  if ($packageId != null) {
91  $this->load($packageId);
92  }
93  }
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 595 of file ilSCORM13Package.php.

References ilSCORM2004DeleteData\removeCMIDataForUser().

Referenced by ilObjUser\delete().

595  : void
596  {
598  }
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 286 of file ilSCORM13Package.php.

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

Referenced by il_import().

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

◆ dbRemoveAll()

ilSCORM13Package::dbRemoveAll ( )

Definition at line 564 of file ilSCORM13Package.php.

References removeCMIData(), and removeCPData().

Referenced by il_import().

564  : void
565  {
566  //dont change order of calls
567  $this->removeCMIData();
568  $this->removeCPData();
569  }
+ 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 117 of file ilSCORM13Package.php.

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

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

References $name.

Referenced by il_import().

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

◆ load()

ilSCORM13Package::load ( int  $packageId)

Definition at line 95 of file ilSCORM13Package.php.

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

Referenced by __construct().

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

◆ removeCMIData()

ilSCORM13Package::removeCMIData ( )

Definition at line 511 of file ilSCORM13Package.php.

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

Referenced by dbRemoveAll().

511  : void
512  {
514  ilLPStatusWrapper::_refreshStatus($this->packageId);
515  }
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 517 of file ilSCORM13Package.php.

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

Referenced by dbRemoveAll().

517  : void
518  {
519  global $DIC;
520  $ilDB = $DIC->database();
521  $ilLog = ilLoggerFactory::getLogger('sc13');
522 
523  //get relevant nodes
524  $cp_nodes = array();
525 
526  $res = $ilDB->queryF(
527  'SELECT cp_node.cp_node_id FROM cp_node WHERE cp_node.slm_id = %s',
528  array('integer'),
529  array($this->packageId)
530  );
531  while ($data = $ilDB->fetchAssoc($res)) {
532  $cp_nodes[] = $data['cp_node_id'];
533  }
534 
535  //remove package data
536  foreach (self::$elements['cp'] as $t) {
537  $t = 'cp_' . $t;
538 
539  $in = $ilDB->in(strtolower($t) . '.cp_node_id', $cp_nodes, false, 'integer');
540  $ilDB->manipulate('DELETE FROM ' . strtolower($t) . ' WHERE ' . $in);
541  }
542 
543  // remove CP structure entries in tree and node
544  $ilDB->manipulateF(
545  'DELETE FROM cp_tree WHERE cp_tree.obj_id = %s',
546  array('integer'),
547  array($this->packageId)
548  );
549 
550  $ilDB->manipulateF(
551  'DELETE FROM cp_node WHERE cp_node.slm_id = %s',
552  array('integer'),
553  array($this->packageId)
554  );
555 
556  // remove general package entry
557  $ilDB->manipulateF(
558  'DELETE FROM cp_package WHERE cp_package.obj_id = %s',
559  array('integer'),
560  array($this->packageId)
561  );
562  }
$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 574 of file ilSCORM13Package.php.

Referenced by il_import().

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

Field Documentation

◆ $diagnostic

array ilSCORM13Package::$diagnostic

Definition at line 49 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 62 of file ilSCORM13Package.php.

◆ $imsmanifest

DOMDocument ilSCORM13Package::$imsmanifest

Definition at line 44 of file ilSCORM13Package.php.

◆ $manifest

ilSCORM13Package::$manifest

Definition at line 48 of file ilSCORM13Package.php.

◆ $packageData

array ilSCORM13Package::$packageData = []
private

Definition at line 40 of file ilSCORM13Package.php.

◆ $packageFolder

string ilSCORM13Package::$packageFolder
private

Definition at line 38 of file ilSCORM13Package.php.

Referenced by il_import().

◆ $packageHash

string ilSCORM13Package::$packageHash = ""

Definition at line 53 of file ilSCORM13Package.php.

◆ $packageId

int ilSCORM13Package::$packageId

Definition at line 51 of file ilSCORM13Package.php.

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

◆ $packageName

string ilSCORM13Package::$packageName = ""

Definition at line 52 of file ilSCORM13Package.php.

◆ $packagesFolder

string ilSCORM13Package::$packagesFolder
private

Definition at line 39 of file ilSCORM13Package.php.

◆ $progress

float ilSCORM13Package::$progress = 0.0
private

Definition at line 57 of file ilSCORM13Package.php.

◆ $userId

int ilSCORM13Package::$userId

Definition at line 54 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: