3 declare(strict_types=1);
36 public function __construct(
int $a_id = 0,
bool $a_call_by_reference =
true)
58 foreach ($childs as $child) {
59 if ($child[
"c_type"] ===
"sit") {
61 if ($sc_item->getIdentifierRef() !=
"") {
79 $needs_convert =
false;
86 $check_for_manifest_file = is_file($manifest_file);
89 if (!$check_for_manifest_file) {
90 $ilErr->raiseError($this->
lng->txt(
"Manifestfile $manifest_file not found!"),
$ilErr->MESSAGE);
94 if ($check_for_manifest_file) {
95 $manifest_file_array = file($manifest_file);
96 foreach ($manifest_file_array as $mfa) {
98 if (@iconv(
'UTF-8',
'UTF-8', $mfa) != $mfa) {
99 $needs_convert =
true;
105 $estimated_manifest_filesize = filesize($manifest_file) * 2;
109 $check_disc_free = 2;
113 if ($needs_convert) {
115 if ($check_for_manifest_file && ($check_disc_free > 1)) {
118 if (!copy($manifest_file, $manifest_file .
".old")) {
119 echo
"Failed to copy $manifest_file...<br>\n";
124 $f_write_handler = fopen($manifest_file .
".new",
"w");
125 $f_read_handler = fopen($manifest_file .
".old",
"r");
126 while (!feof($f_read_handler)) {
127 $zeile = fgets($f_read_handler);
129 fwrite($f_write_handler, utf8_encode($zeile));
131 fclose($f_read_handler);
132 fclose($f_write_handler);
135 if (!copy($manifest_file .
".new", $manifest_file)) {
136 echo
"Failed to copy $manifest_file...<br>\n";
139 if (!@is_file($manifest_file)) {
140 $ilErr->raiseError($this->
lng->txt(
"cont_no_manifest"),
$ilErr->WARNING);
145 if (!($check_disc_free > 1)) {
146 $ilErr->raiseError($this->
lng->txt(
"Not enough space left on device!"),
$ilErr->MESSAGE);
152 $hmani = fopen($manifest_file,
"r");
153 $start = fread($hmani, 3);
154 if (strtolower(bin2hex($start)) ===
"efbbbf") {
155 $f_write_handler = fopen($manifest_file .
".new",
"w");
156 while (!feof($hmani)) {
157 $n = fread($hmani, 900);
158 fwrite($f_write_handler, $n);
160 fclose($f_write_handler);
164 if (!copy($manifest_file .
".new", $manifest_file)) {
165 echo
"Failed to copy $manifest_file...<br>\n";
174 $slmParser->startParsing();
175 return (
string) $slmParser->getPackageTitle();
187 if (
$lm_set->get(
'scorm_lp_auto_activate') != 1) {
198 foreach ($collection->getPossibleItems() as $sco_id => $item) {
201 $collection->activateEntries($scos);
210 $ilDB = $DIC->database();
213 $sco_set =
$ilDB->queryF(
215 SELECT DISTINCT sco_id FROM scorm_tracking WHERE obj_id = %s',
217 array($this->
getId())
221 while ($sco_rec =
$ilDB->fetchAssoc($sco_set)) {
222 $sc_item =
new ilSCORMItem((
int) $sco_rec[
"sco_id"]);
223 if ($sc_item->getIdentifierRef() !=
"") {
262 $ilDB = $DIC->database();
266 $query =
'SELECT user_id, last_access, lastname, firstname FROM sahs_user st ' .
267 'JOIN usr_data ud ON st.user_id = ud.usr_id ' .
268 'WHERE obj_id = ' .
$ilDB->quote($this->
getId(),
'integer');
271 $query .=
' AND ' .
$ilDB->like(
'lastname',
'text',
'%' . $a_search .
'%');
273 $query .=
' GROUP BY user_id, lastname, firstname, last_access';
277 while ($sco_rec =
$ilDB->fetchAssoc($sco_set)) {
292 $ilDB = $DIC->database();
293 $query =
'SELECT user_id, package_attempts FROM sahs_user WHERE obj_id = ' .
$ilDB->quote($this->
getId(),
'integer') .
' ';
298 $attempts[$row[
'user_id']] = (
int) $row[
'package_attempts'];
311 $ilDB = $DIC->database();
312 $val_set =
$ilDB->queryF(
313 'SELECT package_attempts FROM sahs_user WHERE obj_id = %s AND user_id = %s',
314 array(
'integer',
'integer'),
315 array($this->
getId(),$a_user_id)
318 $val_rec =
$ilDB->fetchAssoc($val_set);
320 if ($val_rec[
"package_attempts"] == null) {
321 $val_rec[
"package_attempts"] = 0;
323 return (
int) $val_rec[
"package_attempts"];
332 $ilDB = $DIC->database();
333 $query =
'SELECT user_id, module_version FROM sahs_user WHERE obj_id = ' .
$ilDB->quote($this->
getId(),
'integer') .
' ';
338 $versions[$row[
'user_id']] = (
int) $row[
'module_version'];
349 $ilDB = $DIC->database();
350 $val_set =
$ilDB->queryF(
351 'SELECT module_version FROM sahs_user WHERE obj_id = %s AND user_id = %s',
352 array(
'integer',
'integer'),
353 array($this->
getId(),$a_user_id,0)
356 $val_rec =
$ilDB->fetchAssoc($val_set);
358 if ($val_rec[
"module_version"] == null) {
359 $val_rec[
"module_version"] =
"";
361 return $val_rec[
"module_version"];
370 $ilDB = $DIC->database();
372 $data_set =
$ilDB->queryF(
374 SELECT * FROM scorm_tracking 379 array(
'integer',
'integer',
'integer'),
380 array($a_user_id,$a_sco_id,$this->
getId())
384 while ($data_rec =
$ilDB->fetchAssoc($data_set)) {
394 $ilDB = $DIC->database();
397 $sco_set =
$ilDB->queryF(
399 SELECT DISTINCT sco_id FROM scorm_tracking 403 array(
'integer',
'integer',
'integer'),
404 array($this->
getId(),$a_user_id,0)
408 while ($sco_rec =
$ilDB->fetchAssoc($sco_set)) {
409 $data_set =
$ilDB->queryF(
411 SELECT * FROM scorm_tracking 419 array(
'integer',
'integer',
'integer',
'text',
'text',
'text',
'text'),
420 array($this->
getId(),
424 "cmi.core.lesson_status",
425 "cmi.core.total_time",
426 "cmi.core.score.raw")
429 $score = $time = $status =
"";
431 while ($data_rec =
$ilDB->fetchAssoc($data_set)) {
432 switch ($data_rec[
"lvalue"]) {
433 case "cmi.core.lesson_status":
434 $status = $data_rec[
"rvalue"];
437 case "cmi.core.total_time":
438 $time = $data_rec[
"rvalue"];
441 case "cmi.core.score.raw":
442 $score = $data_rec[
"rvalue"];
446 $sc_item =
new ilSCORMItem((
int) $sco_rec[
"sco_id"]);
447 $data[] = array(
"sco_id" => (
int) $sco_rec[
"sco_id"],
"title" => $sc_item->getTitle(),
448 "score" => $score,
"time" => $time,
"status" => $status);
450 return (array)
$data;
456 $ilDB = $DIC->database();
459 $user_set =
$ilDB->queryF(
461 SELECT DISTINCT user_id FROM scorm_tracking 464 array(
'integer',
'integer'),
465 array($this->
getId(),$a_sco_id)
469 while ($user_rec =
$ilDB->fetchAssoc($user_set)) {
470 $data_set =
$ilDB->queryF(
472 SELECT * FROM scorm_tracking 479 array(
'integer',
'integer',
'integer',
'text',
'text',
'text'),
480 array($this->
getId(),
482 $user_rec[
"user_id"],
483 "cmi.core.lesson_status",
484 "cmi.core.total_time",
485 "cmi.core.score.raw")
488 $score = $time = $status =
"";
490 while ($data_rec =
$ilDB->fetchAssoc($data_set)) {
491 switch ($data_rec[
"lvalue"]) {
492 case "cmi.core.lesson_status":
493 $status = $data_rec[
"rvalue"];
496 case "cmi.core.total_time":
497 $time = $data_rec[
"rvalue"];
500 case "cmi.core.score.raw":
501 $score = $data_rec[
"rvalue"];
506 $data[] = array(
"user_id" => $user_rec[
"user_id"],
507 "score" => $score,
"time" => $time,
"status" => $status);
520 $ilDB = $DIC->database();
523 $allowExportPrivacy = $privacy->enabledExportSCORM();
526 $query =
'SELECT * FROM sahs_user WHERE obj_id = %s';
527 if (count($a_users) > 0) {
528 $query .=
' AND ' .
$ilDB->in(
'user_id', $a_users,
false,
'integer');
533 array($this->
getId())
536 $csv = $csv .
$data[
"obj_id"]
538 .
";" .
$data[
"module_version"]
540 .
";\"" . $data[
"last_access"] .
"\"" 542 .
";" . $data[
"package_attempts"]
543 .
";" . $data[
"percentage_completed"]
544 .
";" . $data[
"sco_total_time_sec"]
549 $header =
"LearningModuleId;LearningModuleTitle;LearningModuleVersion;" . str_replace(
',',
';', $udh[
"cols"]) .
";" 550 .
"LastAccess;Status;Attempts;percentageCompletedSCOs;SumTotal_timeSeconds\n";
558 $ilDB = $DIC->database();
566 $fhandle = fopen($a_file,
"r");
569 $fields = fgetcsv($fhandle, 2 ** 16,
';');
573 switch ($fields[0]) {
575 case "SCO-Identifier":
579 case "LearningModuleId":
591 $ilDB = $DIC->database();
595 $collection = $olp->getCollectionInstance();
597 $scos = $collection->getItems();
600 $fhandle = fopen($a_file,
"r");
602 $obj_id = $this->getID();
603 $fields = fgetcsv($fhandle, 2 ** 16,
';');
605 $usersToDelete = array();
606 while (($csv_rows = fgetcsv($fhandle, 2 ** 16,
";")) !==
false) {
608 $data = array_combine($fields, $csv_rows);
610 if (isset(
$data[
"Login"])) {
613 if (isset(
$data[
"login"])) {
617 if (isset(
$data[
"user"]) && is_numeric(
$data[
"user"])) {
623 if (isset(
$data[
'Date'])) {
624 $date_ex = explode(
'.',
$data[
'Date']);
625 $last_access = implode(
'-', array($date_ex[2], $date_ex[1], $date_ex[0]));
627 if (isset(
$data[
'LastAccess'])) {
628 $last_access =
$data[
'LastAccess'];
633 if (isset(
$data[
"Status"])) {
634 if (is_int(
$data[
"Status"])) {
635 $status =
$data[
"Status"];
636 } elseif (
$data[
"Status"] ==
"0" ||
$data[
"Status"] ==
"1" ||
$data[
"Status"] ==
"2" ||
$data[
"Status"] ==
"3") {
648 if (isset(
$data[
"Attempts"])) {
649 $attempts = (
int)
$data[
"Attempts"];
652 $percentage_completed = 0;
654 $percentage_completed = 100;
656 if (isset(
$data[
'percentageCompletedSCOs'])) {
657 $percentage_completed = (
int)
$data[
'percentageCompletedSCOs'];
660 $sco_total_time_sec = null;
661 if (isset(
$data[
'SumTotal_timeSeconds'])) {
662 $sco_total_time_sec = (
int)
$data[
'SumTotal_timeSeconds'];
666 $usersToDelete[] = $user_id;
668 $this->
importSuccessForSahsUser($user_id, $last_access, $status, $attempts, $percentage_completed, $sco_total_time_sec);
673 foreach ($scos as $sco_id) {
674 $statement =
$ilDB->queryF(
676 SELECT * FROM scorm_tracking 681 array(
'integer',
'integer',
'text',
'integer'),
682 array($user_id, $sco_id,
'cmi.core.lesson_status',$obj_id)
684 if (
$ilDB->numRows($statement) > 0) {
688 'rvalue' => array(
'clob',
'completed'),
689 'c_timestamp' => array(
'timestamp', $last_access)
692 'user_id' => array(
'integer', $user_id),
693 'sco_id' => array(
'integer', $sco_id),
694 'lvalue' => array(
'text',
'cmi.core.lesson_status'),
695 'obj_id' => array(
'integer', $obj_id)
699 $ilDB->insert(
'scorm_tracking', array(
700 'obj_id' => array(
'integer', $obj_id),
701 'user_id' => array(
'integer', $user_id),
702 'sco_id' => array(
'integer', $sco_id),
703 'lvalue' => array(
'text',
'cmi.core.lesson_status'),
704 'rvalue' => array(
'clob',
'completed'),
705 'c_timestamp' => array(
'timestamp', $last_access)
715 if (count($usersToDelete) > 0) {
728 ?
int $attempts = null,
729 ?
int $percentage_completed = null,
730 ?
int $sco_total_time_sec = null
733 $ilDB = $DIC->database();
734 $statement =
$ilDB->queryF(
735 'SELECT * FROM sahs_user WHERE obj_id = %s AND user_id = %s',
736 array(
'integer',
'integer'),
737 array($this->getID(),$user_id)
739 if (
$ilDB->numRows($statement) > 0) {
743 'last_access' => array(
'timestamp', $last_access),
744 'status' => array(
'integer', $status),
745 'package_attempts' => array(
'integer', $attempts),
746 'percentage_completed' => array(
'integer', $percentage_completed),
747 'sco_total_time_sec' => array(
'integer', $sco_total_time_sec)
750 'obj_id' => array(
'integer', $this->getID()),
751 'user_id' => array(
'integer', $user_id)
755 $ilDB->insert(
'sahs_user', array(
756 'obj_id' => array(
'integer', $this->getID()),
757 'user_id' => array(
'integer', $user_id),
758 'last_access' => array(
'timestamp', $last_access),
759 'status' => array(
'integer', $status),
760 'package_attempts' => array(
'integer', $attempts),
761 'percentage_completed' => array(
'integer', $percentage_completed),
762 'sco_total_time_sec' => array(
'integer', $sco_total_time_sec)
767 ilChangeEvent::_recordReadEvent(
"sahs", $DIC->http()->wrapper()->query()->retrieve(
'ref_id', $DIC->refinery()->kindlyTo()->int()), $this->getID(), $user_id,
false);
770 ilChangeEvent::_recordReadEvent(
"sahs", $DIC->http()->wrapper()->query()->retrieve(
'ref_id', $DIC->refinery()->kindlyTo()->int()), $this->getID(), $user_id,
false, $attempts, $sco_total_time_sec);
781 $parts = explode(
'_', $il_id);
783 if (!count((array)
$parts)) {
786 if (!isset($parts[2]) or !isset($parts[3])) {
789 if ($parts[2] !=
$ilSetting->get(
'inst_id', $parts[2])) {
792 return (
int) $parts[3];
801 $ilDB = $DIC->database();
803 $lng = $DIC->language();
806 $fhandle = fopen($a_file,
"r");
808 $fields = fgetcsv($fhandle, 2 ** 16,
';');
810 $a_last_access = array();
812 $a_package_attempts = array();
813 $a_module_version = array();
814 while (($csv_rows = fgetcsv($fhandle, 2 ** 16,
";")) !==
false) {
815 $data = array_combine($fields, $csv_rows);
816 if (
$data[
'Userid']) {
830 if (
$data[
'Scoid']) {
841 if (
$data[
'Timestamp']) {
842 $c_timestamp =
$data[
'Timestamp'];
847 if ($c_timestamp ==
"") {
849 $c_timestamp = $date->getTimestamp();
851 if ($a_last_access[$user_id]) {
852 if ($a_last_access[$user_id] < $c_timestamp) {
853 $a_last_access[$user_id] = $c_timestamp;
856 $a_last_access[$user_id] = $c_timestamp;
863 if (!
$data[
'Value']) {
867 if (
$data[
'Key'] ===
"cmi.core.total_time" &&
$data[
'Value'] !=
"") {
868 $tarr = explode(
":",
$data[
'Value']);
869 $sec = (
int) $tarr[2] + (
int) $tarr[1] * 60 +
870 (
int) substr($tarr[0], strlen($tarr[0]) - 3) * 60 * 60;
871 if ($a_time[$user_id]) {
872 $a_time[$user_id] += $sec;
874 $a_time[$user_id] = $sec;
878 if ($il_sco_id > 0) {
879 $statement =
$ilDB->queryF(
881 SELECT * FROM scorm_tracking 886 array(
'integer',
'integer',
'text',
'integer'),
887 array($user_id, $il_sco_id,
$data[
'Key'], $this->getID())
889 if (
$ilDB->numRows($statement) > 0) {
893 'rvalue' => array(
'clob',
$data[
'Value']),
894 'c_timestamp' => array(
'timestamp', $c_timestamp)
897 'user_id' => array(
'integer', $user_id),
898 'sco_id' => array(
'integer', $il_sco_id),
899 'lvalue' => array(
'text',
$data[
'Key']),
900 'obj_id' => array(
'integer', $this->
getId())
904 $ilDB->insert(
'scorm_tracking', array(
905 'obj_id' => array(
'integer', $this->
getId()),
906 'user_id' => array(
'integer', $user_id),
907 'sco_id' => array(
'integer', $il_sco_id),
908 'lvalue' => array(
'text',
$data[
'Key']),
909 'rvalue' => array(
'clob',
$data[
'Value']),
910 'c_timestamp' => array(
'timestamp',
$data[
'Timestamp'])
915 if ($il_sco_id == 0) {
916 if (
$data[
'Key'] ===
"package_attempts") {
917 $a_package_attempts[$user_id] =
$data[
'Value'];
921 if (!in_array($user_id, $users)) {
927 foreach ($users as $user_id) {
929 if ($a_package_attempts[$user_id]) {
930 $attempts = $a_package_attempts[$user_id];
934 $sco_total_time_sec = null;
935 if ($a_time[$user_id]) {
936 $sco_total_time_sec = $a_time[$user_id];
939 if ($a_last_access[$user_id]) {
940 $last_access = $a_last_access[$user_id];
947 $this->
importSuccessForSahsUser($user_id, $last_access, $status, $attempts, $percentage_completed, $sco_total_time_sec);
960 $ilDB = $DIC->database();
963 $val_set =
$ilDB->queryF(
964 'SELECT * FROM usr_data WHERE(login=%s)',
968 $val_rec =
$ilDB->fetchAssoc($val_set);
970 if (count($val_rec) > 0) {
971 return (
int) $val_rec[
'usr_id'];
983 $ilDB = $DIC->database();
987 if ($a_referrer ==
"0") {
991 $val_set =
$ilDB->queryF(
993 SELECT obj_id FROM sc_item,scorm_tree 994 WHERE (obj_id = child 995 AND identifierref = %s 997 array(
'text',
'integer'),
998 array($a_referrer,$this->getID())
1000 $val_rec =
$ilDB->fetchAssoc($val_set);
1002 return (
int) $val_rec[
"obj_id"];
1011 $ilDB = $DIC->database();
1014 $val_set =
$ilDB->queryF(
1015 'SELECT usr_id FROM usr_data WHERE(email=%s)',
1019 $val_rec =
$ilDB->fetchAssoc($val_set);
1022 return (
int) $val_rec[
"usr_id"];
1046 $ilDB = $DIC->database();
1050 $val_set =
$ilDB->queryF(
1052 SELECT scorm_object.obj_id, 1054 scorm_object.c_type, 1055 scorm_object.slm_id, 1056 scorm_object.obj_id scoid 1057 FROM scorm_object,sc_item,sc_resource 1058 WHERE(scorm_object.slm_id = %s 1059 AND scorm_object.obj_id = sc_item.obj_id 1060 AND sc_item.identifierref = sc_resource.import_id 1061 AND sc_resource.scormtype = %s) 1062 GROUP BY scorm_object.obj_id, 1064 scorm_object.c_type, 1065 scorm_object.slm_id, 1066 scorm_object.obj_id ',
1067 array(
'integer',
'text'),
1071 while ($val_rec =
$ilDB->fetchAssoc($val_set)) {
1072 $scos[] = $val_rec[
'scoid'];
1085 public static function _getStatusForUser(
int $a_id,
int $a_user, array $a_allScoIds,
bool $a_numerical =
false): bool
1088 $ilDB = $DIC->database();
1089 $lng = $DIC->language();
1091 $scos = $a_allScoIds;
1093 $scos_c = implode(
',', $scos);
1095 $val_set =
$ilDB->queryF(
1097 SELECT * FROM scorm_tracking 1100 AND ' .
$ilDB->in(
'sco_id', $scos,
false,
'integer') .
' 1101 AND ((lvalue = %s AND ' .
$ilDB->like(
'rvalue',
'clob',
'completed') .
') 1102 OR (lvalue = %s AND ' .
$ilDB->like(
'rvalue',
'clob',
'passed') .
')))',
1103 array(
'integer',
'integer',
'text',
'text'),
1104 array($a_user,$a_id,
'cmi.core.lesson_status',
'cmi.core.lesson_status')
1106 while ($val_rec =
$ilDB->fetchAssoc($val_set)) {
1107 $key = array_search($val_rec[
'sco_id'], $scos);
1110 $completion =
false;
1112 if (count($scos) == 0) {
1113 $completion = ($a_numerical ===
true) ?
true :
$lng->
txt(
"cont_complete");
1115 if (count($scos) > 0) {
1116 $completion = ($a_numerical ===
true) ?
false :
$lng->
txt(
"cont_incomplete");
1138 $ilDB = $DIC->database();
1142 $val_set =
$ilDB->queryF(
1144 SELECT scorm_object.obj_id, 1146 scorm_object.c_type, 1147 scorm_object.slm_id, 1148 scorm_object.obj_id scoid 1149 FROM scorm_object, sc_item,sc_resource 1150 WHERE(scorm_object.slm_id = %s 1151 AND scorm_object.obj_id = sc_item.obj_id 1152 AND sc_item.identifierref = sc_resource.import_id 1153 AND sc_resource.scormtype = %s ) 1154 GROUP BY scorm_object.obj_id, 1156 scorm_object.c_type, 1157 scorm_object.slm_id, 1158 scorm_object.obj_id',
1159 array(
'integer',
'text'),
1160 array($this->
getId(),
'sco')
1163 while ($val_rec =
$ilDB->fetchAssoc($val_set)) {
1164 $scos[] = $val_rec[
'scoid'];
1169 public function getStatusForUser(
int $a_user, array $a_allScoIds,
bool $a_numerical =
false): bool
1172 $ilDB = $DIC->database();
1173 $scos = $a_allScoIds;
1176 $scos_c = implode(
',', $scos);
1178 $val_set =
$ilDB->queryF(
1180 SELECT sco_id FROM scorm_tracking 1183 AND ' .
$ilDB->in(
'sco_id', $scos,
false,
'integer') .
' 1184 AND ((lvalue = %s AND ' .
$ilDB->like(
'rvalue',
'clob',
'completed') .
') OR (lvalue = %s AND ' .
$ilDB->like(
'rvalue',
'clob',
'passed') .
') ) )',
1185 array(
'integer',
'integer',
'text',
'text',),
1186 array($a_user,$this->getID(),
'cmi.core.lesson_status',
'cmi.core.lesson_status')
1188 while ($val_rec =
$ilDB->fetchAssoc($val_set)) {
1189 $key = array_search($val_rec[
'sco_id'], $scos);
1193 if (count($scos) == 0) {
1194 $completion = ($a_numerical ===
true) ?
true : $this->
lng->txt(
"cont_complete");
1196 if (count($scos) > 0) {
1197 $completion = ($a_numerical ===
true) ?
false : $this->
lng->txt(
"cont_incomplete");
1213 $ilDB = $DIC->database();
1216 'DELETE FROM scorm_tracking WHERE user_id = %s',
1221 'DELETE FROM sahs_user WHERE user_id = %s',
1230 $ilDB = $DIC->database();
1232 $retAr = array(
"raw" => null,
"max" => null,
"scaled" => null);
1233 $val_set =
$ilDB->queryF(
1235 SELECT lvalue, rvalue FROM scorm_tracking 1238 AND (lvalue = 'cmi.core.score.raw' OR lvalue = 'cmi.core.score.max')",
1239 array(
'integer',
'integer'),
1240 array($a_item_id, $a_user_id)
1242 while ($val_rec =
$ilDB->fetchAssoc($val_set)) {
1243 if ($val_rec[
'lvalue'] ===
"cmi.core.score.raw") {
1244 $retAr[
"raw"] = $val_rec[
"rvalue"];
1246 if ($val_rec[
'lvalue'] ===
"cmi.core.score.max") {
1247 $retAr[
"max"] = $val_rec[
"rvalue"];
1250 if ($retAr[
"raw"] != null && $retAr[
"max"] != null) {
1251 $retAr[
"scaled"] = ($retAr[
"raw"] / $retAr[
"max"]);
1260 $ilDB = $DIC->database();
1261 $val_set =
$ilDB->queryF(
1262 'SELECT last_visited FROM sahs_user WHERE obj_id = %s AND user_id = %s',
1263 array(
'integer',
'integer'),
1264 array($this->getID(),$user_id)
1266 while ($val_rec =
$ilDB->fetchAssoc($val_set)) {
1267 if ($val_rec[
"last_visited"] != null) {
1268 return "" . $val_rec[
"last_visited"];
1277 $ilDB = $DIC->database();
1281 foreach ($a_users as $usr) {
1285 DELETE FROM scorm_tracking 1288 array(
'integer',
'integer'),
1289 array(
$user, $this->getID())
1294 DELETE FROM sahs_user 1297 array(
'integer',
'integer'),
1298 array(
$user, $this->getID())
const LP_STATUS_COMPLETED_NUM
static _getStatusForUser(int $a_id, int $a_user, array $a_allScoIds, bool $a_numerical=false)
Get the status of a SCORM module for a given user.
importSuccess(string $a_file)
static _getCourseCompletionForUser(int $a_id, int $a_user)
Get the completion of a SCORM module for a given user.
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
get_user_id(string $a_login)
getUserIdEmail(string $a_mail)
assumes that only one account exists for a mailadress
getAttemptsForUsers()
Get attempts for all users.
deleteTrackingDataOfUsers(array $a_users)
__construct(int $a_id=0, bool $a_call_by_reference=true)
Constructor.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
importTrackingData(string $a_file)
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
const LP_STATUS_NOT_ATTEMPTED
importSuccessForSahsUser(int $user_id, string $last_access, int $status, ?int $attempts=null, ?int $percentage_completed=null, ?int $sco_total_time_sec=null)
static _removeTrackingDataForUser(int $user_id)
to be called from IlObjUser
getTrackedItems()
get all tracked items of current user
static _lookupPercentage(int $a_obj_id, int $a_user_id)
Lookup percentage.
const LP_STATUS_IN_PROGRESS_NUM
getCourseCompletionForUser(int $a_user)
loadLanguageModule(string $a_module)
Load language module.
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
static _getTrackingItems(int $a_obj_id)
get all tracking items of scorm object
getModuleVersionForUser(int $a_user_id)
get module version that tracking data for a user was recorded on
static now()
Return current timestamp in Y-m-d H:i:s format.
const LP_STATUS_IN_PROGRESS
getStatusForUser(int $a_user, array $a_allScoIds, bool $a_numerical=false)
static _getScoresForUser(int $a_item_id, int $a_user_id)
static _enabledLearningProgress()
lookupSCOId(string $a_referrer)
resolves manifest SCOID to internal ILIAS SCO ID
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static userDataArrayForExport(int $user, bool $b_allowExportPrivacy=false)
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
static userDataHeaderForExport()
getTrackingDataAgg(int $a_user_id)
static _refreshStatus(int $a_obj_id, ?array $a_users=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
sendExportFile(string $a_header, string $a_content)
send export file to browser
getLastVisited(int $user_id)
getTrackingDataPerUser(int $a_sco_id, int $a_user_id)
Get tracking data per user.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupStatus(int $a_obj_id, int $a_user_id, bool $a_create=true)
Lookup status.
static _lookupReadEvents($obj_id, $usr_id=null)
Reads all read events which occured on the object.
importRaw(string $a_file)
Import raw data.
getModuleVersionForUsers()
Get module version for users.
foreach($mandatory_scripts as $file) $timestamp
const LP_STATUS_NOT_ATTEMPTED_NUM
getDataDirectory(?string $mode="filesystem")
get data directory of lm
static __readStatus(int $a_obj_id, int $user_id)
PhpInconsistentReturnPointsInspection
exportSelected(bool $a_all, array $a_users=array())
Export selected user tracking data ilObjUser $ilUser.
setLearningProgressSettingsAtUpload()
set settings for learning progress determination per default at upload
__construct(Container $dic, ilPlugin $plugin)
getTrackingDataAggSco(int $a_sco_id)
readObject()
read manifest file
getTrackedUsers(string $a_search)
Return the last access timestamp for a given user.
static _deleteReadEventsForUsers(int $a_obj_id, array $a_user_ids)
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
getAttemptsForUser(int $a_user_id)
get number of attempts for a certain user and package
static getInstance(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getAllScoIds(int $a_id)
Get an array of id's for all Sco's in the module.
parseUserId(string $il_id)
Parse il_usr_123_6 id.
Class ilObjSCORMLearningModule.
const LP_STATUS_FAILED_NUM
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)