ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilSCORM2004StoreData.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
27 {
28  public static function scormPlayerUnload(int $packageId, int $refId, bool $time_from_lms, ?int $userId = null): void
29  {
30  global $DIC;
31 
32  $ilDB = $DIC->database();
33 
34  // $data = json_decode(is_string($data) ? $data : file_get_contents('php://input'));
35  $data = json_decode(file_get_contents('php://input'));
36  if (!$data) {
37  return;
38  }
39  if ($userId == null) {
40  $userId = (int) $data->p;
41  self::checkIfAllowed($packageId, $userId, $data->hash);
42  }
43  $last_visited = null;
44  if ($data->last != "") {
45  $last_visited = $data->last;
46  }
47  $endDate = date(
48  'Y-m-d H:i:s',
49  mktime(
50  (int) date('H'),
51  (int) date('i') + 5,
52  (int) date('s'),
53  (int) date('m'),
54  (int) date('d'),
55  (int) date('Y')
56  )
57  );
58  $total_time_sec = null;
59  if ($data->total_time_sec != "") {
60  $total_time_sec = $data->total_time_sec;
61  $ilDB->manipulateF(
62  'UPDATE sahs_user
63  SET total_time_sec = %s, last_visited = %s, hash_end =%s, last_access = %s
64  WHERE obj_id = %s AND user_id = %s',
65  array('integer', 'text', 'timestamp', 'timestamp', 'integer', 'integer'),
66  array($total_time_sec, $last_visited, $endDate, date('Y-m-d H:i:s'), $packageId, $userId)
67  );
68  if ($time_from_lms == true) {
69  self::ensureObjectDataCacheExistence();
70  global $DIC;
71 
72  $ilObjDataCache = $DIC["ilObjDataCache"];
73  // sync access number and time in read event table
74  ilSCORM2004Tracking::_syncReadEvent($packageId, $userId, "sahs", $refId, $time_from_lms);
75  //end sync access number and time in read event table
76  }
77  } else {
78  $ilDB->manipulateF(
79  'UPDATE sahs_user
80  SET last_visited = %s, hash_end =%s, last_access = %s
81  WHERE obj_id = %s AND user_id = %s',
82  array('text', 'timestamp', 'timestamp', 'integer', 'integer'),
83  array($last_visited, $endDate, date('Y-m-d H:i:s'), $packageId, $userId)
84  );
85  }
86 
87  header('Content-Type: text/plain; charset=UTF-8');
88  print("");
89  }
90 
91  public static function checkIfAllowed(int $packageId, int $userId, int $hash): void
92  {
93  global $DIC;
94 
95  $ilDB = $DIC->database();
96  $res = $ilDB->queryF(
97  'select hash from sahs_user where obj_id=%s AND user_id=%s AND hash_end>%s',
98  array('integer', 'integer', 'timestamp'),
99  array($packageId, $userId, date('Y-m-d H:i:s'))
100  );
101  $rowtmp = $ilDB->fetchAssoc($res);
102  if ($rowtmp && (int) $rowtmp['hash'] == $hash) {
103  return;
104  }
105 
106  die("not allowed");
107  }
108 
109  protected static function ensureObjectDataCacheExistence(): void
110  {
114  global $DIC;
115 
116  $ilObjDataCache = $DIC["ilObjDataCache"];
117 
118  if ($ilObjDataCache instanceof ilObjectDataCache) {
119  return;
120  }
121  $ilObjDataCache = new ilObjectDataCache();
122  $GLOBALS['DIC']['ilObjDataCache'] = $ilObjDataCache;
123  }
124 
125  public static function persistCMIData(
126  int $packageId,
127  int $refId,
128  string $defaultLessonMode,
129  bool $comments,
130  bool $interactions,
131  bool $objectives,
132  bool $time_from_lms,
133  ?string $data = null,
134  ?int $userId = null
135  ): void {
136  global $DIC;
137 
138  $ilLog = ilLoggerFactory::getLogger('sc13');
139 
140  if ($defaultLessonMode === "browse") {
141  return;
142  }
143 
144  $jsMode = strpos($_SERVER['HTTP_ACCEPT'], 'text/javascript') !== false;//ToDo: Avoid $_SERVER
145 
146  $data = json_decode(is_string($data) ? $data : file_get_contents('php://input'));
147  $ilLog->debug("dataTo_setCMIData: " . file_get_contents('php://input'));
148  if (!$data) {
149  return;
150  }
151  if ($userId == null) {
152  $userId = (int) $data->p;
153  self::checkIfAllowed($packageId, $userId, $data->hash);
154  // header('Access-Control-Allow-Origin: http://localhost:50012');//just for tests - not for release UK
155  }
157  $userId,
158  $packageId,
159  $data,
160  $comments,
161  $interactions,
162  $objectives
163  );
164 
165  //$new_global_status=ilSCORM2004StoreData::setGlobalObjectivesAndGetGlobalStatus($userId, $packageId, $data);
166  ilSCORM2004StoreData::setGlobalObjectives($userId, $packageId, $data);
167  $new_global_status = $data->now_global_status;
168  $return["new_global_status"] = $new_global_status;
169 
170  // mantis #30293
171  $score_scaled = $data->node[0][35];
172  if ($score_scaled != null) {
174  ilLTIAppEventListener::handleOutcomeWithoutLP($packageId, $userId, $score_scaled * 100);
175  }
176  }
177 
178  ilSCORM2004StoreData::syncGlobalStatus($userId, $packageId, $refId, $data, $new_global_status, $time_from_lms);
179 
180  $ilLog->debug("SCORM: return of persistCMIData: " . json_encode($return));
181  if ($jsMode) {
182  header('Content-Type: text/javascript; charset=UTF-8');
183  print(json_encode($return));
184  } else {
185  header('Content-Type: text/html; charset=UTF-8');
186  print(var_export($return, true));
187  }
188  }
189 
193  public static function setCMIData(
194  int $userId,
195  int $packageId,
196  object $data,
197  bool $getComments,
198  bool $getInteractions,
199  bool $getObjectives
200  ): array {
201  global $DIC;
202 
203  $ilDB = $DIC->database();
204  $ilLog = ilLoggerFactory::getLogger('sc13');
205 
206  $result = array();
207 
208  if (!$data) {
209  return $result;
210  }
211 
212  $i_check = $data->i_check;
213  $i_set = $data->i_set;
214  $b_node_update = false;
215  $cmi_node_id = null;
216  $a_map_cmi_interaction_id = array();
217 
218  $tables = array('node', 'comment', 'interaction', 'objective', 'correct_response');
219 
220  foreach ($tables as $table) {
221  if (!is_array($data->$table)) {
222  continue;
223  }
224 
225  $ilLog->debug("SCORM: setCMIData, table -" . $table . "-");
226 
227  // now iterate through data rows from input
228  foreach ($data->$table as &$row) {
229  $ilLog->debug("Checking table: " . $table);
230 
231  switch ($table) {
232  case 'node': //is always first and has only 1 row
233 
234  $res = $ilDB->queryF(
235  'SELECT cmi_node_id FROM cmi_node WHERE cp_node_id = %s and user_id = %s',
236  array('integer', 'integer'),
237  array($row[19], $userId)
238  );
239  $rowtmp = $ilDB->fetchAssoc($res);
240 
241  if ($rowtmp != null) {
242  $cmi_node_id = $rowtmp['cmi_node_id'];
243  $b_node_update = true;
244  } else {
245  $cmi_node_id = $ilDB->nextId('cmi_node');
246  $b_node_update = false;
247  }
248  $ilLog->debug("setCMIdata with cmi_node_id = " . $cmi_node_id);
249  $a_data = array(
250  'accesscount' => array('integer', $row[0]),
251  'accessduration' => array('text', $row[1]),
252  'accessed' => array('text', $row[2]),
253  'activityabsduration' => array('text', $row[3]),
254  'activityattemptcount' => array('integer', $row[4]),
255  'activityexpduration' => array('text', $row[5]),
256  'activityprogstatus' => array('integer', $row[6]),
257  'attemptabsduration' => array('text', $row[7]),
258  'attemptcomplamount' => array('float', $row[8]),
259  'attemptcomplstatus' => array('integer', $row[9]),
260  'attemptexpduration' => array('text', $row[10]),
261  'attemptprogstatus' => array('integer', $row[11]),
262  'audio_captioning' => array('integer', $row[12]),
263  'audio_level' => array('float', $row[13]),
264  'availablechildren' => array('text', $row[14]),
265  'cmi_node_id' => array('integer', $cmi_node_id),
266  'completion' => array('float', $row[16]),
267  'completion_status' => array('text', $row[17]),
268  'completion_threshold' => array('text', $row[18]),
269  'cp_node_id' => array('integer', $row[19]),
270  'created' => array('text', $row[20]),
271  'credit' => array('text', $row[21]),
272  'delivery_speed' => array('float', $row[22]),
273  'c_entry' => array('text', $row[23]),
274  'c_exit' => array('text', $row[24]),
275  'c_language' => array('text', $row[25]),
276  'launch_data' => array('clob', $row[26]),
277  'learner_name' => array('text', $row[27]),
278  'location' => array('text', $row[28]),
279  'c_max' => array('float', $row[29]),
280  'c_min' => array('float', $row[30]),
281  'c_mode' => array('text', $row[31]),
282  'modified' => array('text', $row[32]),
283  'progress_measure' => array('float', $row[33]),
284  'c_raw' => array('float', $row[34]),
285  'scaled' => array('float', $row[35]),
286  'scaled_passing_score' => array('float', $row[36]),
287  'session_time' => array('text', $row[37]),
288  'success_status' => array('text', $row[38]),
289  'suspend_data' => array('clob', $row[39]),
290  'total_time' => array('text', $row[40]),
291  'user_id' => array('integer', $userId),
292  'c_timestamp' => array('timestamp', date('Y-m-d H:i:s')),
293  'additional_tables' => array('integer', $i_check)
294  );
295 
296  if ($b_node_update == false) {
297  $ilDB->insert('cmi_node', $a_data);
298  $ilLog->debug("inserted");
299  } else {
300  $ilDB->update('cmi_node', $a_data, array('cmi_node_id' => array('integer', $cmi_node_id)));
301  $ilLog->debug("updated");
302  }
303 
304  if ($b_node_update == true) {
305  //remove
306  if ($i_set > 7) {
307  $i_set -= 8;
308  if ($getComments) {
309  $q = 'DELETE FROM cmi_comment WHERE cmi_node_id = %s';
310  $ilDB->manipulateF($q, array('integer'), array($cmi_node_id));
311  }
312  }
313  if ($i_set > 3) {
314  $i_set -= 4;
315  if ($getInteractions) {
316  $q = 'DELETE FROM cmi_correct_response
317  WHERE cmi_interaction_id IN (
318  SELECT cmi_interaction.cmi_interaction_id FROM cmi_interaction WHERE cmi_interaction.cmi_node_id = %s)';
319  $ilDB->manipulateF($q, array('integer'), array($cmi_node_id));
320  }
321  }
322  if ($i_set > 1) {
323  $i_set -= 2;
324  if ($getInteractions) {
325  $q = 'DELETE FROM cmi_interaction WHERE cmi_node_id = %s';
326  $ilDB->manipulateF($q, array('integer'), array($cmi_node_id));
327  }
328  }
329  if ($i_set > 0) {
330  $i_set = 0;
331  if ($getObjectives) {
332  $q = 'DELETE FROM cmi_objective WHERE cmi_node_id = %s';
333  $ilDB->manipulateF($q, array('integer'), array($cmi_node_id));
334  }
335  }
336  //end remove
337  }
338  //to send to client
339  $result[(string) $row[19]] = $cmi_node_id;
340  break;
341 
342  case 'comment':
343  $row[0] = $ilDB->nextId('cmi_comment');
344 
345  $ilDB->insert('cmi_comment', array(
346  'cmi_comment_id' => array('integer', $row[0]),
347  'cmi_node_id' => array('integer', $cmi_node_id),
348  'c_comment' => array('clob', $row[2]),
349  'c_timestamp' => array('text', $row[3]),
350  'location' => array('text', $row[4]),
351  'sourceislms' => array('integer', $row[5])
352  ));
353  break;
354 
355  case 'interaction':
356  $cmi_interaction_id = $ilDB->nextId('cmi_interaction');
357  $a_map_cmi_interaction_id[] = array($row[0], $cmi_interaction_id);
358  $ilDB->insert('cmi_interaction', array(
359  'cmi_interaction_id' => array('integer', $cmi_interaction_id),
360  'cmi_node_id' => array('integer', $cmi_node_id),
361  'description' => array('clob', $row[2]),
362  'id' => array('text', $row[3]),
363  'latency' => array('text', $row[4]),
364  'learner_response' => array('clob', $row[5]),
365  'result' => array('text', $row[6]),
366  'c_timestamp' => array('text', $row[7]),
367  'c_type' => array('text', $row[8]),
368  'weighting' => array('float', $row[9])
369  ));
370  break;
371 
372  case 'objective':
373  $row[2] = $ilDB->nextId('cmi_objective');
374  $cmi_interaction_id = null;
375  if ($row[0] != null) {
376  foreach ($a_map_cmi_interaction_id as $i => $value) {
377  if ($row[0] == $value[0]) {
378  $cmi_interaction_id = $value[1];
379  }
380  }
381  }
382  $ilDB->insert('cmi_objective', array(
383  'cmi_interaction_id' => array('integer', $cmi_interaction_id),
384  'cmi_node_id' => array('integer', $cmi_node_id),
385  'cmi_objective_id' => array('integer', $row[2]),
386  'completion_status' => array('text', $row[3]),
387  'description' => array('clob', $row[4]),
388  'id' => array('text', $row[5]),
389  'c_max' => array('float', $row[6]),
390  'c_min' => array('float', $row[7]),
391  'c_raw' => array('float', $row[8]),
392  'scaled' => array('float', $row[9]),
393  'progress_measure' => array('float', $row[10]),
394  'success_status' => array('text', $row[11]),
395  'scope' => array('text', $row[12])
396  ));
397  break;
398 
399  case 'correct_response':
400  $cmi_interaction_id = null;
401  if ($row[1] !== null) {
402  foreach ($a_map_cmi_interaction_id as $i => $value) {
403  if ($row[1] == $value[0]) {
404  $cmi_interaction_id = $value[1];
405  }
406  }
407  $row[0] = $ilDB->nextId('cmi_correct_response');
408  $ilDB->insert('cmi_correct_response', array(
409  'cmi_correct_resp_id' => array('integer', $row[0]),
410  'cmi_interaction_id' => array('integer', $cmi_interaction_id),
411  'pattern' => array('text', $row[2])
412  ));
413  }
414  break;
415  }
416  }
417  }
418  return $result;
419  }
420 
421  protected static function setGlobalObjectives(int $userId, int $packageId, object $data): void
422  {
423  $ilLog = ilLoggerFactory::getLogger('sc13');
424  $changed_seq_utilities = $data->changed_seq_utilities;
425  $ilLog->debug("SCORM2004 adl_seq_utilities changed: " . $changed_seq_utilities);
426  if ($changed_seq_utilities == 1) {
427  $returnAr = ilSCORM2004StoreData::writeGObjective($userId, $packageId, (array) $data->adl_seq_utilities);
428  }
429  }
430 
431 
432  //saves global_objectives to database
433  //$dowrite only if changed adl_seq_utilities
437  public static function writeGObjective(int $user, int $package, ?array $g_data): array
438  {
439  global $DIC;
440  $ilDB = $DIC->database();
441  $ilLog = ilLoggerFactory::getLogger('sc13');
442  $ilLog->debug("SCORM2004 writeGObjective");
443 
444  $returnAr = array(null, null, null);
445 
446  //iterate over assoziative array
447  if ($g_data == null) {
448  return $returnAr;
449  }
450 
451  $rows_to_insert = array();
452 
453  foreach ($g_data as $key => $value) {
454  $ilLog->debug("SCORM2004 writeGObjective -key: " . $key);
455  //objective
456  //learner = ilias learner id
457  //scope = null / course
458  foreach ($value as $skey => $svalue) {
459  $ilLog->debug("SCORM2004 writeGObjective -skey: " . $skey);
460  //we always have objective and learner id
461 // var_dump($svalue->$user->{"null"});
462 // die();
463 // if ($g_data->$key->$skey->$user->$package) { //check
464 // $o_value = $g_data->$key->$skey->$user->$package;
465 // $scope = $package;
466 // } else { //UK: is this okay? can $scope=0 and $user->{"null"}; when is $scope used?
467 // //scope 0
468 // $o_value = $g_data->$key->$skey->$user->{"null"};
469 // //has to be converted to NULL in JS Later
470 // $scope = 0;
471 // }
472  if (isset($svalue->$user->$package)) {
473  $o_value = $svalue->$user->$package;
474  $scope = $package;
475  } else { //UK: is this okay? can $scope=0 and $user->{"null"}; when is $scope used?
476  //scope 0
477  $o_value = null;
478  //has to be converted to NULL in JS Later
479  $scope = 0;
480  }
481 
482  //insert into database
483  $objective_id = $skey;
484  $toset = $o_value;
485  $dbuser = $user;
486  if ($key === "status") {
487  //special handling for status
488 // $completed = $g_data->$key->$skey->$user->{"completed"};
489 // $measure = $g_data->$key->$skey->$user->{"measure"};
490 // $satisfied = $g_data->$key->$skey->$user->{"satisfied"};
491  $completed = $svalue->$user->{"completed"};
492  $measure = $svalue->$user->{"measure"};
493  $satisfied = $svalue->$user->{"satisfied"};
494 
495  $returnAr = array($completed, $satisfied, $measure);
496 
497  $obj = '-course_overall_status-';
498  $pkg_id = $package;
499 
500  $res = $ilDB->queryF(
501  '
502  SELECT user_id FROM cmi_gobjective
503  WHERE objective_id =%s
504  AND user_id = %s
505  AND scope_id = %s',
506  array('text', 'integer', 'integer'),
507  array($obj, $dbuser, $pkg_id)
508  );
509  $ilLog->debug("SCORM2004 Count is: " . $ilDB->numRows($res));
510  if (!$ilDB->numRows($res)) {
511  $ilDB->manipulateF(
512  '
513  INSERT INTO cmi_gobjective
514  (user_id, status, scope_id, measure, satisfied, objective_id)
515  VALUES (%s, %s, %s, %s, %s, %s)',
516  array('integer', 'text', 'integer', 'text', 'text', 'text'),
517  array($dbuser, $completed, $pkg_id, $measure, $satisfied, $obj)
518  );
519  $ilLog->debug("SCORM2004 cmi_gobjective Insert status=" . $completed . " scope_id=" . $pkg_id . " measure=" . $measure . " satisfied=" . $satisfied . " objective_id=" . $obj);
520  } else {
521  $ilDB->manipulateF(
522  '
523  UPDATE cmi_gobjective
524  SET status = %s,
525  measure = %s,
526  satisfied = %s
527  WHERE objective_id = %s
528  AND user_id = %s
529  AND scope_id = %s',
530  array('text', 'text', 'text', 'text', 'integer', 'integer'),
531  array($completed, $measure, $satisfied, $obj, $dbuser, $pkg_id)
532  );
533 // $ilLog->debug("SCORM2004 cmi_gobjective Update status=" . $completed . " scope_id=" . $pkg_id . " measure=" . $measure . " satisfied=" . $satisfied . " objective_id=" . $obj);
534  }
535  } else { //add it to the rows_to_insert
536  //create the row if this is the first time it has been found
537  if ($rows_to_insert[$objective_id] == null) {
538  $rows_to_insert[$objective_id] = array();
539  }
540  $rows_to_insert[$objective_id][$key] = $toset;
541  }
542  }
543  }
544 
545  //Get the scope for all the global objectives!!!
546  $res = $ilDB->queryF(
547  "SELECT global_to_system FROM cp_package WHERE obj_id = %s",
548  array('text'),
549  array($package)
550  );
551 
552  $scope_id = ($ilDB->fetchObject($res)->global_to_system) ? 0 : $package;
553 
554  //build up the set to look for in the query
555  $existing_key_template = "";
556  foreach (array_keys($rows_to_insert) as $obj_id) {
557  $existing_key_template .= "'{$obj_id}',";
558  }
559  //remove trailing ','
560  $existing_key_template = substr($existing_key_template, 0, -1);
561  $existing_keys = array();
562 
563  if ($existing_key_template != "") {
564  //Get the ones that need to be updated in a single query
565  $res = $ilDB->queryF(
566  "SELECT objective_id
567  FROM cmi_gobjective
568  WHERE user_id = %s
569  AND scope_id = %s
570  AND objective_id IN ($existing_key_template)",
571  array('integer', 'integer'),
572  array($dbuser, $scope_id)
573  );
574 
575  while ($row = $ilDB->fetchAssoc($res)) {
576  $existing_keys[] = $row['objective_id'];
577  }
578  }
579 
580  foreach ($rows_to_insert as $obj_id => $vals) {
581  if (in_array($obj_id, $existing_keys)) {
582  $ilDB->manipulateF(
583  "UPDATE cmi_gobjective
584  SET satisfied=%s,
585  measure=%s,
586  score_raw=%s,
587  score_min=%s,
588  score_max=%s,
589  completion_status=%s,
590  progress_measure=%s
591  WHERE objective_id = %s
592  AND user_id = %s
593  AND scope_id = %s",
594  array('text',
595  'text',
596  'text',
597  'text',
598  'text',
599  'text',
600  'text',
601  'text',
602  'integer',
603  'integer'
604  ),
605  array($vals['satisfied'],
606  $vals["measure"],
607  $vals["score_raw"],
608  $vals["score_min"],
609  $vals["score_max"],
610  $vals["completion_status"],
611  $vals["progress_measure"],
612  $obj_id,
613  $dbuser,
614  $scope_id
615  )
616  );
617  } else {
618  $ilDB->manipulateF(
619  "INSERT INTO cmi_gobjective
620  (user_id, satisfied, measure, scope_id, status, objective_id,
621  score_raw, score_min, score_max, progress_measure, completion_status)
622  VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
623  array('integer',
624  'text',
625  'text',
626  'integer',
627  'text',
628  'text',
629  'text',
630  'text',
631  'text',
632  'text',
633  'text'
634  ),
635  array($dbuser,
636  $vals['satisfied'],
637  $vals['measure'],
638  $scope_id,
639  null,
640  $obj_id,
641  $vals['score_raw'],
642  $vals['score_min'],
643  $vals['score_max'],
644  $vals['progress_measure'],
645  $vals['completion_status']
646  )
647  );
648  }
649  }
650 
651  // update learning progress here not necessary because integrated in setCMIdata
652  // check _updateStatus for cmi_gobjective
653  // ilLPStatusWrapper::_updateStatus($package, $user);
654 
655  return $returnAr;
656  }
657 
658  public static function syncGlobalStatus(int $userId, int $packageId, int $refId, object $data, int $new_global_status, bool $time_from_lms): void
659  {
660  global $DIC;
661  $ilDB = $DIC->database();
662  $ilLog = $DIC["ilLog"];
663  $saved_global_status = $data->saved_global_status;
664  $ilLog->write("saved_global_status=" . $saved_global_status);
665 
666  //update percentage_completed, sco_total_time_sec,status in sahs_user
667  $totalTime = (int) $data->totalTimeCentisec;
668  $totalTime = round($totalTime / 100);
669  $ilDB->queryF(
670  'UPDATE sahs_user SET sco_total_time_sec=%s, status=%s, percentage_completed=%s WHERE obj_id = %s AND user_id = %s',
671  array('integer', 'integer', 'integer', 'integer', 'integer'),
672  array($totalTime, $new_global_status, $data->percentageCompleted, $packageId, $userId)
673  );
674 
675  self::ensureObjectDataCacheExistence();
676 
677  $ilObjDataCache = $DIC["ilObjDataCache"];
678 
679  // update learning progress
680  if ($new_global_status != null) {//could only happen when synchronising from SCORM Offline Player
681  ilLPStatus::writeStatus($packageId, $userId, $new_global_status, (int) $data->percentageCompleted);
682 
683  // here put code for soap to MaxCMS e.g. when if($saved_global_status != $new_global_status)
684  }
685  // sync access number and time in read event table
686  if ($time_from_lms == false) {
687  ilSCORM2004Tracking::_syncReadEvent($packageId, $userId, "sahs", $refId, $time_from_lms);
688  }
689  //end sync access number and time in read event table
690  }
691 }
static persistCMIData(int $packageId, int $refId, string $defaultLessonMode, bool $comments, bool $interactions, bool $objectives, bool $time_from_lms, ?string $data=null, ?int $userId=null)
$res
Definition: ltiservices.php:69
$time_from_lms
$scope
Definition: ltiregstart.php:53
static getLogger(string $a_component_id)
Get component logger.
if($DIC->http() ->wrapper() ->query() ->has('do')) $defaultLessonMode
$packageId
Definition: storeScorm.php:25
static checkIfAllowed(int $packageId, int $userId, int $hash)
$refId
Definition: xapitoken.php:58
static setCMIData(int $userId, int $packageId, object $data, bool $getComments, bool $getInteractions, bool $getObjectives)
$interactions
static syncGlobalStatus(int $userId, int $packageId, int $refId, object $data, int $new_global_status, bool $time_from_lms)
static writeGObjective(int $user, int $package, ?array $g_data)
Class ilSCORM2004StoreData.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
$objectives
static scormPlayerUnload(int $packageId, int $refId, bool $time_from_lms, ?int $userId=null)
static setGlobalObjectives(int $userId, int $packageId, object $data)
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
string $key
Consumer key/client ID value.
Definition: System.php:193
$comments
static handleOutcomeWithoutLP(int $a_obj_id, int $a_usr_id, ?float $a_percentage)
static _syncReadEvent(int $a_obj_id, int $a_user_id, string $a_type, int $a_ref_id, ?bool $time_from_lms=null)
Synch read event table.
static writeStatus(int $a_obj_id, int $a_user_id, int $a_status, int $a_percentage=0, bool $a_force_per=false, ?int &$a_old_status=self::LP_STATUS_NOT_ATTEMPTED_NUM)
Write status for user and object.
$i
Definition: metadata.php:41